Skip to content

Commit f6d68d3

Browse files
committed
CI: Add concurrency control to semver-checks PR job
This is to avoid a race condition where a job scheduled for a first push finished after the job scheduled for a second push, resulting in incorrectly assigning / removing a label to PR.
1 parent 4297204 commit f6d68d3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.github/workflows/semver_checks.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ jobs:
3232
# has permissions.
3333
permissions: {}
3434
timeout-minutes: 30
35+
# This is to prevent a situation, when job A triggered by push 1 finishes
36+
# after job B triggered by push 2. That could result in incorrectly assigning
37+
# or removing a PR label.
38+
concurrency:
39+
# Can't use `env.PR_ID` because concurrency doesn't have access to env context.
40+
group: semver-pull-request-check-${{ github.event.number }}
41+
cancel-in-progress: true
3542
outputs:
3643
exitcode: ${{ steps.semver-pr-check.outputs.exitcode }}
3744
output: ${{ steps.semver-pr-check.outputs.output }}

0 commit comments

Comments
 (0)