-
Notifications
You must be signed in to change notification settings - Fork 1
Reusable Claude review workflow #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: | ||
| 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) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah!
claude setup-tokento get a CLAUDE_CODE_OAUTH_TOKEN -- but I haven't made it work yet.