{"id":14985994,"url":"https://github.com/gsactions/commit-message-checker","last_synced_at":"2025-04-06T11:07:52.147Z","repository":{"id":38336800,"uuid":"223419404","full_name":"GsActions/commit-message-checker","owner":"GsActions","description":"GitHub Action that checks commit messages of pushes and pull request against a regex pattern","archived":false,"fork":false,"pushed_at":"2024-02-21T15:46:16.000Z","size":638,"stargazers_count":101,"open_issues_count":13,"forks_count":62,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-23T10:07:17.016Z","etag":null,"topics":["action","actions","github-actions","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/GsActions.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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},"funding":{"github":"gilbertsoft","custom":"https://paypal.me/SGilli"}},"created_at":"2019-11-22T14:22:45.000Z","updated_at":"2025-02-27T09:13:25.000Z","dependencies_parsed_at":"2024-06-18T11:21:11.189Z","dependency_job_id":"890c0baf-b458-4384-91b4-492a38532650","html_url":"https://github.com/GsActions/commit-message-checker","commit_stats":{"total_commits":45,"total_committers":9,"mean_commits":5.0,"dds":"0.28888888888888886","last_synced_commit":"4c06ad2446942246543ef9c50f672a58782bf7b0"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GsActions%2Fcommit-message-checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GsActions%2Fcommit-message-checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GsActions%2Fcommit-message-checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GsActions%2Fcommit-message-checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GsActions","download_url":"https://codeload.github.com/GsActions/commit-message-checker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246730309,"owners_count":20824399,"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":["action","actions","github-actions","typescript"],"created_at":"2024-09-24T14:12:06.275Z","updated_at":"2025-04-06T11:07:52.130Z","avatar_url":"https://github.com/GsActions.png","language":"TypeScript","funding_links":["https://github.com/sponsors/gilbertsoft","https://paypal.me/SGilli"],"categories":[],"sub_categories":[],"readme":"# GS Commit Message Checker\n\n![Version](https://img.shields.io/github/v/release/gsactions/commit-message-checker?style=flat-square)\n![Test](https://github.com/gsactions/commit-message-checker/workflows/build-test/badge.svg)\n\nA GitHub action that checks that commit messages match a regex pattern. The\naction is able to act on pull request and push events and check the pull\nrequest title and body, or the commit message of the commits of a push.\n\nOn pull requests the title and body are concatenated, delimited by two line\nbreaks.\n\nDesigned to be very flexible in usage, you can split checks into various\nworkflows, use action types on pull request to listen on, define branches\nfor pushes etc. etc.\n\n## Configuration\n\nSee also [action definition](action.yml) and the following example workflow.\n\nMore information about `pattern` and `flags` can be found in the\n[JavaScript reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp).\n\n`flags` is optional and defaults to `gm`.\n\n`excludeDescription`, `excludeTitle` and `checkAllCommitMessages` are optional.\nDefault behavior is to include the description and title and not check pull\nrequest commit messages.\n\n### Example Workflow\n\n```yml\nname: 'Commit Message Check'\non:\n  pull_request:\n    types:\n      - opened\n      - edited\n      - reopened\n      - synchronize\n  pull_request_target:\n    types:\n      - opened\n      - edited\n      - reopened\n      - synchronize\n  push:\n    branches:\n      - main\n      - 'releases/*'\n\njobs:\n  check-commit-message:\n    name: Check Commit Message\n    runs-on: ubuntu-latest\n    steps:\n      - name: Check Commit Type\n        uses: gsactions/commit-message-checker@v2\n        with:\n          pattern: '\\[[^]]+\\] .+$'\n          flags: 'gm'\n          error: 'Your first line has to contain a commit type like \"[BUGFIX]\".'\n      - name: Check Line Length\n        uses: gsactions/commit-message-checker@v2\n        with:\n          pattern: '^[^#].{74}'\n          error: 'The maximum line length of 74 characters is exceeded.'\n          excludeDescription: 'true' # optional: this excludes the description body of a pull request\n          excludeTitle: 'true' # optional: this excludes the title of a pull request\n          checkAllCommitMessages: 'true' # optional: this checks all commits associated with a pull request\n          accessToken: ${{ secrets.GITHUB_TOKEN }} # github access token is only required if checkAllCommitMessages is true\n      - name: Check for Resolves / Fixes\n        uses: gsactions/commit-message-checker@v2\n        with:\n          pattern: '^.+(Resolves|Fixes): \\#[0-9]+$'\n          error: 'You need at least one \"Resolves|Fixes: #\u003cissue number\u003e\" line.'\n```\n\n### Troubleshooting and debugging\n\nMost of the questions being asked here are not about bugs or missing features in\nthis action, but about not enough information about what is going on in the\nbackground. A good first starting point is to [enable debug logging](https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging)\nfor the action, which can be accomplished by adding secrets to your repository.\nAfter that, many additional information will appear in the logs and you should\nbe able to set up your configuration properly.\n\nThere are some really good tools that you can use to set up your pattern\nproperly for your needs. My favorite tool is \u003chttps://regexr.com/\u003e which works\nvery well with this action.\n\nIf you need additional support, please head to the [GitHub Discussions](https://github.com/GsActions/commit-message-checker/discussions)\nof this repository.\n\n## Development\n\n### Quick Start\n\n```sh\ngit clone https://github.com/gsactions/commit-message-checker.git\nnpm install\nnpm run build\n```\n\nThat's it, just start editing the sources...\n\n### Commands\n\nBelow is a list of commands you will probably find useful during the development\ncycle.\n\n#### `npm run build`\n\nBuilds the package to the `lib` folder.\n\n#### `npm run format`\n\nRuns Prettier on .ts and .tsx files and fixes errors.\n\n#### `npm run format-check`\n\nRuns Prettier on .ts and .tsx files without fixing errors.\n\n#### `npm run lint`\n\nRuns Eslint on .ts and .tsx files.\n\n#### `npm run pack`\n\nBundles the package to the `dist` folder.\n\n#### `npm run test`\n\nRuns Jest test suites.\n\n#### `npm run all`\n\nRuns all the above commands.\n\n### Debugging\n\nMore information about debugging GitHub Actions can be found at \u003chttps://github.com/actions/toolkit/blob/main/docs/action-debugging.md\u003e.\n\nThe secrets `ACTIONS_STEP_DEBUG` and `ACTIONS_RUNNER_DEBUG` are both set to\n`true` in the main repository.\n\n## License\n\nThis project is released under the terms of the [MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgsactions%2Fcommit-message-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgsactions%2Fcommit-message-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgsactions%2Fcommit-message-checker/lists"}