Repository navigation
add the claude review and @claude workflows - #105
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: adssib <[email protected]>
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.
What this changes
Adds Claude reviews to this repo, modeled on the review we run in our other repos (same action,
anthropics/claude-code-action@v1, same token secretCLAUDE_CODE_OAUTH_TOKEN, same model), with a prompt written for this repo's rules and locked down for a public repo that takes PRs from forks..github/workflows/claude-code-review.yml: an automatic review, once per PR (pull_requesttypesopened,ready_for_review,reopened; drafts skipped). The prompt checks AGENTS.md: adocs/plugins.mdrow for every new or changed plugin,providers/<api>.mdwith Why this source, golden test and dated quote, a pinned drop test, fetching only throughenv.Get/kit/, precision over recall, nothing private. It verifies by runninggo build,go vet,gofmt -l,go test -raceand the leak guard..github/workflows/claude.yml: a maintainer mentions@claude(in particular@claude reviewon a fork's PR) and Claude answers in the thread, read-only.CONTRIBUTING.md: a Reviews line under Pull requests, and the review in the CI table.No ticket: this is a repo-setup change.
Fork safety: how it's set up, and why
PRs from forks run without secrets, and their code is untrusted. The setup:
claude-code-review.yml)if:github.event.pull_request.head.repo.full_name == github.repository)@claude review(claude.yml)author_associationisOWNER,MEMBERorCOLLABORATOR(checked in the jobif, before a runner starts); the action then checks write access itselfpull_request_target. It would run with our secrets on the fork's checked-out code.issue_comment(from its security docs): it checks out the fork's head to read, but first restores Claude's config (CLAUDE.md,AGENTS.md,.claude/,.mcp.jsonand more) from the base branch, so a fork can't rewrite Claude's instructions or hooks. For PRs whose author lacks write access it also denies commands that run repo code (package managers, test runners, interpreters).claude.ymlis read and comment only:--permission-mode default(anything not allowed is denied, instead of auto mode's safety review), allowed toolsRead,Grep,Glob,gh pr view,gh pr diff,gh issue viewand the inline-comment tool; explicitly denied:Edit,Write,MultiEdit,NotebookEdit,WebFetch,WebSearch,git add/rm/commit/push, and the action's file-commit tools. So a prompt hidden in a fork's files can't make Claude push, edit, run code, or send anything to the web. Noallowed_bots, noallowed_non_write_users.claude.ymldoesn't listen toissues: openedhere (anyone can open an issue on a public repo).--permission-mode defaultwith an explicit allow list.display_report: falseon both, and the diagnostics step prints only which tools were blocked: run summaries are public here.The token
The review skips with a notice (
CLAUDE_CODE_OAUTH_TOKEN is not set; skipping Claude review.) instead of failing until the token is available. This repo is public, so it gets the org-wide secret; nothing to set here. The action also needs the Claude GitHub App, already installed org-wide.Note: a PR that edits these workflow files can't run them (the action refuses a workflow that differs from
main), so this PR's own review won't run; they take effect after merge.Checklist
python3 scripts/leak_guard.py --all: no banned terms (with the new files staged)docs/plugins.md: not applicable, no plugin changedproviders/page: not applicable, no plugin changedCalls I made (please check)
author_associationgate is defense in depth; the action's own write-access check is the real one. GitHub can report a member with private org membership asCONTRIBUTOR, so that maintainer's@claudeis ignored until their membership is public or they're a repo collaborator.@claudein public repos can't push fixes, even for maintainers on same-repo PRs. Simpler and safer; we can relax it for same-repo PRs later if we miss it.pull_request_reviewandpull_request_review_commentmentions too (same gate). GitHub gives review events on fork PRs no secrets, so on a fork's PR use a normal comment.Related PRs
🤖 Generated with Claude Code