chore: correct commit hook regex
Previously all branch names had to have two dashes. Now it can have one to six words. ref: N25B-89
This commit is contained in:
@@ -8,11 +8,11 @@ if echo "$branch" | grep -Eq "(dev|main)"; then
|
||||
fi
|
||||
|
||||
# allowed pattern <type/>
|
||||
if echo "$branch" | grep -Eq "^(feat|fix|refactor|perf|style|test|docs|build|chore|revert)\/\w+-\w+-\w+"; then
|
||||
if echo "$branch" | grep -Eq "^(feat|fix|refactor|perf|style|test|docs|build|chore|revert)\/\w+(-\w+){0,5}$"; then
|
||||
echo "✅ Branch name valid: $branch"
|
||||
exit 0
|
||||
else
|
||||
echo "❌ Invalid branch name: $branch"
|
||||
echo "Branch must be named <type>/<description-of-branch> (must have 2 stipes - -)"
|
||||
echo "Branch must be named <type>/<description-of-branch> (must have one to six words separated by a dash)"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user