From 874e7068abd0b17a141dcb1c50e1149dcc48c79f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mamy=20Andr=C3=A9-Ratsimbazafy?= Date: Tue, 6 Oct 2020 16:14:45 +0200 Subject: [PATCH] Don't cancel workflows when in PR --- .github/workflows/ci.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4216a05cd..707d7f571 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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)