Merge pull request '[DO-000] test new version scripts' (#6) from feature/DO-000_test into master

Reviewed-on: https://git.avroid.tech/Sandbox/githooks/pulls/6
This commit is contained in:
Denis Patrakeev
2024-02-14 13:20:20 +03:00

View File

@@ -48,7 +48,7 @@ do
# Get Git commit information
#
BRANCH_NAME_FULL=$refname
BRANCH_NAME="$(echo $BRANCH_NAME_FULL | sed 's/refs\/heads\///g')"
BRANCH_NAME="$(echo $BRANCH_NAME_FULL | sed 's/refs\/\(heads\|pull\)\///g')"
COMMIT_MESSAGE=$(git log --format=%B -n 1)
echo "[INFO] BRANCH NAME: $BRANCH_NAME"
@@ -59,7 +59,7 @@ do
#
echo "[INFO] Policy - Check that brunch name is enforced by branch name"
# Regexp for allowed names of branches
branch_name_format='^master|^main|^feature\/[a-zA-Z0-9,\.\_\-]+-[0-9]+.*|^hotfix\/.*|^bugfix\/.*'
branch_name_format='^[0-9]+\/head|^master|^main|^feature\/[a-zA-Z0-9,\.\_\-]+-[0-9]+.*|^hotfix\/.*|^bugfix\/.*'
if [[ ! $BRANCH_NAME =~ $branch_name_format ]]; then
echo "$error_msg_branch" >&2