chore: wire dependencies in GitHub action

This commit is contained in:
Nico Rehwaldt 2021-01-22 14:29:59 +01:00 committed by fake-join[bot]
parent 84c1d44a4d
commit 8a40658b21
2 changed files with 24 additions and 0 deletions

View File

@ -28,6 +28,8 @@ jobs:
${{ runner.OS }}- ${{ runner.OS }}-
- name: Install dependencies - name: Install dependencies
run: npm ci run: npm ci
- name: Wire dependencies
run: ./tasks/wiredeps_github
- name: Build - name: Build
env: env:
COVERAGE: 1 COVERAGE: 1

22
tasks/wiredeps_github Executable file
View File

@ -0,0 +1,22 @@
#!/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