{"id":13532893,"url":"https://github.com/MorrisonCole/pr-lint-action","last_synced_at":"2025-04-01T21:31:15.257Z","repository":{"id":36389960,"uuid":"224069848","full_name":"MorrisonCole/pr-lint-action","owner":"MorrisonCole","description":":octocat:  A fast 🔥 TypeScript GitHub Action to ensure that your PR title matches a given regex.","archived":false,"fork":false,"pushed_at":"2024-10-29T17:40:40.000Z","size":55907,"stargazers_count":64,"open_issues_count":14,"forks_count":23,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-29T18:59:29.179Z","etag":null,"topics":["bot","github-actions","linter","review","typescript","workflow"],"latest_commit_sha":null,"homepage":"https://morrisoncole.co.uk","language":"JavaScript","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/MorrisonCole.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":"2019-11-26T00:47:24.000Z","updated_at":"2024-10-29T17:40:44.000Z","dependencies_parsed_at":"2023-09-26T00:26:43.683Z","dependency_job_id":"b618895c-f490-4bc6-a14c-4441af2c72a9","html_url":"https://github.com/MorrisonCole/pr-lint-action","commit_stats":{"total_commits":535,"total_committers":13,"mean_commits":41.15384615384615,"dds":0.4373831775700935,"last_synced_commit":"cb967da7c6977007271b2ca9cc29c29f74d29fc5"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":"actions/container-toolkit-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MorrisonCole%2Fpr-lint-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MorrisonCole%2Fpr-lint-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MorrisonCole%2Fpr-lint-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MorrisonCole%2Fpr-lint-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MorrisonCole","download_url":"https://codeload.github.com/MorrisonCole/pr-lint-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246713071,"owners_count":20821836,"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":["bot","github-actions","linter","review","typescript","workflow"],"created_at":"2024-08-01T07:01:14.662Z","updated_at":"2025-04-01T21:31:15.243Z","avatar_url":"https://github.com/MorrisonCole.png","language":"JavaScript","funding_links":[],"categories":["Community Resources"],"sub_categories":["Pull Requests"],"readme":"# Pull Request Linter [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n\n:octocat: A fast 🔥 TypeScript GitHub Action to ensure that your PR title\nmatches a given regex.\n\nSupports the following feedback mechanisms 🛠:\n\n- 🤖 Review, request/dismiss changes, and comment with bot\n- ❌ Fail action\n\n## Usage\n\nCreate a workflow definition at `.github/workflows/\u003cmy-workflow\u003e.yml` with\nsomething like the following contents:\n\n```yaml\nname: PR Lint\n\non:\n  pull_request:\n    # By default, a workflow only runs when a pull_request's activity type is opened, synchronize, or reopened. We\n    # explicity override here so that PR titles are re-linted when the PR text content is edited.\n    #\n    # Possible values: https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-event-pull_request\n    types: [opened, edited, reopened, synchronize]\n\njobs:\n  pr-lint:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: morrisoncole/pr-lint-action@v1.7.1\n        with:\n          # Note: if you have branch protection rules enabled, the `GITHUB_TOKEN` permissions\n          # won't cover dismissing reviews. Your options are to pass in a custom token\n          # (perhaps by creating some sort of 'service' user and creating a personal access\n          # token with the correct permissions) or to turn off `on-failed-regex-request-changes`\n          # and use action failure to prevent merges instead (with\n          # `on-failed-regex-fail-action: true`). See:\n          # https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token\n          # https://docs.github.com/en/rest/pulls/reviews#dismiss-a-review-for-a-pull-request\n          repo-token: \"${{ secrets.GITHUB_TOKEN }}\"\n          title-regex: \"#[eE][xX]-[0-9]+\"\n          on-failed-regex-fail-action: false\n          on-failed-regex-create-review: true\n          on-failed-regex-request-changes: false\n          on-failed-regex-comment:\n            \"This is just an example. Failed regex: `%regex%`!\"\n          on-succeeded-regex-dismiss-review-comment:\n            \"This is just an example. Success!\"\n```\n\n## Options\n\n| Option                                      | Required? | Type   | Default Value                      | Description                                                                                                                                                   |\n| ------------------------------------------- | --------- | ------ | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `repo-token`                                | yes       | string | N/A                                | [About the `GITHUB_TOKEN` secret](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret).           |\n| `title-regex`                               | yes       | string | \".\\*\"                              | A JavaScript regex to test the title of each Pull Request against. Allows anything by default.                                                                |\n| `on-failed-regex-fail-action`               | no        | bool   | false                              | If the regex fails, sets the action status to failed. When the action exits it will be with an exit code of 1.                                                |\n| `on-failed-regex-create-review`             | no        | bool   | true                               | If the regex fails, uses the GitHub review mechanism to submit a review. The review type is determined by `on-failed-regex-request-changes`.                  |\n| `on-failed-regex-request-changes`           | no        | bool   | true                               | Uses 'Request Changes' when creating a review. Otherwise, uses 'Comment'. _Note:_ if `on-failed-regex-create-review` is `false`, this won't do anything.      |\n| `on-failed-regex-comment`                   | no        | string | \"PR title failed to match %regex%\" | Comment for the bot to post on PRs that fail the regex (or the console output if `on-failed-regex-create-review` is `false`). Use %regex% to reference regex. |\n| `on-succeeded-regex-dismiss-review-comment` | no        | string | \"All good!\"                        | The message to post as a comment when the regex succeeds after previously failing.                                                                            |\n\n## Changelog\n\n### v1.7.1\n\n- Upgrade Node from 16 -\u003e 20 ([thanks @sirLisko](https://github.com/MorrisonCole/pr-lint-action/pull/735)! 🙏).\n\n### v1.7.0\n\n- Fixes [#389](https://github.com/MorrisonCole/pr-lint-action/issues/389): once\n  the bot has commented once, it will now update that comment rather than\n  creating new ones.\n- Fixes [#333](https://github.com/MorrisonCole/pr-lint-action/issues/333):\n  removed trailing period from the end of the default error message.\n\n### v1.6.1\n\n- Fixes [#266](https://github.com/MorrisonCole/pr-lint-action/issues/266): the\n  success comment will now be created once the PR Lint succeeds, even when\n  `on-failed-regex-create-review` is set to false. Thank you @talboren for\n  reporting, debugging, and fixing this! 💪\n\n### v1.6.0\n\n- Updated documentation to recommend running the action on PR `synchronize`\n  events too, so that the checks won't go stale.\n- Fixes [#175](https://github.com/MorrisonCole/pr-lint-action/issues/175): can\n  now customize the success message when reviews are dismissed using\n  `on-succeeded-regex-dismiss-review-comment`.\n- Fixes [#171](https://github.com/MorrisonCole/pr-lint-action/issues/171): run\n  action with Node 16.\n- Upgrade dependencies.\n\n### v1.5.1\n\nInternal refactoring only:\n\n- Migrate to Yarn 2.\n- Upgrade dependencies.\n\n### v1.5.0\n\n- Reduces action run time from around 40 seconds to 1 second 🔥🚀. We now ship\n  the packaged source with Vercel's [ncc](https://github.com/vercel/ncc) and run\n  those directly rather than building on the fly with Docker.\n\n### v1.4.2\n\n- Fixes [#155](https://github.com/MorrisonCole/pr-lint-action/issues/155).\n  Thanks to @ui-valts-mazurs for reporting _and_ fixing this one!\n\n### v1.4.1\n\n- Fixes [#145](https://github.com/MorrisonCole/pr-lint-action/issues/145)\n  (thanks @jnewland! 🤩).\n\n### v1.4.0\n\n- Adds [#119](https://github.com/MorrisonCole/pr-lint-action/issues/119) (thanks\n  @bryantbiggs! 🙏) the ability to configure whether changes are requested or\n  not with `on-failed-regex-request-changes`. Existing behaviour is preserved.\n- Upgrades all dependencies.\n\n### v1.3.0\n\n- Adds [#111](https://github.com/MorrisonCole/pr-lint-action/issues/111), the\n  ability to specify whether to create a review and whether to fail the action\n  on a regex mismatch independently with `on-failed-regex-fail-action` \u0026\n  `on-failed-regex-create-review`.\n- `on-failed-regex-comment` is no longer a required input.\n\n_Note:_ existing behaviour from previous releases is preserved without\nadditional configuration 🙏.\n\n### v1.2.3\n\nInternal refactoring only:\n\n- Upgrade dependencies.\n- Move from `lib` to `dist`.\n- Address ESLint warnings.\n\n### v1.2.2\n\n- Fixes [#92](https://github.com/MorrisonCole/pr-lint-action/issues/92).\n\n### v1.2.1\n\n- Fixes [#90](https://github.com/MorrisonCole/pr-lint-action/issues/90).\n\n### v1.1.1\n\nInternal refactoring only:\n\n- Upgrade dependencies.\n- Configure ESLint \u0026 Prettier.\n\n### v1.1.0\n\n- Replaced status checks with an automatic bot review. If the PR title fails to\n  match the regex, the bot will request changes. Once the title is edited to\n  match it, the bot will dismiss its review.\n- Upgrade dependencies.\n\n### v1.0.0\n\n- Initial release. This version uses action status checks but suffers from\n  [#5](https://github.com/MorrisonCole/pr-lint-action/issues/5) since the GitHub\n  actions API treats different hook types as separate checks by default.\n\n## FAQ\n\n### Why doesn't this Action use status checks any more?\n\nSince actions\n[are currently not grouped together](https://github.community/t5/GitHub-Actions/duplicate-checks-on-pull-request-event/m-p/33157),\npreviously failed status checks were persisted despite newer runs succeeding\n(reported in [#5](https://github.com/MorrisonCole/pr-lint-action/issues/5)). We\nmade the decision to use a bot-based 'request changes' workflow for the time\nbeing.\n\n## Developing\n\n### Build \u0026 Package\n\n`yarn install`\n\n`yarn build`\n\n`yarn package`: We package everything to a single file with Vercel's\n[ncc](https://github.com/vercel/ncc). Outputs to `dist/index.js`.\n\n### Validate Renovate Config\n\n`npx --package renovate -c renovate-config-validator`\n\n## Related Reading\n\n- [GitHub Action Metadata Syntax](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMorrisonCole%2Fpr-lint-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMorrisonCole%2Fpr-lint-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMorrisonCole%2Fpr-lint-action/lists"}