ci: switch Claude reviewer to manual @claude-review trigger#16
Merged
Conversation
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.
Summary
Switches the Claude PR reviewer from automatic
pull_requesttrigger to manual@claude reviewcomment trigger.Why: PR #15 exposed that
pull_requestevents from forks can't run our workflow — GitHub stripssecrets.*andid-token: writefrom fork PR runs as a security measure. The reviewer fails at OIDC fetch before it can even make an API call.What changed
on: pull_request: [opened, synchronize, reopened, ready_for_review]on: issue_comment: [created]@claude reviewauthor_association ∈ {OWNER, MEMBER, COLLABORATOR}— prevents random users from triggering reviews on malicious fork PRs to exfiltrate secrets via prompt injectionNew prompt hardening
Because issue_comment runs in base-repo context with full secrets, Claude is reviewing untrusted fork content with full privilege. Added an explicit "PROMPT-INJECTION HARDENING" section to the prompt:
Paired with
--allowedTools "Bash,Read,Grep,Glob"(no WebFetch, no subagent) the blast radius is tight.How to use
For any PR (including fork PRs like #15), post a comment:
You need to be a repo admin, org member, or collaborator (the workflow filters by
author_association). The workflow then:refs/pull/<N>/head)🤖 Claude security review — HEAD: <SHA7>comment with findingsTrade-offs
Test plan
@claude reviewon docs: emphasize supported agents in README #15 → should trigger review within 1–2 min@claude reviewon a same-repo PR → works@claude reviewon a PR → filtered out (check Actions tab, workflow either skipped or didn't run)