Repository navigation
fix(ci): restore fork filter for pull_request_review_comment events - #1425
worktrunk-bot wants to merge 1 commit into
Conversation
PR #1421 removed the fork filter based on the incorrect assumption that `pull_request_review_comment` events have access to secrets for fork PRs. Run 22914840420 proved this wrong — checkout failed with "Input required and not supplied: token" because WORKTRUNK_BOT_TOKEN was empty. `pull_request_review_comment` runs in the fork context (like `pull_request`), NOT in the base repo context (like `pull_request_target` or `issue_comment`). Fork PRs should use conversation-tab @worktrunk-bot mentions instead, which go through `issue_comment` and always have secret access. Closes #1424 Co-Authored-By: Claude Opus 4.6 <[email protected]>
## Summary - Add `github.event.issue.user.login != 'worktrunk-bot'` to the `issues` trigger in `claude-mention.yaml` - Document the new filter in `.github/CLAUDE.md` "Does not trigger" list ## Problem The hourly review workflow creates issues (like #1424) that incidentally mention `@worktrunk-bot` in body text — e.g., "comment contained `@worktrunk-bot`". This triggers `claude-mention` on the `issues` event, which then duplicates the hourly review's work, including creating a second fix PR (#1425 vs #1426 for the same issue). ## Fix Add an author check to skip issues created by `worktrunk-bot` itself, consistent with the existing `comment.user.login != 'worktrunk-bot'` loop-prevention checks on `issue_comment` and `pull_request_review_comment` events. Closes #1428 ## Test plan - [ ] Verify the `if:` condition syntax is valid (CI should pass) - [ ] Confirm the next hourly review run doesn't trigger a claude-mention run on its issues 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: worktrunk-bot <[email protected]> Co-authored-by: Claude Opus 4.6 <[email protected]>
|
to the hourly reviewer — why did we get two PRs here — this and #1426 ? |
|
Two separate automated workflows picked up issue #1424 near-simultaneously:
They raced — both saw the same open issue and independently created a fix. Neither workflow checks whether the other has already opened a PR for the same issue. #1425 is already closed, so #1426 is the one to review. Happy to add deduplication logic (e.g., checking for existing PRs referencing the same issue before creating a new one) if you'd like. |
ah! I think probably the hourly reviewer should not open issues when it can open PRs. I find them a bit noisy. Can you draft a PR that would open PRs for small changes. If it finds big persistent issues that it doesn't know how to fix, it should open an issue. In return, it should put the detail in the PR. Is that viable? Ensure that the changes are cohesive — not lots of patches — rewrite from scratch if necessary. |
Rewrite Step 7 of the hourly reviewer prompt so it defaults to creating PRs (with thorough descriptions) instead of issues. Issues are now only for problems too large or ambiguous to fix directly. Also instructs the bot to keep findings cohesive rather than creating many small patches. Requested in #1425. Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
Done — #1432 rewrites the hourly reviewer's Step 7 so it defaults to creating PRs for fixable problems (with the full analysis in the PR description) and only falls back to issues for things too large or ambiguous to fix directly. CI is green across all platforms. This also addresses the duplication with triage: if the reviewer goes straight to PR, there's no issue for the triage bot to race on. |
## Summary
- Rewrite the hourly reviewer's Step 7 ("Report findings") to prefer
creating PRs over issues
- PRs are now the default for any fixable problem (skill edits, workflow
tweaks, CLAUDE.md updates)
- Issues are only for problems too large or ambiguous to fix directly
- PR descriptions carry the full analysis (run ID, log excerpts, root
cause) — replacing what would have been the issue body
- Instructs the bot to keep findings cohesive (grouped PRs, not many
small patches)
This eliminates the duplication problem from #1425/#1426, where the
hourly reviewer created an issue and the triage bot raced to also fix
it. With the reviewer going straight to PR, there's no issue for triage
to pick up.
Requested by @max-sixty in
#1425 (comment).
## Test plan
- [ ] Workflow YAML passes validation (CI lint check)
- [ ] Next hourly run creates PRs instead of issues for small fixes
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: worktrunk-bot <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
Co-authored-by: Maximilian Roos <[email protected]>
Summary
head.repo.full_name == github.repository) forpull_request_review_commentevents inclaude-mention.yaml.github/CLAUDE.mdto document that fork PR inline review comments are filtered and whypull_request_review_commenthas secret access for fork PRs — run 22914840420 proved otherwise (checkout failed:Input required and not supplied: token)The correct event behavior:
pull_requestpull_request_targetpull_request_review_commentissue_commentFork PR users should use conversation-tab
@worktrunk-botmentions (which go throughissue_comment) instead of inline review comments.Closes #1424
Test plan
🤖 Generated with Claude Code