{"id":18521793,"url":"https://github.com/transferwise/actions-pr-checker","last_synced_at":"2025-04-09T09:33:26.400Z","repository":{"id":45543650,"uuid":"310608457","full_name":"transferwise/actions-pr-checker","owner":"transferwise","description":"Github Action to check PR title/description/labels.","archived":false,"fork":false,"pushed_at":"2023-03-17T01:42:51.000Z","size":115,"stargazers_count":5,"open_issues_count":3,"forks_count":2,"subscribers_count":69,"default_branch":"master","last_synced_at":"2025-03-24T04:43:26.469Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"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/transferwise.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-06T13:43:59.000Z","updated_at":"2024-06-19T09:48:39.000Z","dependencies_parsed_at":"2024-11-06T17:46:07.102Z","dependency_job_id":null,"html_url":"https://github.com/transferwise/actions-pr-checker","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transferwise%2Factions-pr-checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transferwise%2Factions-pr-checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transferwise%2Factions-pr-checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transferwise%2Factions-pr-checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/transferwise","download_url":"https://codeload.github.com/transferwise/actions-pr-checker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248012864,"owners_count":21033254,"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-06T17:27:38.613Z","updated_at":"2025-04-09T09:33:26.061Z","avatar_url":"https://github.com/transferwise.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# actions-pr-checker\nGithub Action to check PR title/description/labels. Feature rich and flexible.\n\nValidation strings are regular expressions. Don't forget to escape special chars.\nComparison of substrings for title and description is done in bash using built-in `~=` operator. \n\nLabels are strictly checked to be equal - not as a substring nor a regexp.\n\n## Quick start:\n```yml\nname: PR checker\n\non:\n  pull_request:\n    branches: [master, main]\n    types: [opened, edited, labeled, unlabeled, synchronize]\n\njobs:\n  pr-checker:\n\n    name: Check PR description\n    runs-on: [ubuntu-latest]\n    steps:\n\n      - name: Run check\n        uses: transferwise/actions-pr-checker@v3\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          PR_NOT_CONTAINS_PATTERN: 'Why is this PR necessary?'\n          PR_COMMENT: |\n            Please check description. \n            Should be meaningful and not empty.\n```\n\n## Parameters\n| Name | Description | Default | Required |\n|------|-------------|---------|:--------:|\n|GITHUB_TOKEN | github bot token | | yes |\n|PR_CONTAINS_PATTERN | Regexp to validate PR body | `.*` | no\n|PR_NOT_CONTAINS_PATTERN | Regexp to validate PR body | `pseudo-long-string-constant` | no |\n|PR_TITLE_CONTAINS_PATTERN | Regexp to validate PR title | `.*` | no\n|PR_TITLE_NOT_CONTAINS_PATTERN | Regexp to validate PR title | `pseudo-long-string-constant` | | \n|PR_TAGS_MANDATORY | Should have at least 1 tag from the list. Use JSON format in single quotes: '[\"bug\", \"feature\"]' | `` | | \n|PR_TAGS_MIN_COUNT | Minimum number of tags | `0` | |\n|PR_TAGS_RESTRICTED | Allow only tags from the list. If empty - allow everything | `` | | \n|PR_COMMENT | Comment to add, if validation not passing| `Please check description. \\nShould be meaningful and not empty.` | |\n|SUCCESS_EMOJI | Reaction to PR if check success. Possible: `+1` `-1` `laugh` `confused` `heart` `hooray` `rocket` `eyes` (ref: https://developer.github.com/v3/reactions/#reaction-types). If empty - no reaction | `+1` |  |\n|SUCCESS_COMMENT | Add comment if check success. If empty - no comment | `` |  |\n|SUCCESS_APPROVES_PR | Approve PR when check pass. If set to `false` won't request changes, but add comments instead | true | |\n|FAIL_CLOSES_PR | Close PR in case of check fails | false | |\n|FAIL_EXITS | Fail the check if validation not passing. Use `false` if you want comment, but mark as check as success | true | |\n\n\n## More examples\n### Check PR description is longer than 100 chars\n```yaml\n      - name: Run check\n        uses: transferwise/actions-pr-checker@v3\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          PR_CONTAINS_PATTERN: '.{100,}'\n```\n### Check PR title complies with convention\n```yaml\n      - name: Check PR title\n        uses: transferwise/actions-pr-checker@v3\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          PR_TITLE_CONTAINS_PATTERN: '.*(\\\\w{3})-([0-9]+).+[^.]$'\n          PR_COMMENT: |\n            Please check PR title.\n            Should follow https://namingconvention.org/git/pull-request-naming.html.\n```\n### Check PR labels are set\n```yaml\n      - name: Run check\n        uses: transferwise/actions-pr-checker@v3\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          PR_TAGS_MANDATORY: '[\"change:standard\", \"change:impactful\", \"change:emergency\", \"bug\"]'\n          PR_COMMENT: \"Make sure you added required tags\"\n```\n### Not approve PR, only comment\n```yaml\n      - name: Check that PR matches recommendations\n        uses: transferwise/actions-pr-checker@v3\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          SUCCESS_APPROVES_PR: false\n          PR_CONTAINS_PATTERN: '.{500,}'\n          PR_TAGS_MANDATORY: '[\"bug\", \"feature\", \"refactoring\"]'\n          PR_COMMENT: |\n            We would appreciate if you add a valid label (`\"bug\", \"feature\", \"refactoring\"`).\n            Also please make sure that your description is well structured and understandable (recommended \u003e500 chars)\n          SUCCESS_COMMENT: Now that's a good PR!\n```\n### Close PR if unappropriate\n```yaml\n      - name: Check if PR unappropriate\n        uses: transferwise/actions-pr-checker@v3\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          FAIL_CLOSES_PR: true\n          PR_NOT_CONTAINS_PATTERN: 'Total refactoring'\n          PR_TAGS_MANDATORY: '[\"bug\", \"feature\"]'\n          PR_TAGS_RESTRICTED: '[\"refactoring\"]'\n          PR_COMMENT: |\n            We found out that you are using \"Total refactory\" phrasing either \"refactoring\" tag. \n            This is currently not acceptable before we do major release.\n            Your PR will be rejected.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransferwise%2Factions-pr-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftransferwise%2Factions-pr-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransferwise%2Factions-pr-checker/lists"}