Skip to content

Commit 145c438

Browse files
authored
Merge pull request #2789 from dgageot/fix-pr-review-concurrency
ci: move concurrency dedup from trigger to review workflow
2 parents f566471 + b38515a commit 145c438

3 files changed

Lines changed: 17 additions & 5 deletions

File tree

.github/workflows/pr-review-trigger.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ on:
55
pull_request_review_comment:
66
types: [created]
77

8-
concurrency:
9-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
10-
cancel-in-progress: true
11-
128
permissions: {}
139

1410
jobs:

.github/workflows/pr-review.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
workflows: ["PR Review - Trigger"]
77
types: [completed]
88

9+
concurrency:
10+
group: pr-review-${{ github.event.issue.number || github.event.workflow_run.pull_requests[0].number || github.run_id }}
11+
cancel-in-progress: true
12+
913
permissions:
1014
contents: read # Required at top-level to give `issue_comment` events access to the secrets below.
1115

scripts/workflow-lint.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
#
77
# 1. concurrency: every PR-triggered workflow declares a
88
# concurrency: group (AGENTS.md §
9-
# GitHub Actions);
9+
# GitHub Actions), EXCEPT pr-review-trigger.yml
10+
# which intentionally runs all events to completion
11+
# (see PR #2789);
1012
#
1113
# 2. pinned-by-sha: every third-party `uses:` reference is
1214
# pinned by a 40-char SHA, not a tag/branch
@@ -64,8 +66,18 @@ note() {
6466
# yq-based so it runs in the lint job without extra deps; the
6567
# trade-off is a false positive if `pull_request` appears in a
6668
# comment, which we accept.
69+
#
70+
# EXCEPTION: pr-review-trigger.yml is exempt from this check because
71+
# it intentionally runs all events to completion (the workflow is cheap,
72+
# and deduplication happens downstream in pr-review.yml). See PR #2789.
6773
for f in "$WORKFLOWS_DIR"/*.yml "$WORKFLOWS_DIR"/*.yaml; do
6874
[ -e "$f" ] || continue
75+
76+
# Skip pr-review-trigger.yml
77+
if [[ "$f" == *"pr-review-trigger.yml" ]]; then
78+
continue
79+
fi
80+
6981
if grep -qE '\bpull_request\b' "$f"; then
7082
if ! grep -qE '^\s*concurrency:' "$f"; then
7183
note "$f" "PR-triggered workflow has no concurrency: block (AGENTS.md § GitHub Actions)"

0 commit comments

Comments
 (0)