CommitMe provides a Pre-commit hook, GitHub Action, and Command Line Interface for:
- Validating commit messages against the Conventional Commits specification
- Ensure correct integration with GitHub based on extended Pull Request and Commit Message specifications
- Adding labels (
feature
,fix
, orbreaking
) to your Pull Request - Limiting Conventional Commits
scope
andtypes
.
You can add CommitMe as a pre-commit by:
- Installing pre-commit
- Including CommitMe in your
.pre-commit.config.yaml
file, e.g.:
repos:
- repo: https://github.com/dev-build-deploy/commit-me
rev: v0.12.0
hooks:
- id: commit-me
- Installing the
commit-msg
hooks
$ pre-commit install --hook-type commit-msg
The basic workflow can be set up as such:
name: Conventional Commits
on:
pull_request:
types:
- opened
- edited
- synchronize
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }} # Ensure that only one instance of this workflow is running per Pull Request
cancel-in-progress: true # Cancel any previous runs of this workflow
permissions:
contents: read # NOTE; you will need to change this permission to `write` in case you do not provide the `include-commits` input parameter.
pull-requests: write # OPTIONAL; only required when you want CommitMe to update labels in your Pull Request, set `update-labels` to `false` if you do not require this feature.
jobs:
commit-me:
name: Conventional Commits Compliance
runs-on: ubuntu-latest
steps:
- uses: dev-build-deploy/commit-me@v0
with:
token: ${{ github.token }} # Required to retrieve the commits associated with your Pull Request
include-commits: true # OPTIONAL; forces the inclusion of commits associated with your Pull Request
env:
# Enable colored output in GitHub Actions
FORCE_COLOR: 3
You can find more details in the dedicated documentation
Performing local validation is as simple as running the check
command:
$ commit-me check
You can find more details in the dedicated documentation
If you have suggestions for how commit-me could be improved, or want to report a bug, open an issue! We'd love all and any contributions.
For more, check out the Contributing Guide.
- MIT © 2023 Kevin de Jong <monkaii@hotmail.com>
- CC-BY-3.0 © 2023 Free Software Foundation Europe e.V.