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
#!/bin/bash | |
# This hook both checks that the name of the branch matches a given convention | |
# and extracts the issue number from the branch name to add it to the commit message. | |
# If it is a multiline commit message the reference to the issue is added as a new line. | |
# In the case of a single line commit message, the reference is added at the end of the message. | |
BRANCH_NAME_REGEX="^(ci|docs|feature|fix|hotfix|perf|refactor|test)\/.*$" | |
ISSUE_NUMBER_REGEX="^.*\#([0-9]+)" |