ci: cancel prior test runs for the same git ref

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/9819/head
Mitchell Hashimoto 2025-12-05 08:41:16 -08:00
parent e5def6f210
commit d09621fa11
No known key found for this signature in database
GPG Key ID: 523D5DC389D273BC
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"