From fd73f0955f8dae7641a64d23f10b7782986a6830 Mon Sep 17 00:00:00 2001 From: Cameron Clough Date: Tue, 15 Nov 2022 13:07:46 -0800 Subject: [PATCH] CI: use github.head_ref to group PR action runs (#26505) * CI: use github.head_ref to group PR action runs for push triggers, github.ref is set to the "branch or tag ref that was pushed" for pull_request triggers, it is set to the "pull request merge branch" (master?) github.head_ref is only set when the trigger is pull_request https://docs.github.com/en/actions/learn-github-actions/contexts#github-context * only check github.ref for push event old-commit-hash: a662af57c7de750df4f1650ee4079c56665b817e --- .github/workflows/selfdrive_tests.yaml | 2 +- .github/workflows/tools_tests.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/selfdrive_tests.yaml b/.github/workflows/selfdrive_tests.yaml index 598f2c592b..f2cc51285d 100644 --- a/.github/workflows/selfdrive_tests.yaml +++ b/.github/workflows/selfdrive_tests.yaml @@ -7,7 +7,7 @@ on: pull_request: concurrency: - group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/master' && github.ref || github.run_id }}-${{ github.event_name }} + group: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.run_id || github.head_ref || github.ref }}-${{ github.workflow }}-${{ github.event_name }} cancel-in-progress: true env: diff --git a/.github/workflows/tools_tests.yaml b/.github/workflows/tools_tests.yaml index 549a2f4195..94cc3c2580 100644 --- a/.github/workflows/tools_tests.yaml +++ b/.github/workflows/tools_tests.yaml @@ -7,7 +7,7 @@ on: pull_request: concurrency: - group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/master' && github.ref || github.run_id }}-${{ github.event_name }} + group: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.run_id || github.head_ref || github.ref }}-${{ github.workflow }}-${{ github.event_name }} cancel-in-progress: true env: