commit:     83cc4761ad935467818a28aa4a84454b34effc84
Author:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 16 16:18:20 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Sep 16 16:27:12 2025 +0000
URL:        https://gitweb.gentoo.org/proj/crossdev.git/commit/?id=83cc4761

ci: cancel running jobs when a new workflow run is triggered via push

Previously, modifying a PR resulted in two workflows being active, both
reserving job slots. But only the later one matters -- that is the whole
point of ***updating*** a PR.

Github doesn't cancel the old, outdated-logic jobs for you, but this
concurrency setting does. This is especially important for crossdev,
since crossdev has a matrix of 48 x 2 jobs, and a PR raised that instead
to 48 x 3 for a grand total of 144 jobs. Each one can take hours. Github
only gives you 20 concurrent jobs.

Any time crossdev CI runs, nothing else in the github org can. At least
avoid days-long waits for the next version of the PR.

Signed-off-by: Eli Schwartz <eschwartz <AT> gentoo.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .github/workflows/crossdev.yml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/.github/workflows/crossdev.yml b/.github/workflows/crossdev.yml
index f74cf03..f9f11ba 100644
--- a/.github/workflows/crossdev.yml
+++ b/.github/workflows/crossdev.yml
@@ -10,6 +10,10 @@ on:
   schedule:
     - cron: 00 4 * * *
 
+concurrency:
+  group: ${{ github.head_ref || github.ref }}
+  cancel-in-progress: true
+
 jobs:
   crossdev:
     strategy:

Reply via email to