{"id":14070550,"url":"https://github.com/actions-ecosystem/action-lint-commits","last_synced_at":"2025-07-25T13:31:43.309Z","repository":{"id":36955095,"uuid":"313013934","full_name":"actions-ecosystem/action-lint-commits","owner":"actions-ecosystem","description":"🔍 GitHub Action to lint commits on a pull request","archived":false,"fork":false,"pushed_at":"2023-01-23T09:02:07.000Z","size":343,"stargazers_count":14,"open_issues_count":5,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-11T17:04:24.749Z","etag":null,"topics":["actions","commit","github","lint"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/actions-ecosystem-action-lint-commits","language":"TypeScript","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/actions-ecosystem.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-11-15T11:15:13.000Z","updated_at":"2024-09-05T09:55:04.000Z","dependencies_parsed_at":"2023-02-12T21:46:09.856Z","dependency_job_id":null,"html_url":"https://github.com/actions-ecosystem/action-lint-commits","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"4992f4a8f2279c06cf18008c5f7a77896ccd9a78"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actions-ecosystem%2Faction-lint-commits","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actions-ecosystem%2Faction-lint-commits/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actions-ecosystem%2Faction-lint-commits/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actions-ecosystem%2Faction-lint-commits/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/actions-ecosystem","download_url":"https://codeload.github.com/actions-ecosystem/action-lint-commits/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227578612,"owners_count":17788908,"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":["actions","commit","github","lint"],"created_at":"2024-08-13T07:07:51.766Z","updated_at":"2024-12-01T14:32:02.849Z","avatar_url":"https://github.com/actions-ecosystem.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Action Lint Commits\n\n[![actions-workflow-test][actions-workflow-test-badge]][actions-workflow-test]\n[![release][release-badge]][release]\n[![license][license-badge]][license]\n\n![screenshot](./docs/assets/screenshot.png)\n\nThis is a GitHub Action to lint commits on a pull request based one regex.\n\nIt's designed to work with other GitHub Actions so that you can flexibly build your workflow like posting warning comments in GitHub issues, Slack, and anything.\n\n## Inputs\n\n|      NAME      |                                             DESCRIPTION                                             |   TYPE   | REQUIRED | DEFAULT |\n| -------------- | --------------------------------------------------------------------------------------------------- | -------- | -------- | ------- |\n| `github_token` | A GitHub token.                                                                                     | `string` | `true`   | `N/A`   |\n| `regex`        | The regex for commit messages.                                                                      | `string` | `true`   | `N/A`   |\n| `format`       | The output format of `outputs.{matched_commits,unmatched_commits}` in ['markdown', 'json', 'yaml']. | `string` | `true`   | `N/A`   |\n\n## Outputs\n\n|        NAME         |                  DESCRIPTION                  |   TYPE   |\n| ------------------- | --------------------------------------------- | -------- |\n| `matched_commits`   | The commits which match `inputs.regex`.       | `string` |\n| `unmatched_commits` | The commits which don't match `inputs.regex`. | `string` |\n\nYou would pass the outputs to the inputs of other GitHub Actions to use the result of lint.\n\n### Output Examples\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003ccode\u003eformat='markdown'\u003c/code\u003e\u003c/summary\u003e\n\n```markdown\n- [`sha1xxxx`](https://github.com/owner/repo/commit/sha1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx): message 1\n- [`sha2xxxx`](https://github.com/owner/repo/commit/sha2xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx): message 2\n- [`sha3xxxx`](https://github.com/owner/repo/commit/sha3xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx): message 3\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003ccode\u003eformat='json'\u003c/code\u003e\u003c/summary\u003e\n\n```json\n[\n  {\n    \"message\": \"message 1\",\n    \"sha\": \"sha1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\n    \"url\": \"https://github.com/owner/repo/commit/sha1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n  },\n  {\n    \"message\": \"message 2\",\n    \"sha\": \"sha2xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\n    \"url\": \"https://github.com/owner/repo/commit/sha2xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n  },\n  {\n    \"message\": \"message 3\",\n    \"sha\": \"sha3xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\n    \"url\": \"https://github.com/owner/repo/commit/sha3xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n  }\n]\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003ccode\u003eformat='yaml'\u003c/code\u003e\u003c/summary\u003e\n\n```yaml\n- message: \"message 1\"\n  sha: \"sha1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n  url: \"https://github.com/owner/repo/commit/sha1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n- message: \"message 2\"\n  sha: \"sha2xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n  url: \"https://github.com/owner/repo/commit/sha2xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n- message: \"message 3\"\n  sha: \"sha3xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n  url: \"https://github.com/owner/repo/commit/sha3xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n```\n\n\u003c/details\u003e\n\n## Example\n\n```yaml\nname: Lint Commits\n\non:\n  pull_request_target:\n    types: [\"opened\", \"reopened\", \"synchronize\"]\n\njobs:\n  lint_commits:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Lint commits\n        uses: actions-ecosystem/action-lint-commits@v1\n        id: lint-commits\n        with:\n          github_token: ${{ secrets.GITHUB_TOKEN }}\n          regex: '^\\w+\\(.+\\): .+' # e.g.) \"feat(api): Add /users/get\"\n          format: markdown\n\n      - name: Post warning comment\n        uses: actions-ecosystem/action-create-comment@v1\n        if: ${{ steps.lint-commits.outputs.unmatched_commits != '' }}\n        with:\n          github_token: ${{ secrets.GITHUB_TOKEN }}\n          body: |\n            The following commits needs their message changes:\n\n            ${{ steps.lint-commits.outputs.unmatched_commits }}\n\n            The format `\u003ctype\u003e(\u003cscope\u003e): \u003csubject\u003e` (`^\\w+\\(.+\\): .+`) is acceptable. e.g., `feat(api): Add /users/get`\n\n      - name: Fail when commits don't pass lint\n        if: ${{ steps.lint-commits.outputs.unmatched_commits != '' }}\n        run: exit 1\n\n```\n\n## License\n\nCopyright 2020 The Actions Ecosystem Authors.\n\nAction Lint Commits is released under the [Apache License 2.0](./LICENSE).\n\n\u003c!-- badge links --\u003e\n\n[actions-workflow-test]: https://github.com/actions-ecosystem/action-lint-commits/actions?query=workflow%3ATest\n[actions-workflow-test-badge]: https://img.shields.io/github/workflow/status/actions-ecosystem/action-lint-commits/Test?label=Test\u0026style=for-the-badge\u0026logo=github\n\n[release]: https://github.com/actions-ecosystem/action-lint-commits/releases\n[release-badge]: https://img.shields.io/github/v/release/actions-ecosystem/action-lint-commits?style=for-the-badge\u0026logo=github\n\n[license]: LICENSE\n[license-badge]: https://img.shields.io/github/license/actions-ecosystem/action-lint-commits?style=for-the-badge\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factions-ecosystem%2Faction-lint-commits","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Factions-ecosystem%2Faction-lint-commits","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factions-ecosystem%2Faction-lint-commits/lists"}