Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/claude-code-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Claude Code Review

# Automatically review every pull request with Claude (Max-subscription OAuth token).
# No github_token override -> posts as the Claude GitHub App ("Claude"), not github-actions[bot].
# NOTE: in app mode the action only runs when this file matches the default branch, so it does
# NOT review PRs that modify the workflow itself; it reviews normal PRs after this is merged.
on:
pull_request:
types: [opened, synchronize]

permissions:
contents: read
pull-requests: write
id-token: write

jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
track_progress: true
prompt: |
REPO: ${{ github.repository }}
PR NUMBER: ${{ github.event.pull_request.number }}

Review this pull request for correctness bugs, security issues,
edge cases, and regressions. Prefer a few high-confidence findings
over many speculative ones. Follow the conventions in CLAUDE.md if present.
Use inline comments for specific lines and a top-level comment for a brief summary.
claude_args: |
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)"
48 changes: 48 additions & 0 deletions .github/workflows/claude.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Claude

# Interactive responder: run Claude when someone @-mentions it in an issue or PR comment.
# Uses the Claude GitHub App (Max-subscription OAuth token). contents:write lets it commit
# fixes to the PR branch.
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
pull_request_review:
types: [submitted]
issues:
types: [opened, assigned]

jobs:
claude:
# Gate on @claude mention AND a trusted author (this is a public repo): without the
# author_association check any commenter could trigger a write-capable, paid job.
if: >
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude') && contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude') && contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude') && contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.review.author_association)) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')) && contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.issue.author_association))
# Serialize runs per issue/PR so two @claude mentions can't race when pushing to a branch.
concurrency:
group: claude-${{ github.event.issue.number || github.event.pull_request.number }}
cancel-in-progress: false
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
id-token: write
actions: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
# allowedTools must cover how claude-code-action actually persists a fix: git add/commit
# plus the bundled push helper it invokes (scripts/git-push.sh) — it does NOT run a raw
# `git push`. That path is pinned to the action's @v1 ref; update it if you bump the action.
claude_args: |
--allowedTools "Read,Grep,Glob,Edit,Write,Bash(git add:*),Bash(git commit:*),Bash(git status:*),Bash(git diff:*),Bash(git checkout:*),Bash(/home/runner/work/_actions/anthropics/claude-code-action/v1/scripts/git-push.sh:*),Bash(python3:*),mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)"
Loading