]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-134309: Add ``github.actor`` to the GitHub Actions concurrency key (#134310)
authorKira <coldcaption@gmail.com>
Thu, 22 May 2025 03:49:07 +0000 (23:49 -0400)
committerGitHub <noreply@github.com>
Thu, 22 May 2025 03:49:07 +0000 (04:49 +0100)
When inexperienced users create a PR from their default branch, all of the concurrency keys
collide as there is no namespacing. This becomes an issue at events with many new contributors,
where workflow runs are cancelled on other pull requests.
Disambiguate by adding the username of the relevant 'actor' to the concurrency key.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Sviatoslav Sydorenko <sviat@redhat.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
.github/workflows/build.yml

index b192508c78685c439742fb8e89b2f92ed365cf10..54ebc914b468213ab2f42984fab019a034c66c15 100644 (file)
@@ -15,7 +15,13 @@ permissions:
   contents: read
 
 concurrency:
-  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-reusable
+  # https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#concurrency
+  # 'group' must be a key uniquely representing a PR or push event.
+  # github.workflow is the workflow name
+  # github.actor is the user invoking the workflow
+  # github.head_ref is the source branch of the PR or otherwise blank
+  # github.run_id is a unique number for the current run
+  group: ${{ github.workflow }}-${{ github.actor }}-${{ github.head_ref || github.run_id }}
   cancel-in-progress: true
 
 env: