Skip to content

Commit

Permalink
fix .* and other branch wildcards combinations
Browse files Browse the repository at this point in the history
  • Loading branch information
sbe-arg committed Sep 27, 2022
1 parent bf19f78 commit 01b7312
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 01b7312

Please sign in to comment.