Skip to content

Commit d8078b1

Browse files
fix(ci): allow bot responses on fork PR inline review comments (#1421)
## Summary - Remove the fork filter (`head.repo.full_name == github.repository`) from the `pull_request_review_comment` trigger in `claude-mention.yaml` - The filter was added in cd16545 based on the assumption that secrets aren't available for fork PRs — but that restriction only applies to `pull_request` events, not `pull_request_review_comment` (which runs on the base repo and has full secret access) - The `issue_comment` path already works on fork PRs, confirming this Supersedes #1420 (workaround that only posted a redirect notice). ## Test plan - [ ] Verify CI passes (workflow-only change, no code) - [ ] Test by posting an inline review comment mentioning `@worktrunk-bot` on a fork PR Closes #1419 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4e62058 commit d8078b1

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

.github/CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ All workflows pass BOT_TOKEN to both paths.
9696
|----------|-------------------|-------------------|-------------|
9797
| **review** | PR diff content (initial review), review body on bot PRs (respond) | Full (any external PR) / Medium (anyone who can review bot PRs) | Fixed prompt, merge restriction |
9898
| **triage** | Issue body | Partial (structured skill) | Fixed prompt, merge restriction, environment protection |
99-
| **mention** | Comment body on any issue/PR, inline/conversation comments on bot-engaged PRs | Full | Fixed prompt, merge restriction, fork check on inline review comments, non-mention triggers verified against bot engagement via API |
99+
| **mention** | Comment body on any issue/PR, inline/conversation comments on bot-engaged PRs | Full | Fixed prompt, merge restriction, non-mention triggers verified against bot engagement via API |
100100
| **ci-fix** | Failed CI/docs-build logs | Minimal (must break CI or docs build on main) | Fixed prompt, automatic trigger |
101101
| **renovate** | None | None | Fixed prompt, scheduled trigger |
102102

@@ -141,7 +141,7 @@ The mention workflow runs for any user who includes `@worktrunk-bot` — the mer
141141
- `worktrunk-bot`'s own comments or reviews (loop prevention)
142142
- Empty approvals on `worktrunk-bot` PRs (approved with no body)
143143
- Comments on issues or PRs where `worktrunk-bot` hasn't engaged and no `@worktrunk-bot` mention
144-
- Inline review comments on fork PRs (secrets unavailable)
144+
- Inline review comments from `worktrunk-bot` itself (loop prevention)
145145
- Draft PRs
146146

147147
**Routing:** Formal reviews (`pull_request_review`) → `claude-review`. Inline comments (`pull_request_review_comment`) and conversation comments (`issue_comment`) → `claude-mention`.

.github/workflows/claude-mention.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,18 @@ jobs:
2929
# and where to look; Claude reads the full context itself via gh/skills.
3030
#
3131
# Note: secrets cannot be used in job-level `if:` (actions/runner#520) —
32-
# doing so causes GitHub to fail the workflow on push validation. For review
33-
# comments on fork PRs (which don't receive secrets), we detect forks via
34-
# github.event context instead. Use a Conversation tab comment for fork PRs.
32+
# doing so causes GitHub to fail the workflow on push validation.
33+
#
34+
# Unlike `pull_request`, the `pull_request_review_comment` event runs on
35+
# the base repo and has access to secrets even for fork PRs — no fork
36+
# filter needed. (The `issue_comment` path already works on fork PRs
37+
# for the same reason.)
3538
if: |
3639
(github.event_name == 'issues' &&
3740
contains(github.event.issue.body, '@worktrunk-bot')) ||
3841
(github.event_name == 'issue_comment' &&
3942
github.event.comment.user.login != 'worktrunk-bot') ||
4043
(github.event_name == 'pull_request_review_comment' &&
41-
github.event.pull_request.head.repo.full_name == github.repository &&
4244
github.event.comment.user.login != 'worktrunk-bot')
4345
# Job-level concurrency (not workflow-level) so that runs skipped by the
4446
# `if:` above don't enter the concurrency group. Workflow-level concurrency

0 commit comments

Comments
 (0)