Skip to content

Commit

Permalink
Merge pull request #190 from anothrNick/wildcards
Browse files Browse the repository at this point in the history
Fix wildcard filters for branches
  • Loading branch information
sbe-arg committed Sep 28, 2022
2 parents e7d5838 + f64e2ad commit 5880022
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion entrypoint.sh
Expand Up @@ -36,11 +36,16 @@ 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}
# check if ${current_branch} is in ${release_branches} | exact branch match
if [[ "$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
done
echo "pre_release = $pre_release"

Expand Down

0 comments on commit 5880022

Please sign in to comment.