Skip to content

Commit

Permalink
Update concurrency settings for E2E to cancel old PR-triggered runs
Browse files Browse the repository at this point in the history
Define a concurrency group for the E2E workflow and configure it to
cancel in progress runs when a new run is triggered.

For PRs this means that only the latest run triggered for a given PR
will be completed as any in progress runs will be cancelled.

For push events to the `main` branch, a fallback is used (`run_id`) as
the `head_ref` is only defined for PR events. This means that we will
run the E2E to completion on each push event as expected.
  • Loading branch information
AlanGreene committed Dec 11, 2024
1 parent 91f8b4c commit 9332b01
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
# The branches below must be a subset of the branches above
branches: ["main"]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

defaults:
run:
shell: bash
Expand Down

0 comments on commit 9332b01

Please sign in to comment.