A GitHub Action for checking commit message formatting, branch naming, committer name, email, commit signoff, and more.
What's New in v2
Important
This v2 release introduces several 🚨breaking changes. Please review the Breaking Changes section carefully before upgrading.
Breaking Changes
- Removed support for
commit-signoff,merge-base, andimperativeinputs — now configured viacommit-check.tomlorcchk.toml. - Deprecated
.commit-check.ymlin favor ofcommit-check.tomlorcchk.toml. - Changed default values of
author-nameandauthor-emailinputs tofalseto align with the default behavior in commit-check. - Upgraded core dependency
commit-checkto v2.0.0.
Table of Contents
- Usage
- Optional Inputs
- GitHub Action Job Summary
- GitHub Pull Request Comments
- Badging Your Repository
- Versioning
Usage
Create a new GitHub Actions workflow in your project, e.g. at .github/workflows/commit-check.yml
name: Commit Check on: push: pull_request: branches: 'main' jobs: commit-check: runs-on: ubuntu-latest permissions: # use permissions because use of pr-comments contents: read pull-requests: write steps: - uses: actions/checkout@v5 with: fetch-depth: 0 # Required for merge-base checks - uses: commit-check/commit-check-action@v2 with: message: true branch: true author-name: false author-email: false job-summary: true pr-comments: ${{ github.event_name == 'pull_request' }}
Used By
Apache
discovery-unicamp
Texas Instruments
OpenCADC
Extrawest
Chainlift
Mila
RLinf
and many more.
Optional Inputs
message
- Description: check git commit message following Conventional Commits.
- Default:
true
branch
- Description: check git branch name following Conventional Branch.
- Default:
true
author-name
- Description: check committer author name.
- Default:
false
author-email
- Description: check committer author email.
- Default:
false
dry-run
- Description: run checks without failing. exit code is 0; otherwise is 1.
- Default:
false
job-summary
- Description: display job summary to the workflow run.
- Default:
true
pr-comments
- Description: post results to the pull request comments.
- Default:
false
Important
pr-comments is an experimental feature. By default, it's disabled.
PR comments are skipped for pull requests from forked repositories. For more details, refer to issue #143.
Note: the default rule of above inputs is following this configuration. If you want to customize, just add your commit-check.toml config file under your repository root directory.
GitHub Action Job Summary
By default, commit-check-action results are shown on the job summary page of the workflow.
Success Job Summary
Failure Job Summary
GitHub Pull Request Comments
Success Pull Request Comment
Failure Pull Request Comment
Badging Your Repository
You can add a badge to your repository to show your contributors/users that you use commit-check!
Markdown
[](https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml)
reStructuredText
.. image:: https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml/badge.svg
:target: https://github.com/commit-check/commit-check-action/actions/workflows/commit-check.yml
:alt: Commit Check
Versioning
Versioning follows Semantic Versioning.
Have questions or feedback?
To provide feedback (requesting a feature or reporting a bug), please post to issues.



