JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1352
  • Score
    100M100P100Q113989F
  • License MIT

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

Package Exports

  • jira-smart-commit
  • jira-smart-commit/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jira-smart-commit) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

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"