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)