Commit 521b2b4
committed
[ci] feat: add @claude PR review workflow via claude-code-action
Add a comment-triggered workflow that runs Claude Code as a PR review
agent, using the upstream anthropics/claude-code-action@v1.
How it works:
- Trigger: comments matching '@claude' on issues, PRs, PR reviews, and
PR review comments. Default phrase per upstream action.
- Authorization gate: only OWNER / MEMBER / COLLABORATOR commenters
can fire the action, with a self-author bypass for the original
PR/issue author. Without this gate, drive-by commenters on a public
repo could trigger paid agent runs and execute tools on the
self-hosted runner.
- Permissions: contents: read (agent reads files only),
pull-requests: write + issues: write (agent posts review comments),
id-token: write (action's OIDC token request),
actions: read.
- Routing: env.ANTHROPIC_BASE_URL routes Claude API traffic through
the internal gateway. Verified end to end via the Claude Code CLI;
the gateway supports tool use + streaming.
- Model: 'Claude Sonnet 4.6' — the gateway exposes Claude models with
display-name IDs (verified via GET /v1/models). The canonical
hyphenated form is rejected as 'no available channel'.
- Tools: --allowedTools enables the inline review-comment MCP tool
plus the gh / Read / Grep / Glob tools the agent needs to inspect
the diff and modified files.
- Behavior: prompt is intentionally empty so the action runs in its
default agent mode (PR context + GitHub MCP tools auto-injected).
Project-wide review guidance lives in CLAUDE.md and
skills/code-review/SKILL.md, which the agent loads automatically.
- Progress: track_progress: true shows live checkbox progress in the
bot's initial PR comment.
End-to-end verified on a fork PR: the agent posts severity-tagged
inline comments on file:line plus a top-level verdict / summary /
checklist, matching the SKILL.md contract.1 parent 9324ffa commit 521b2b4
1 file changed
Lines changed: 96 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
0 commit comments