From b1f7a7cfaadbb9dc42d6c302b2e4ebae6887579a Mon Sep 17 00:00:00 2001 From: Zac Hatfield-Dodds Date: Sat, 16 Jul 2022 16:36:43 -0500 Subject: [PATCH] Auto-cancel outdated PR builds --- .github/workflows/main.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 372bf80943..ee98853a4f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,6 +12,12 @@ on: branches: [ master ] workflow_dispatch: +# Cancel in-progress PR builds if another commit is pushed. +# On non-PR builds, fall back to the globally-unique run_id and don't cancel. +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: test: runs-on: ubuntu-latest