A GitHub Action for checking commit message formatting, branch naming, committer name, email, commit signoff, and more.
Important
This v2 release introduces several 🚨breaking changes. Please review the Breaking Changes section carefully before upgrading.
- 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.
- Usage
- Optional Inputs
- GitHub Action Job Summary
- GitHub Pull Request Comments
- Advanced Configuration
- Fork PR Comments
- Badging Your Repository
- Versioning
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' }}Note
This action supports running on Linux, macOS, and Windows (ubuntu-latest, macos-latest, windows-latest).
Apache
discovery-unicamp
Texas Instruments
OpenCADC
Extrawest
Chainlift
Mila
RLinf
Collective
and many more.
- Description: check git commit message following Conventional Commits.
- Default:
true
- Description: check git branch name following Conventional Branch.
- Default:
true
- Description: check committer author name.
- Default:
false
- Description: check committer author email.
- Default:
false
- Description: run checks without failing. exit code is 0; otherwise is 1.
- Default:
false
- Description: display job summary to the workflow run.
- Default:
true
- Description: post results to the pull request comments.
- Default:
false
Note
pr-comments is disabled by default.
PR comments are skipped for pull requests from forked repositories. See docs/fork-pr-comments.md for details on how to enable this feature for fork contributions.
Note: write-access to pull-requests requires the pull-requests: write permission.
See usage example.
- Description: check pull request title following Conventional Commits.
- Default:
false
Tip
This is especially useful for teams using Squash & Merge, where the PR title becomes the final commit message in the main branch. When enabled, the action validates the PR title against your Conventional Commits configuration, giving early feedback at PR time rather than after merge.
pr-title works alongside message — you can enable both to validate the PR
title and individual commits, or just one depending on your workflow.
This setting only applies to pull_request and pull_request_target events;
it is silently ignored on push events.
Important
By default, pull_request does not trigger on title changes.
To validate the PR title immediately when updated, add edited to your
workflow's event types:
on:
pull_request:
types: [opened, synchronize, reopened, edited]Without edited, only the initial title (at PR creation) is validated.
The Optional Inputs above cover the most common settings.
For everything else (e.g., subject-capitalized, require-signed-off-by,
ai-attribution, custom allow-commit-types, etc.), you have two approaches:
Set any CCHK_* environment variable in your workflow step — no config file required:
- uses: commit-check/commit-check-action@v2
env:
CCHK_SUBJECT_CAPITALIZED: "true"
CCHK_REQUIRE_SIGNED_OFF_BY: "true"
CCHK_AI_ATTRIBUTION: "forbid"
CCHK_ALLOW_COMMIT_TYPES: "feat,fix,docs,chore"All available environment variables follow the naming convention:
CCHK_ + uppercase option name with underscores instead of hyphens. See the
full mapping
in the commit-check documentation.
Add a commit-check.toml or cchk.toml to the root of your repository.
Refer to the configuration guide
for all available options.
Note
Configuration priority: CLI args > environment variables > config file > defaults. The action itself doesn't set any CLI flags beyond those in Optional Inputs, so env vars and config files are the recommended way to customize.
By default, commit-check-action results are shown on the job summary page of the workflow.
When a pull request is opened from a forked repository, the GITHUB_TOKEN used by the
pull_request event has read-only permissions by design (GitHub security policy).
This means pr-comments: true cannot write a comment back to the PR.
By default, commit-check-action handles this gracefully:
- PR comment writing is skipped with a
::warning::message in the logs - A notice is added to the Job Summary explaining why and how to fix it
- The commit checks themselves still run normally
For most projects, this is sufficient — contributors can see check results in the action Job Summary. But if you must have PR comments on fork contributions, see the Fork PR Comments documentation for two recommended approaches with ready-to-use workflow examples.
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 follows Semantic Versioning.
To provide feedback (requesting a feature or reporting a bug), please post to issues.



