Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

jira-smart-commit

jessedobbelaere5.1kMIT1.2.0

A githook script that transforms commit messages to JIRA smart commits based on branch names

git, jira, smart commit, husky, git hook

readme

JIRA Smart Commit

tests GitHub release Dependabot MIT license Downloads PRs Welcome

A Node.js git hook script to prefix commits automatically with the JIRA ticket, based on a branch name.

Usage

Installation

  1. Install Husky in your project to configure Git hooks easily.
npm install --save-dev husky
npx husky init
  1. Install this package in your project:
npm install --save-dev jira-smart-commit
  1. Configure scripts in package.json. The script expects his first argument to be the JIRA tag of the project.
# .husky/commit-msg
npx jira-smart-commit YOUR_JIRA_ISSUE_KEY

Alternatively: use a regex to detect the Jira ISSUE_KEY in your branch.

  • TAG_MATCHER - regular expression
  • TAG_MATCH_INDEX - match index

Example: if your branch names looke like feature/JRA-1234/some-description template

# .husky/commit-msg
TAG_MATCHER=\"^[^/]+/(JRA-[0-9]+)\" TAG_MATCH_INDEX=1 npx jira-smart-commit
  1. Commit with git like usual. If the branch was prefixed with a JIRA tag, your commit message will get a Jira prefix added with the same tag.
Branch: JRA-411-husky-git-hooks
Commit message: "Add git hooks to project""JRA-411 Add git hooks to project"

changelog

Changelog

1.2.0

  • Bump dependencies + support husky v9 #73
  • Fix release-it script 63a4feb

1.1.2 (2020-11-03)

  • Display warning when trying to commit to master, main or develop #41
  • Bump mocha from 6.2.2 to 7.1.2 #25
  • Bump sinon from 7.5.0 to 9.0.2 #24
  • Bump mocha from 6.2.0 to 6.2.2 #11
  • Bump sinon from 7.4.2 to 7.5.0 #9
  • Upgrades and code cleanup (#42) 8866ac4
  • Update README.md f8e0ec0

1.1.1 (2019-09-18)

  • Bump proxyquire from 2.1.0 to 2.1.3 #8
  • Bump sinon from 7.2.2 to 7.4.2 #7
  • Bump mocha from 5.2.0 to 6.2.0 #6
  • Add badges to Readme 5002979

1.1.0 (2018-12-28)

  • Bump dependencies and release #5
  • Make more flexible to catch task name & use HUSKY_GIT_PARAMS if GIT_P… #4
  • Add bin executable statement #2
  • make more flaxible to catch task name & use HUSKY_GIT_PARAMS if GIT_PARAMS was not passed e67ad89

1.0.2 (2017-10-18)

  • Add bin executable statement 7c66fa6

1.0.1 (2017-10-13)

  • Fix duplicate prefixes being added #1
  • Add more shields b0f89b3

1.0.0 (2017-09-07)