Don't cancel workflows when in PR

This commit is contained in:
Mamy André-Ratsimbazafy 2020-10-06 16:14:45 +02:00
parent aee7f12376
commit 874e7068ab
No known key found for this signature in database
GPG Key ID: 7B88AD1FE79492E1
1 changed files with 7 additions and 2 deletions

View File

@ -78,8 +78,13 @@ jobs:
- name: Get branch name
shell: bash
run: |
echo "##[set-output name=branch_name;]$(echo ${GITHUB_REF#refs/heads/})"
echo "Branch found: ${GITHUB_REF#refs/heads/}"
if [[ '${{ github.event_name }}' == 'pull_request']]; then
echo "##[set-output name=branch_name;]$(echo ${GITHUB_HEAD_REF})"
echo "Branch found (PR): ${GITHUB_HEAD_REF}"
else
echo "##[set-output name=branch_name;]$(echo ${GITHUB_REF#refs/heads/})"
echo "Branch found (not PR): ${GITHUB_REF#refs/heads/}"
fi
id: get_branch
- name: Cancel Previous Runs (except master/devel)