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
pull/26509/head
Cameron Clough 2 years ago committed by GitHub
parent bdc432d218
commit a662af57c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .github/workflows/selfdrive_tests.yaml
  2. 2
      .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:

@ -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:

Loading…
Cancel
Save