8000 gh-134309: Add ``github.actor`` to the GitHub Actions concurrency key… · python/cpython@979d81a · GitHub
[go: up one dir, main page]

Skip to content

Commit 979d81a

Browse files
abstractedfoxAA-TurnerwebknjazCAM-Gerlach
authored
gh-134309: Add github.actor to the GitHub Actions concurrency key (#134310)
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>
1 parent 296a660 commit 979d81a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ permissions:
1515
contents: read
1616

1717
concurrency:
18-
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-reusable
18+
# https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#concurrency
19+
# 'group' must be a key uniquely representing a PR or push event.
20+
# github.workflow is the workflow name
21+
# github.actor is the user invoking the workflow
22+
# github.head_ref is the source branch of the PR or otherwise blank
23+
# github.run_id is a unique number for the current run
24+
group: ${{ github.workflow }}-${{ github.actor }}-${{ github.head_ref || github.run_id }}
1925
cancel-in-progress: true
2026

2127
env:

0 commit comments

Comments
 (0)
0