A pre-commit
hook to check commit messages for
Conventional Commits formatting.
Make sure pre-commit
is installed.
Create a blank configuration file at the root of your repo, if needed:
touch .pre-commit-config.yaml
Add a new repo entry to your configuration file:
repos:
- repo: https://github.com/erskaggs/jira-pre-commit
rev: v1.0.4
hooks:
- id: jira-pre-commit
stages: [commit-msg]
Install the pre-commit
script:
pre-commit install --hook-type commit-msg
Make a (normal) commit without a jira ticket:
$ git commit -m "add a new feature"
Jira Ticket Key..........................................................Failed
- hook id: jira-pre-commit
- exit code: 1
Aborting commit. Your commit message is missing either a JIRA Issue, i.e. JIRA-1234.
Make a commit with a jira ticket
$ git commit -m "JIRA-1234 add a new feature"
Jira Ticket Key..........................................................Passed
Versioning generally follows Semantic Versioning.
In addition to the strict version tag, we also maintain a "latest" tag for each
major version, e.g. v1
always points to the latest v1.x.x
tag.
Inspired by matthorgan's pre-commit-conventional-commits
.