A Github Action for checking commit message formatting, branch naming, committer name, email, commit signoff and more.
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
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }} # Checkout PR HEAD commit
- uses: commit-check/commit-check-action@v1
with:
message: true
branch: true
author-name: true
author-email: true
commit-signoff: true
dry-run: true
job-summary: true
pr-comments: true
- Description: check commit message formatting convention.
- By default the rule follows conventional commits.
- Default: 'true'
- Description: check git branch naming convention.
- By default follow bitbucket conventional branch.
- Default: 'true'
- Description: check committer author name
- Default: 'true'
- Description: check committer author email
- Default: 'true'
- Description: check committer commit signature
- Default: 'true'
- 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: 'true'
Important
This is a experimental feature
use it you need to set GITHUB_TOKEN
in the GitHub Action.
Note: the default rule of above inputs is following this configuration, if you want to customize just add your .commit-check.yml
config file under your repository root directory.
By default, commit-check-action results are shown on the job summary page of the workflow.
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.