Skip to content

Commit b709887

Browse files
authored
chore(ci): Update concurrency configuration in auto-update-tools workflow (#6582)
1 parent 55eaa36 commit b709887

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

.github/workflows/auto-update-tools.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ permissions:
2323
pull-requests: write
2424

2525
# Concurrency configuration:
26-
# - We use a named concurrency group to prevent multiple instances of this workflow from running
27-
# simultaneously, which could lead to race conditions when creating branches and pull requests.
28-
# Since this workflow modifies version files and creates PRs, concurrent runs could interfere
29-
# with each other, resulting in conflicting branches or duplicate PRs.
26+
# - For pull requests, we use a workflow-and-ref–scoped group to keep runs isolated per PR while
27+
# still cancelling outdated runs on the same PR.
28+
# - For non-PR events (schedule, workflow_dispatch, pushes), we use a fixed global group so only
29+
# one repository-wide run can execute at a time, preventing race conditions when creating
30+
# branches and pull requests.
3031
# - We enable cancellation of in-progress runs because only the most recent run matters for
31-
# version updates. There's no value in completing outdated runs, especially for scheduled
32-
# workflows that might queue up overnight. This approach conserves GitHub Actions minutes
33-
# and ensures we're always working with the latest repository state.
32+
# version updates. This conserves GitHub Actions minutes and ensures we always work with the
33+
# latest repository state.
3434
concurrency:
35-
group: "auto-update-tools"
35+
group: ${{ github.event_name == 'pull_request' && format('{0}-{1}', github.workflow, github.ref) || 'auto-update-tools' }}
3636
cancel-in-progress: true
3737

3838
jobs:
@@ -113,11 +113,7 @@ jobs:
113113
# to make auto-update-tools a required check with only running the auto-update-tools when required.
114114
# So, we don't have to run auto-update-tools, for example, for unrelated changes.
115115
auto_update_tools-required-check:
116-
needs:
117-
[
118-
files-changed,
119-
auto-update-tools,
120-
]
116+
needs: [files-changed, auto-update-tools]
121117
name: Auto Update Tools
122118
# This is necessary since a failed/skipped dependent job would cause this job to be skipped
123119
if: always()

0 commit comments

Comments
 (0)