{"id":19317991,"url":"https://github.com/prymitive/pint-action","last_synced_at":"2025-04-22T17:30:55.141Z","repository":{"id":45840047,"uuid":"514843155","full_name":"prymitive/pint-action","owner":"prymitive","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-15T15:03:20.000Z","size":162,"stargazers_count":4,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-15T16:23:38.775Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prymitive.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":"docs/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-07-17T12:54:42.000Z","updated_at":"2025-04-15T15:03:09.000Z","dependencies_parsed_at":"2023-02-15T00:31:39.491Z","dependency_job_id":"fb75cef6-16a0-4dde-ba46-49b219d48a76","html_url":"https://github.com/prymitive/pint-action","commit_stats":{"total_commits":46,"total_committers":4,"mean_commits":11.5,"dds":0.4782608695652174,"last_synced_commit":"240322a99b84de9693ac58951be75c80f71a79cd"},"previous_names":[],"tags_count":141,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prymitive%2Fpint-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prymitive%2Fpint-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prymitive%2Fpint-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prymitive%2Fpint-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prymitive","download_url":"https://codeload.github.com/prymitive/pint-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250287425,"owners_count":21405611,"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":[],"created_at":"2024-11-10T01:16:52.124Z","updated_at":"2025-04-22T17:30:54.856Z","avatar_url":"https://github.com/prymitive.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pint action\n\nThis action will run [pint](https://github.com/cloudflare/pint)\nto validate Prometheus rules.\nIt will run `pint ci` for pull requests and `pint lint` for\nmerges.\n\n## Inputs\n\n### `token`\n\nGithub token to use when reporting problems on the pull request.\nRequired, no default.\n\n### `workdir`\n\nDirectory to run check against on pushes (for example after a merge).\nTo set directories tested when running checks on a pull request please\ncreate a config file for pint and set `ci { include = [...] }` option.\nSee [pint docs](https://cloudflare.github.io/pint/configuration.html#ci) for details.\nDefault is `\".\"`.\n\n### `config`\n\nConfig file to use. Default is `\"\"`, meaning no `--config` flag will be passed\nto `pint` and it will use defaults.\n\n### `loglevel`\n\nLog level for pint. Default is `\"\"`, meaning no `--log-level` flag will be passed\nto `pint` and it will use defaults.\n\n### `minSeverity`\n\nMinimum severity reported by the **lint** command. Default is `\"\"`, meaning no `--min-severity` flag will be passed\nto `pint` and it will use defaults.\n\nAvailable options : `info`, `warning` *(lint default)*, `bug` `fatal`.\n\n### `requireOwner`\n\nIf set to any non-empty string pint will be run with `--require-owner` flag.\nPassing this flag will require all rule files or individual rules to have owner set via comment.\n\n## Requirements\n\nValidating PRs require full git history and so `actions/checkout` must be used\nwith `fetch-depth: 0` option.\n\nBe sure to use a token with write access to the `pull-requests` scope.\n\n## Example usage\n\n```YAML\nname: pint\n\non:\n  push:\n    branches:\n      - main\n  pull_request:\n    branches:\n      - main\n\npermissions:\n  pull-requests: write\n\njobs:\n  pint:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n        with:\n          fetch-depth: 0\n\n      - name: Run pint\n        uses: prymitive/pint-action@v1\n        with:\n          token: ${{ github.token }}\n          workdir: 'rules'\n          requireOwner: 'true'\n```\n\n## Pull Requests from Forks\n\nIt is possible to use Pint with pull requests originating from forked repositories. There is some additional configuration. An example configuration could look like:\n\n```YAML\nname: pint\n\non:\n  push:\n    branches:\n      - main\n  pull_request:\n    branches:\n      - main\n\npermissions:\n  pull-requests: write\n\njobs:\n  pint:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n        with:\n          fetch-depth: 0\n          ref: ${{ github.event.pull_request.head.sha }} # REQUIRED FOR PRs FROM FORKS | https://github.com/actions/checkout/issues/124#issuecomment-586664611\n\n      - name: Run pint\n        uses: prymitive/pint-action@v1\n        with:\n          token: ${{ github.token }}\n          workdir: 'rules'\n          requireOwner: 'true'\n          pr_target_repo: ${{ github.event.pull_request.base.repo.full_name }} # REQUIRED FOR PRs FROM FORKS\n          pr_source_repo: ${{ github.event.pull_request.head.repo.full_name }} # REQUIRED FOR PRs FROM FORKS\n```\n\nSome caveats:\n\n- The `pull_requests` permission will *not* be granted \"write\" access [for pull request from public forks](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token). This is a GitHub limitation.\n- `pr_target_repo` and `pr_source_repo` must both be set to the variables indicated\n- `actions/checkout@v3` must be set with `ref: ${{ github.event.pull_request.head.sha }}`\n\nThe only work around to get `pull-requests: write` permission on the default GITHUB_TOKEN is to make your repository private. For example, this can work well in a Github Enterprise environment. Github has chosen to set \"Maximum access for pull requests from public forked repositories\" to \"read\" on every single token scope.\n\nOnce your repository is private, you can set `Send write tokens to workflows from fork pull requests` or `Send secrets and variables to workflows from fork pull requests` under the Actions settings menu.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprymitive%2Fpint-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprymitive%2Fpint-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprymitive%2Fpint-action/lists"}