Retrieve JIRA information from current branch
$ npm install jira-branch
JIRA_REGEX
matches 5 different types of branches feature|hotfix|bugfix|release|custom
and a jira ticket, i.e. XXXX-00000
extract()
extracts the information from a string
run()
execute a promise that extracts info from current git repo
const jiraBranch = require('jira-branch');
const branch = 'feature/XXX-1337-this-is-a-very-important-task';
jiraBranch.extract(branch);
// => {
// branch: 'feature/XXX-1337-this-is-a-very-important-task',
// type: 'feature',
// ticket: 'XXX-1337'
// }
jiraBranch.run().then((data) => console.log(data));
// => {
// branch: 'feature/XXX-1337-this-is-a-very-important-task',
// type: 'feature',
// ticket: 'XXX-1337'
// }
MIT © Johnie Hjelm