Files
claude-code-action/.github/workflows/claude-auto-review.yml
2025-08-12 12:40:13 -07:00

40 lines
1.5 KiB
YAML

name: Auto Review PRs
on:
pull_request:
types: [opened, synchronize]
jobs:
auto-review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Auto review PR
uses: anthropics/claude-code-action@v1-dev
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
prompt: |
Please review pull request #${{ github.event.pull_request.number }} in the ${{ github.repository }} repository.
Focus on:
- Code quality and best practices
- Potential bugs or issues
- Suggestions for improvements
- Overall architecture and design decisions
- Documentation consistency
Use the GitHub MCP tools to create a proper PR review with comments.
Important: When using the GitHub MCP tools, make sure to use PR number ${{ github.event.pull_request.number }}.
Create a review with constructive feedback and submit it as a COMMENT (not APPROVE).
claude_args: '--allowedTools "mcp__github__get_pull_request,mcp__github__get_pull_request_diff,mcp__github__get_pull_request_files,mcp__github__create_pending_pull_request_review,mcp__github__add_comment_to_pending_review,mcp__github__submit_pending_pull_request_review,Read,Grep,Glob"'