bpmn-js/tasks/wiredeps_github

23 lines
561 B
Bash
Executable File

#!/bin/bash
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
exit 0;
fi
FEATURE_BRANCH=$(echo "$GITHUB_REF" | cut -d"/" -f3)
echo "Attempting to install diagram-js@$FEATURE_BRANCH";
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