From 9332b01fd2f6ae427d159ef9acb810e2bf1c1bf0 Mon Sep 17 00:00:00 2001 From: Alan Greene Date: Wed, 11 Dec 2024 14:44:53 +0000 Subject: [PATCH] Update concurrency settings for E2E to cancel old PR-triggered runs 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. --- .github/workflows/e2e.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index ce9ef1d74..54a9fa8ce 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -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