From e4e4aacce93fc40e30b9198fe31b69815bd65c31 Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Thu, 13 Jan 2022 19:22:52 +0100 Subject: [PATCH] chore: skip wiredeps on backport branches --- tasks/wiredeps | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tasks/wiredeps b/tasks/wiredeps index 8b768d05..d4f332bd 100755 --- a/tasks/wiredeps +++ b/tasks/wiredeps @@ -4,11 +4,21 @@ FEATURE_BRANCH= # https://docs.github.com/en/actions/reference/environment-variables#default-environment-variables -# skip default branch and tags -if [[ $GITHUB_REF =~ ^refs/heads/master$ ]] || [[ $GITHUB_REF =~ ^refs/tags/ ]]; then +# skip master / backport branches and tags +if [[ "$GITHUB_REF" =~ ^refs/heads/(master$|[0-9]+\.x) ]] || [[ "$GITHUB_REF" =~ ^refs/tags/ ]]; then + echo "Skip wiredeps: master/backport branch"; + exit 0; 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 FEATURE_BRANCH=$([ $GITHUB_HEAD_REF != "" ] && echo $GITHUB_HEAD_REF || echo "$GITHUB_REF" | cut -d"/" -f3) @@ -20,4 +30,4 @@ if [ $? -ne 0 ]; then echo "Falling back to diagram-js@develop"; npm install "diagram-js@bpmn-io/diagram-js#develop"; -fi +fi \ No newline at end of file