ci: cancel prior test runs for the same git ref (#9819)

This should save on CI quite a bit. This will cancel our GHA runs when
you push to the same ref, except for `main`, where I want to make sure
every commit is tested.
pull/9705/head
Mitchell Hashimoto 2025-12-05 08:44:10 -08:00 committed by GitHub
commit 08c9661683
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View File

@ -1,5 +1,10 @@
on: [push, pull_request]
name: Nix
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name != 'main' && github.ref || github.run_id }}
cancel-in-progress: true
jobs:
required:
name: "Required Checks: Nix"

View File

@ -5,6 +5,11 @@ on:
name: Test
# We only want the latest commit to test for any non-main ref.
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name != 'main' && github.ref || github.run_id }}
cancel-in-progress: true
jobs:
required:
name: "Required Checks: Test"