Skip to content

add the claude review and @claude workflows - #105

Merged
brandonphelps1212 merged 1 commit into
mainfrom
claude-review
Nov 19, 2026
Merged

brandonphelps1212 merged 1 commit into
mainfrom
claude-review

Conversation

@adssib

@adssib adssib commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

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 secret CLAUDE_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_request types opened, ready_for_review, reopened; drafts skipped). The prompt checks AGENTS.md: a docs/plugins.md row for every new or changed plugin, providers/<api>.md with Why this source, golden test and dated quote, a pinned drop test, fetching only through env.Get/kit/, precision over recall, nothing private. It verifies by running go build, go vet, gofmt -l, go test -race and the leak guard.
  • .github/workflows/claude.yml: a maintainer mentions @claude (in particular @claude review on 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:

Same-repo PR Fork PR
Automatic review (claude-code-review.yml) Runs once (job if: github.event.pull_request.head.repo.full_name == github.repository) Doesn't start: no secrets there anyway
@claude review (claude.yml) Works Works, only when the commenter's author_association is OWNER, MEMBER or COLLABORATOR (checked in the job if, before a runner starts); the action then checks write access itself
  • Never pull_request_target. It would run with our secrets on the fork's checked-out code.
  • What the action does with a fork on 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.json and 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).
  • On top of that, claude.yml is read and comment only: --permission-mode default (anything not allowed is denied, instead of auto mode's safety review), allowed tools Read, Grep, Glob, gh pr view, gh pr diff, gh issue view and 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. No allowed_bots, no allowed_non_write_users.
  • claude.yml doesn't listen to issues: opened here (anyone can open an issue on a public repo).
  • The automatic review only runs on same-repo PRs, whose authors have write access, so it may run the Go toolchain and the leak guard; it still uses --permission-mode default with an explicit allow list.
  • display_report: false on 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

  • Every commit is signed off (DCO)
  • python3 scripts/leak_guard.py --all: no banned terms (with the new files staged)
  • Workflow YAML parses
  • docs/plugins.md: not applicable, no plugin changed
  • Golden test, drop test, providers/ page: not applicable, no plugin changed

Calls I made (please check)

  • The job-level author_association gate is defense in depth; the action's own write-access check is the real one. GitHub can report a member with private org membership as CONTRIBUTOR, so that maintainer's @claude is ignored until their membership is public or they're a repo collaborator.
  • @claude in 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.
  • Allowed pull_request_review and pull_request_review_comment mentions 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

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: adssib <[email protected]>
@brandonphelps1212
brandonphelps1212 merged commit f5c1f43 into main Nov 19, 2026
5 checks passed
@brandonphelps1212
brandonphelps1212 deleted the claude-review branch November 19, 2026 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants