bpmn-js/tasks/wiredeps

33 lines
919 B
Plaintext
Raw Normal View History

#!/bin/bash
2019-04-12 14:13:28 +00:00
FEATURE_BRANCH=
2021-04-30 17:38:25 +00:00
# https://docs.github.com/en/actions/reference/environment-variables#default-environment-variables
2019-04-12 14:13:28 +00:00
# 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
2019-04-12 14:13:28 +00:00
# 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
2021-05-28 13:33:32 +00:00
# GITHUB_HEAD_REF is set for pull request
FEATURE_BRANCH=$([ $GITHUB_HEAD_REF != "" ] && echo $GITHUB_HEAD_REF || echo "$GITHUB_REF" | cut -d"/" -f3)
2019-04-12 14:13:28 +00:00
echo "Attempting to install diagram-js@$FEATURE_BRANCH";
2019-04-12 14:13:28 +00:00
npm install "diagram-js@bpmn-io/diagram-js#$FEATURE_BRANCH";
if [ $? -ne 0 ]; then
echo "Falling back to diagram-js@develop";
npm install "diagram-js@bpmn-io/diagram-js#develop";
fi