about summary refs log tree commit diff
path: root/.github/workflows
diff options
context:
space:
mode:
authorWill Bush <git@willbush.dev>2024-04-25 01:27:55 -0500
committerWill Bush <git@willbush.dev>2024-04-25 02:03:11 -0500
commit16121d4dc6f91aee6361ebc1b8ad0f063f1fb10f (patch)
treec2ad61aff358c176bace9ed3fd638f6a1fc846a0 /.github/workflows
parentafa610b882b834cf1dab335edd8e8b22f26e94da (diff)
workflows: add concurrency group to check-by-name workflow (again)
This is the second attempt to add a concurrency group to the check-by-name in
hopes that it will reduce unnecessary load on the CI system (wasted electricity)
despite free cost.

first attempt: https://github.com/NixOS/nixpkgs/pull/306072
revert: https://github.com/NixOS/nixpkgs/pull/306430
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/check-by-name.yml7
1 files changed, 7 insertions, 0 deletions
diff --git a/.github/workflows/check-by-name.yml b/.github/workflows/check-by-name.yml
index 38e63f32237aa..5863d0186f9bc 100644
--- a/.github/workflows/check-by-name.yml
+++ b/.github/workflows/check-by-name.yml
@@ -20,6 +20,13 @@ permissions:
   # We need this permission to cancel the workflow run if there's a merge conflict
   actions: write
 
+# Create a check-by-name concurrency group based on the pull request number. if
+# an event triggers a run on the same PR while a previous run is still in
+# progress, the previous run will be canceled and the new one will start.
+concurrency:
+  group: check-by-name-${{ github.event.pull_request.number }}
+  cancel-in-progress: true
+
 jobs:
   check:
     # This needs to be x86_64-linux, because we depend on the tooling being pre-built in the GitHub releases