From 0dcec1425f5523299ec5b2dd27c89df38aa45bd4 Mon Sep 17 00:00:00 2001 From: Murat Maga Date: Mon, 20 Jul 2026 09:27:15 -0700 Subject: [PATCH 1/2] Add Claude Code Review workflow (automatic PR review) Co-Authored-By: Claude Fable 5 --- .github/workflows/claude-code-review.yml | 37 ++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/claude-code-review.yml diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml new file mode 100644 index 0000000..a26a2fc --- /dev/null +++ b/.github/workflows/claude-code-review.yml @@ -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:*)" From eca7322e5acf5e9b760e70c2de078af4e69e0444 Mon Sep 17 00:00:00 2001 From: Murat Maga Date: Mon, 20 Jul 2026 09:27:17 -0700 Subject: [PATCH 2/2] Add mention-triggered Claude workflow (@claude in issues/PRs) Co-Authored-By: Claude Fable 5 --- .github/workflows/claude.yml | 48 ++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/claude.yml diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml new file mode 100644 index 0000000..9e3c072 --- /dev/null +++ b/.github/workflows/claude.yml @@ -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:*)"