Skip to content
Merged
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
54 changes: 54 additions & 0 deletions .github/workflows/claude-code-review.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Claude Code Review

on:
workflow_call:
secrets:
CLAUDE_CODE_OAUTH_TOKEN:
description: A Claude Code access token. Supply this **or** ANTHROPIC_API_KEY.
ANTHROPIC_API_KEY:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used one of these (as created in the Anthropic console), but I note that our repos have a CLAUDE_CODE_OAUTH_TOKEN (I don't know how to get one of those) -- they are not interchangeable, so I've made it possible to supply either.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah!
claude setup-token to get a CLAUDE_CODE_OAUTH_TOKEN -- but I haven't made it work yet.

description: An API key from the Anthropic console. Supply this **or** CLAUDE_CODE_OAUTH_TOKEN.

jobs:
claude-review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
issues: read
id-token: write # needed to get an OIDC access token for Claude to use

steps:
- name: Checkout repository
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493
with:
fetch-depth: 1

- name: Run Claude Code Review
id: claude-review
uses: anthropics/claude-code-action@7145c3e0510bcdbdd29f67cc4a8c1958f1acfa2f # v1.0.27
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
track_progress: true
# Direct prompt for automated review (no @claude mention needed)
prompt: |
REPO: ${{ github.repository }}
PR NUMBER: ${{ github.event.pull_request.number }}

Please review this pull request. Draw on your experience as a seasoned, team-oriented
engineer.

You are evaluating the pull request as submitted, not elaborating on it.
Do not explain the content of the pull request, unless it is to explain what is missing.
Explain whether the pull request summary makes sense, and whether the change in the
pull request does what the summary says.

Give a concise, dispassionate summary of your evaluation, and the recommended next step.
Summarise the main pros and cons and support them with evidence.

# Optional: Use sticky comments to make Claude reuse the same comment on subsequent pushes to the same PR
use_sticky_comment: true

# Configuration via CLI arguments
claude_args: |
--allowedTools Bash(make test-unit),Bash(make lint),Bash(make validate)