fix(ci): claude-pr-review self-cancels via bot status comment#440
Merged
fix(ci): claude-pr-review self-cancels via bot status comment#440
Conversation
The claude-code-action posts a "Claude Code is working..." status comment shortly after starting. That comment is itself an issue_comment created event on the same PR, which queued a second workflow run with the same concurrency group key. With concurrency at the workflow level and cancel-in-progress: true, the new run cancels the in-progress run *before* any if: is evaluated -- so the running review was killed by the action's own status comment. The second run then evaluated if: against "Claude Code is working..." and skipped, but the damage was done. Move the concurrency block onto the review job itself. GitHub evaluates job-level if: before applying job-level concurrency, so a skipped job does not occupy the slot or cancel siblings. Manifested in run 25225661590, cancelled at 17:48:43Z by the bot comment posted at 17:48:26Z on PR #438. Fixes #439
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.
Summary
Move the `concurrency` block on `.github/workflows/claude-pr-review.yml` from workflow level to the `review` job level so that bot status comments don't cancel the running review.
What was happening
.gitDir #2 is queued with the same concurrency-group key..gitDir #2 then evaluates `if:` — comment doesn't match `/claude review` — and skips.Net: the action's own progress comment cancels the action.
Reproduced on PR #438, run `25225661590` cancelled at 17:48:43Z by the bot comment posted at 17:48:26Z.
Why job-level concurrency fixes it
GitHub evaluates a job's `if:` filter before applying its job-level concurrency rule. A skipped job does not occupy the concurrency slot. So the bot's status comment continues to fire `issue_comment` events, but those events are skipped by `if:` and never reach the cancel-in-progress logic. Only events that actually pass `/claude review` + OWNER will queue (and cancel) a real review run.
Test plan
Fixes #439