1.1.2 • Published 3 years ago

jira-smart-commit v1.1.2

Weekly downloads
1,096
License
MIT
Repository
github
Last release
3 years ago

JIRA Smart Commit

tests GitHub release Dependabot Status 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
  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": {
        "hooks": {
            "commit-msg": "jira-smart-commit YOUR_JIRA_ISSUE_KEY",
            "pre-commit": "lint-staged"
        }
    },

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

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

3 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago