Last active
June 11, 2019 16:22
-
-
Save bogy0/327ffcb6e837542441341713be2e1980 to your computer and use it in GitHub Desktop.
Commit hook to parse actual branch name. Try to find JIRA issue number in the branch name and ammend that to the end of the commit message.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TICKET_ID=$(git rev-parse --abbrev-ref HEAD 2> /dev/null | grep -oE "[A-Z]+-[0-9]+") | |
if [ -n "$TICKET_ID" ]; then | |
echo "$(cat $1)\n$TICKET_ID" > $1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage example with Husky
package.json fragment: