chore: skip wiredeps on backport branches

This commit is contained in:
Nico Rehwaldt 2022-01-13 19:22:52 +01:00 committed by fake-join[bot]
parent 70d38eb447
commit e4e4aacce9
1 changed files with 13 additions and 3 deletions

View File

@ -4,11 +4,21 @@ FEATURE_BRANCH=
# https://docs.github.com/en/actions/reference/environment-variables#default-environment-variables # https://docs.github.com/en/actions/reference/environment-variables#default-environment-variables
# skip default branch and tags # skip master / backport branches and tags
if [[ $GITHUB_REF =~ ^refs/heads/master$ ]] || [[ $GITHUB_REF =~ ^refs/tags/ ]]; then if [[ "$GITHUB_REF" =~ ^refs/heads/(master$|[0-9]+\.x) ]] || [[ "$GITHUB_REF" =~ ^refs/tags/ ]]; then
echo "Skip wiredeps: master/backport branch";
exit 0; exit 0;
fi fi
# skip PR builds targeting master or backport branches
if [[ "$GITHUB_BASE_REF" =~ ^(master$|[0-9]+\.x) ]]; then
echo "Skip wiredeps: targets master/backport branch";
exit 0;
fi
# GITHUB_HEAD_REF is set for pull request # GITHUB_HEAD_REF is set for pull request
FEATURE_BRANCH=$([ $GITHUB_HEAD_REF != "" ] && echo $GITHUB_HEAD_REF || echo "$GITHUB_REF" | cut -d"/" -f3) FEATURE_BRANCH=$([ $GITHUB_HEAD_REF != "" ] && echo $GITHUB_HEAD_REF || echo "$GITHUB_REF" | cut -d"/" -f3)