Skip to content

Commit

Permalink
update checkbranch sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ty-esi committed Oct 28, 2024
1 parent f4c9000 commit e21b92e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .husky/scripts/check-branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ release_build_branch="^[0-9]+\.[0-9]+\.[0-9]+\.build$"
hotfix_branch="^hotfix\/[a-zA-Z0-9_-]+$"

# Check if the branch name matches any of the valid patterns
if [[ $branch_name =~ $main_branch || $branch_name =~ $develop_branch || $branch_name =~ $feature_branch || $branch_name =~ $bugfix_branch || $branch_name =~ $release_branch || $branch_name =~ $hotfix_branch || $branch_name =~ $release_build_branch]]; then
if [[ $branch_name =~ $main_branch || $branch_name =~ $develop_branch || $branch_name =~ $feature_branch || $branch_name =~ $bugfix_branch || $branch_name =~ $release_branch || $branch_name =~ $hotfix_branch || $branch_name =~ $release_build_branch ]]; then
echo "✅ Branch name '$branch_name' is valid."
exit 0
else
Expand All @@ -27,7 +27,7 @@ else
echo "- bugfix/<issue-id>"
echo "- release/<version>"
echo "- hotfix/<issue-id>"
echo "- <version>.build"
echo "- <issue-id>.build"
echo "where <issue-id> can be alphanumeric (letters, numbers, hyphens, or underscores)."
echo "example feature/ICDC-2555"
exit 1
Expand Down

0 comments on commit e21b92e

Please sign in to comment.