Add workflow for Claude to react to PR comments and reviews#4946
Merged
ondrejmirtes merged 5 commits into2.1.xfrom Feb 16, 2026
Merged
Add workflow for Claude to react to PR comments and reviews#4946ondrejmirtes merged 5 commits into2.1.xfrom
ondrejmirtes merged 5 commits into2.1.xfrom
Conversation
Automatically triggers Claude Code when comments or reviews are left on PRs created by phpstan-bot, without requiring @claude mentions. - Handles issue comments, review submissions, and inline review comments - Filters to only phpstan-bot PRs, skips bot's own comments - Adds 👀 reaction to acknowledge the comment - Collects full PR comment history and inline review context for Claude - Limits to 5 reaction commits per PR to prevent runaway loops - Skips closed/merged PRs - Uses concurrency groups to avoid conflicting runs https://claude.ai/code/session_01UfUUMUBGgCttD9VMTf6FvJ
Replace custom claude -p workflow with anthropics/claude-code-action@v1. Trigger phrase set to @phpstan-bot so reviewers can address the bot directly without needing @claude. Benefits over the previous custom approach: - Threaded reply comments with progress tracking - Conversation memory across follow-up messages - Automatic context collection (diff, comments, reviews) - Built-in loop prevention and session management https://claude.ai/code/session_01UfUUMUBGgCttD9VMTf6FvJ
The trigger_phrase handles activation — the action only runs when someone explicitly writes @phpstan-bot in a comment. https://claude.ai/code/session_01UfUUMUBGgCttD9VMTf6FvJ
- model → claude_args with --model flag - timeout_minutes → removed (job-level timeout-minutes suffices) - allowed_tools → removed (not a v1 input) - custom_instructions → prompt https://claude.ai/code/session_01UfUUMUBGgCttD9VMTf6FvJ
Collaborator
|
You've opened the pull request against the latest branch 2.2.x. PHPStan 2.2 is not going to be released for months. If your code is relevant on 2.1.x and you want it to be released sooner, please rebase your pull request and change its target to 2.1.x. |
Contributor
|
do we need to make sure the phpstan-bot (claude) can only be triggered by phpstan-src maintainers (or at least a hardcoded list of people) to prevent misuse? |
Member
Author
|
@staabm My theory is that it only works for people with write access but you can try it maybe from your other account 😊 |
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.
Automatically triggers Claude Code when comments or reviews are left on
PRs created by phpstan-bot, without requiring @claude mentions.
https://claude.ai/code/session_01UfUUMUBGgCttD9VMTf6FvJ