fix(examples): add concurrency groups to PR review workflows#969
Open
odysseus0 wants to merge 1 commit intoanthropics:mainfrom
Open
fix(examples): add concurrency groups to PR review workflows#969odysseus0 wants to merge 1 commit intoanthropics:mainfrom
odysseus0 wants to merge 1 commit intoanthropics:mainfrom
Conversation
Without a concurrency group, every push to an open PR starts a new review job without cancelling the previous one. On an active branch this causes a pile-up of concurrent jobs all sharing the same API token, leading to rate limiting and jobs that hang indefinitely until GitHub's 6-hour job limit. Add `concurrency.cancel-in-progress: true` (grouped by workflow + PR number) to all three PR review example files and all seven PR review blocks in docs/solutions.md. Also document the footgun in the Best Practices section. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Every PR review example in this repo is missing a
concurrencygroup. Without it, every push to an open PR starts a new review job without cancelling the previous one.On an active branch this causes a pile-up of concurrent jobs that all share the same API token. This leads to rate limiting, and since there's no timeout either, jobs hang indefinitely until GitHub's 6-hour job limit kills them.
Fix
Add a
concurrencyblock withcancel-in-progress: trueto all PR-triggered workflow examples:Files changed:
examples/pr-review-comprehensive.ymlexamples/pr-review-filtered-authors.ymlexamples/pr-review-filtered-paths.ymldocs/solutions.md— all 7 inline PR review YAML blocks + a note in Best PracticesWhy
cancel-in-progress: trueis almost always correct for PR reviewsA PR review is always reviewing the latest commit. If a new push comes in while a review is running, that review is already stale — there's no value in letting it finish. Cancelling it immediately frees the runner and the API token for the review that actually matters.
🤖 Generated with Claude Code