From 01b7312f4f5ee6c9de192ebe6eda7550d0099790 Mon Sep 17 00:00:00 2001 From: Santiago Bernhardt Date: Wed, 28 Sep 2022 11:45:29 +1300 Subject: [PATCH 1/2] fix .* and other branch wildcards combinations --- entrypoint.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 3c87c63..bddc9dd 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -36,8 +36,13 @@ current_branch=$(git rev-parse --abbrev-ref HEAD) pre_release="true" IFS=',' read -ra branch <<< "$release_branches" for b in "${branch[@]}"; do - # check if ${current_branch} is in ${release_branches} - if [[ "$current_branch" == "$b" ]] + # check if ${current_branch} is in ${release_branches} | exact branch match + if [[ "$current_branch" == "$b" ]] || [[ "$current_branch" =~ $b ]] + then + pre_release="false" + fi + # verify non specific branch names like .* release/* if wildcard filter then =~ + if [ "$b" != "${b//[\[\]|.? +*]/}" ] && [[ "$current_branch" =~ $b ]] then pre_release="false" fi From b47cbba3a45e434bbe142acd7707663392410883 Mon Sep 17 00:00:00 2001 From: Santiago Bernhardt Date: Wed, 28 Sep 2022 11:47:50 +1300 Subject: [PATCH 2/2] woops --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index bddc9dd..cca2d72 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -37,7 +37,7 @@ pre_release="true" IFS=',' read -ra branch <<< "$release_branches" for b in "${branch[@]}"; do # check if ${current_branch} is in ${release_branches} | exact branch match - if [[ "$current_branch" == "$b" ]] || [[ "$current_branch" =~ $b ]] + if [[ "$current_branch" == "$b" ]] then pre_release="false" fi