Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

fix(ci): allow bot responses on fork PR inline review comments (#1421)

worktrunk-botd8078b15ef86
diff --git a/.github/CLAUDE.md b/.github/CLAUDE.md
index 5ff78a142..fadb379df 100644
--- a/.github/CLAUDE.md
+++ b/.github/CLAUDE.md
@@ -96,7 +96,7 @@ All workflows pass BOT_TOKEN to both paths.
|----------|-------------------|-------------------|-------------|
| **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 |
| **triage** | Issue body | Partial (structured skill) | Fixed prompt, merge restriction, environment protection |
-| **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 |
+| **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 |
| **ci-fix** | Failed CI/docs-build logs | Minimal (must break CI or docs build on main) | Fixed prompt, automatic trigger |
| **renovate** | None | None | Fixed prompt, scheduled trigger |
@@ -141,7 +141,7 @@ The mention workflow runs for any user who includes `@worktrunk-bot` — the mer
- `worktrunk-bot`'s own comments or reviews (loop prevention)
- Empty approvals on `worktrunk-bot` PRs (approved with no body)
- Comments on issues or PRs where `worktrunk-bot` hasn't engaged and no `@worktrunk-bot` mention
-- Inline review comments on fork PRs (secrets unavailable)
+- Inline review comments from `worktrunk-bot` itself (loop prevention)
- Draft PRs
**Routing:** Formal reviews (`pull_request_review`) → `claude-review`. Inline comments (`pull_request_review_comment`) and conversation comments (`issue_comment`) → `claude-mention`.
diff --git a/.github/workflows/claude-mention.yaml b/.github/workflows/claude-mention.yaml
index 387bf7fe9..03e45b098 100644
--- a/.github/workflows/claude-mention.yaml
+++ b/.github/workflows/claude-mention.yaml
@@ -29,16 +29,18 @@ jobs:
# and where to look; Claude reads the full context itself via gh/skills.
#
# Note: secrets cannot be used in job-level `if:` (actions/runner#520) —
- # doing so causes GitHub to fail the workflow on push validation. For review
- # comments on fork PRs (which don't receive secrets), we detect forks via
- # github.event context instead. Use a Conversation tab comment for fork PRs.
+ # doing so causes GitHub to fail the workflow on push validation.
+ #
+ # Unlike `pull_request`, the `pull_request_review_comment` event runs on
+ # the base repo and has access to secrets even for fork PRs — no fork
+ # filter needed. (The `issue_comment` path already works on fork PRs
+ # for the same reason.)
if: |
(github.event_name == 'issues' &&
contains(github.event.issue.body, '@worktrunk-bot')) ||
(github.event_name == 'issue_comment' &&
github.event.comment.user.login != 'worktrunk-bot') ||
(github.event_name == 'pull_request_review_comment' &&
- github.event.pull_request.head.repo.full_name == github.repository &&
github.event.comment.user.login != 'worktrunk-bot')
# Job-level concurrency (not workflow-level) so that runs skipped by the
# `if:` above don't enter the concurrency group. Workflow-level concurrency