{"id":18028063,"url":"https://github.com/karancode/promtool-action","last_synced_at":"2025-03-27T02:31:12.146Z","repository":{"id":47947468,"uuid":"245341477","full_name":"karancode/promtool-action","owner":"karancode","description":"Github action to validate prometheus config/rules using promtool","archived":false,"fork":false,"pushed_at":"2024-04-09T10:48:32.000Z","size":21,"stargazers_count":6,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-22T22:05:36.763Z","etag":null,"topics":["githubactions","prometheus","promtool"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/promtool-github-action","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/karancode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-06T05:58:25.000Z","updated_at":"2021-03-06T15:24:21.000Z","dependencies_parsed_at":"2022-08-12T14:51:21.378Z","dependency_job_id":null,"html_url":"https://github.com/karancode/promtool-action","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karancode%2Fpromtool-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karancode%2Fpromtool-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karancode%2Fpromtool-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karancode%2Fpromtool-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karancode","download_url":"https://codeload.github.com/karancode/promtool-action/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245769291,"owners_count":20669155,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["githubactions","prometheus","promtool"],"created_at":"2024-10-30T08:14:09.584Z","updated_at":"2025-03-27T02:31:11.899Z","avatar_url":"https://github.com/karancode.png","language":"Shell","readme":"# promtool-action\n![GitHub Actions Logo](./img/github_actions_logo.png)  ![Prometheus Logo](./img/prometheus_logo.png)\n\nGithub action to check whether a prometheus config/rule file is syntactically correct without starting a Prometheus server.\n \nThe output of the actions can be viewed from the Actions tab in the main repository view. If the actions are executed on a pull request event, a comment may be posted on the pull request.\n\nPromtool Action is a single GitHub Action that can be executed on different files(config/rules) depending on the content of the GitHub Actions YAML file.\n\n## Success Criteria\nAn exit code of `0` is considered a successful execution.\n\n## Usage\nThe most common usage is to run `promtool check \u003cconfig|rules\u003e` on prometheus config/rules files. A comment will be posted to the pull request depending on the output of the Promtool check command being executed. This workflow can be configured by adding the following content to the GitHub Actions workflow YAML file.\n```yaml\nname: 'Promtool Check Action'\non:\n  pull_request:\n    branches:\n      - master\n    paths:\n      - 'prometheus/rules/*.yml'\njobs:\n  promtool:\n    name: 'Promtool'\n    runs-on: ${{ matrix.os }}\n    strategy:\n      matrix:\n        os: [ubuntu-latest]\n      fail-fast: true\n    steps:\n      - name: 'Checkout'\n        uses: actions/checkout@master\n      - name: 'Promtool Check'\n        uses: karancode/promtool-action@v0.0.1\n        with:\n          prom_version: '2.9.2'      \n          prom_check_subcommand: 'rules'\n          prom_check_files: './prometheus/rules/*.yml'\n          prom_comment: true\n        env:\n          GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n\n```\nThis was a simplified example showing the basic features of this Promtool GitHub Actions. More examples, coming soon!\n\n# Inputs\n\nInputs for Promtool GitHub Actions to perform check action.\n\n* `prom_version` - (Optional) The Prometheus version to use for `promtool check`. Defaults to v`2.16.0`.\n* `prom_check_subcommand` - (Required) The subcommand for promtool check. Currently supported are `config` \u0026 `rules`.\n* `prom_check_files` - (Required) The promtheus config/rules files(s) path to be checked. Make sure set config file path when subcommand is `config` and rules file path when subcommand is `rules`. If there are multiple files, you can either specify regex or set space separated file paths.\n* `prom_comment` - (Optiona) Whether or not to comment on GitHub pull requests. Defaults to `false`.\n\n\n## Outputs\n\nOutputs are used to pass information to subsequent GitHub Actions steps.\n\n* `promtool_output` - The promtool check \u003cconfig|rules\u003e outputs.\n\n## Secrets\n\nSecrets are similar to inputs except that they are encrypted and only used by GitHub Actions. It's a convenient way to keep sensitive data out of the GitHub Actions workflow YAML file.\n\n* `GITHUB_ACCESS_TOKEN` - (Optional) The GitHub API token used to post comments to pull requests. Not required if the `prom_comment` input is set to `false`.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarancode%2Fpromtool-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarancode%2Fpromtool-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarancode%2Fpromtool-action/lists"}