|
| 1 | +# Mostly copied from https://github.com/anthropics/claude-code-action/blob/main/examples/pr-review-comprehensive.yml |
| 2 | + |
| 3 | +name: Claude Code Review |
| 4 | + |
| 5 | +# This example demonstrates how to use the track_progress feature to get |
| 6 | +# visual progress tracking for PR reviews, similar to v0.x agent mode. |
| 7 | + |
| 8 | +on: |
| 9 | + pull_request: |
| 10 | + types: [opened, synchronize, ready_for_review, reopened] |
| 11 | + |
| 12 | +jobs: |
| 13 | + review-with-tracking: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + permissions: |
| 16 | + contents: read |
| 17 | + pull-requests: write |
| 18 | + id-token: write |
| 19 | + steps: |
| 20 | + - name: Checkout repository |
| 21 | + uses: actions/checkout@v4 |
| 22 | + with: |
| 23 | + fetch-depth: 1 |
| 24 | + |
| 25 | + - name: PR Review with Progress Tracking |
| 26 | + uses: anthropics/claude-code-action@v1 |
| 27 | + with: |
| 28 | + claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} |
| 29 | + |
| 30 | + # Enable progress tracking |
| 31 | + track_progress: true |
| 32 | + |
| 33 | + # Your custom review instructions |
| 34 | + prompt: | |
| 35 | + REPO: ${{ github.repository }} |
| 36 | + PR NUMBER: ${{ github.event.pull_request.number }} |
| 37 | +
|
| 38 | + Perform a comprehensive code review with the following focus areas: |
| 39 | +
|
| 40 | + 1. **Code Quality** |
| 41 | + - Clean code principles and best practices |
| 42 | + - Proper error handling and edge cases |
| 43 | + - Code readability and maintainability |
| 44 | +
|
| 45 | + 2. **Security** |
| 46 | + - Check for potential security vulnerabilities |
| 47 | + - Validate input sanitization |
| 48 | + - Review authentication/authorization logic |
| 49 | +
|
| 50 | + 3. **Performance** |
| 51 | + - Identify potential performance bottlenecks |
| 52 | + - Review database queries for efficiency |
| 53 | + - Check for memory leaks or resource issues |
| 54 | +
|
| 55 | + 4. **Testing** |
| 56 | + - Verify adequate test coverage |
| 57 | + - Review test quality and edge cases |
| 58 | + - Check for missing test scenarios |
| 59 | +
|
| 60 | + 5. **Documentation** |
| 61 | + - Ensure code is properly documented |
| 62 | + - Verify README updates for new features |
| 63 | + - Check API documentation accuracy |
| 64 | +
|
| 65 | + Provide detailed feedback using inline comments for specific issues. |
| 66 | + Use top-level comments for general observations or praise. |
| 67 | +
|
| 68 | + # Tools for comprehensive PR review |
| 69 | + claude_args: | |
| 70 | + --allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)" |
| 71 | +
|
| 72 | +# When track_progress is enabled: |
| 73 | +# - Creates a tracking comment with progress checkboxes |
| 74 | +# - Includes all PR context (comments, attachments, images) |
| 75 | +# - Updates progress as the review proceeds |
| 76 | +# - Marks as completed when done |
0 commit comments