Created
October 30, 2020 16:37
-
-
Save BelooS/faca0dba492cc7c512c3c2f08dbceb66 to your computer and use it in GitHub Desktop.
Check branch name
This file contains hidden or 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
BRANCH_NAME="$1" | |
PATTERN="^feature\/[A-Z]{2,4}\-[0-9]{1,5}\-.*|^bugfix\/[A-Z]{2,4}\-[0-9]{1,5}\-.*|^release\/.*-v[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}$|^junk\/.*|^revert.*|^master$" | |
if ! [[ $BRANCH_NAME =~ $PATTERN ]]; then | |
echo "Invalid branch name $BRANCH_NAME" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment