Skip to content

ensures commit message contains jira ticket number

License

Notifications You must be signed in to change notification settings

darwinium-com/jira-pre-commit

 
 

Repository files navigation

jira-pre-commit

A pre-commit hook to check commit messages for Conventional Commits formatting.

Usage

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

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.

License

Apache 2.0

Inspired by matthorgan's pre-commit-conventional-commits.

About

ensures commit message contains jira ticket number

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 100.0%