Skip to content

Commit

Permalink
Try out different git command
Browse files Browse the repository at this point in the history
  • Loading branch information
huong-li-nguyen committed Oct 12, 2023
1 parent ee481c0 commit bdcbbe0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tools/check_branch_name.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#!/bin/sh

BRANCH=$(git name-rev --name-only HEAD)
BRANCH=$(git symbolic-ref --short HEAD)
REGEX="^(main|(release|feat|bug|docs|qa|dev|demo|ci|tidy)\/[^/]+(/[^/]+)*)$"


if ! [[ $BRANCH =~ $REGEX ]]; then
echo "Invalid branch name - please rename your branch following this $REGEX syntax."
echo "Branch name '$BRANCH' is invalid - please rename your branch following this regex syntax: $REGEX"
exit 1
fi
fi

0 comments on commit bdcbbe0

Please sign in to comment.