bpmn-js/tasks/wiredeps

24 lines
658 B
Plaintext
Raw Permalink 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
2021-04-30 17:38:25 +00:00
# skip default branch and tags
if [[ $GITHUB_REF =~ ^refs/heads/master$ ]] || [[ $GITHUB_REF =~ ^refs/tags/ ]]; then
exit 0;
fi
2019-04-12 14:13:28 +00:00
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