From f4c90006a50cb5bca02cd626cffb6913ee63b00e Mon Sep 17 00:00:00 2001 From: Toyo Date: Mon, 28 Oct 2024 15:33:44 -0500 Subject: [PATCH] update checkbranch sh --- .husky/scripts/check-branch.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.husky/scripts/check-branch.sh b/.husky/scripts/check-branch.sh index cd7578c4..dc33974b 100644 --- a/.husky/scripts/check-branch.sh +++ b/.husky/scripts/check-branch.sh @@ -11,10 +11,11 @@ develop_branch="^develop$" feature_branch="^feature\/[a-zA-Z0-9_-]+$" bugfix_branch="^bugfix\/[a-zA-Z0-9_-]+$" release_branch="^release\/[0-9]+(\.[0-9]+)*$" +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 ]]; 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 @@ -26,6 +27,7 @@ else echo "- bugfix/" echo "- release/" echo "- hotfix/" + echo "- .build" echo "where can be alphanumeric (letters, numbers, hyphens, or underscores)." echo "example feature/ICDC-2555" exit 1