mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-23 15:04:13 +08:00
docs: add review mode example workflow
This commit is contained in:
45
examples/claude-review-mode.yml
Normal file
45
examples/claude-review-mode.yml
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
name: Claude Review Mode
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize]
|
||||||
|
issue_comment:
|
||||||
|
types: [created]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
code-review:
|
||||||
|
# Run on PR events, or when someone comments "@claude review" on a PR
|
||||||
|
if: |
|
||||||
|
github.event_name == 'pull_request' ||
|
||||||
|
(github.event_name == 'issue_comment' &&
|
||||||
|
github.event.issue.pull_request &&
|
||||||
|
contains(github.event.comment.body, '@claude review'))
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
|
issues: write
|
||||||
|
# Note: No id-token needed for review mode!
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # Full history for better diff analysis
|
||||||
|
|
||||||
|
- name: Code Review with Claude
|
||||||
|
uses: anthropics/claude-code-action@km/add-review-mode
|
||||||
|
with:
|
||||||
|
mode: review
|
||||||
|
# No anthropic_api_key needed - uses default GitHub token
|
||||||
|
# No github_token needed - uses default GITHUB_TOKEN
|
||||||
|
timeout_minutes: "30"
|
||||||
|
custom_instructions: |
|
||||||
|
Focus on:
|
||||||
|
- Code quality and maintainability
|
||||||
|
- Security vulnerabilities
|
||||||
|
- Performance issues
|
||||||
|
- Best practices and design patterns
|
||||||
|
- Test coverage gaps
|
||||||
|
|
||||||
|
Be constructive and provide specific suggestions for improvements.
|
||||||
|
Use GitHub's suggestion format when proposing code changes.
|
||||||
Reference in New Issue
Block a user