Skip to content

Add workflow for Claude to react to PR comments and reviews#4946

Merged
ondrejmirtes merged 5 commits into2.1.xfrom
claude/pr-comment-reactions-bqXjG
Feb 16, 2026
Merged

Add workflow for Claude to react to PR comments and reviews#4946
ondrejmirtes merged 5 commits into2.1.xfrom
claude/pr-comment-reactions-bqXjG

Conversation

@ondrejmirtes
Copy link
Copy Markdown
Member

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

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
@phpstan-bot
Copy link
Copy Markdown
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.

@ondrejmirtes ondrejmirtes changed the base branch from 2.2.x to 2.1.x February 16, 2026 06:22
@ondrejmirtes ondrejmirtes merged commit cb4b834 into 2.1.x Feb 16, 2026
351 checks passed
@ondrejmirtes ondrejmirtes deleted the claude/pr-comment-reactions-bqXjG branch February 16, 2026 06:23
@staabm
Copy link
Copy Markdown
Contributor

staabm commented Feb 16, 2026

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?

@ondrejmirtes
Copy link
Copy Markdown
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 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants