|
| 1 | +name: PR Review with Progress Tracking |
| 2 | + |
| 3 | +# This workflow triggers an AI-powered code review when the 'AI Review' label is added to a pull request. |
| 4 | +on: |
| 5 | + pull_request: |
| 6 | + types: [labeled] |
| 7 | + |
| 8 | +jobs: |
| 9 | + review-with-tracking: |
| 10 | + if: ${{ github.event.label.name == 'AI Review' }} |
| 11 | + runs-on: ubuntu-latest |
| 12 | + permissions: |
| 13 | + contents: read |
| 14 | + pull-requests: write |
| 15 | + id-token: write |
| 16 | + steps: |
| 17 | + - name: Checkout repository |
| 18 | + uses: actions/checkout@v4 |
| 19 | + with: |
| 20 | + fetch-depth: 0 |
| 21 | + |
| 22 | + - name: PR Review with Progress Tracking |
| 23 | + uses: anthropics/claude-code-action@v1 |
| 24 | + with: |
| 25 | + anthropic_api_key: ${{ secrets.PR_REVIEW_ANTHROPIC_API_KEY }} |
| 26 | + |
| 27 | + # Your custom review instructions |
| 28 | + prompt: | |
| 29 | + REPO: ${{ github.repository }} |
| 30 | + PR NUMBER: ${{ github.event.pull_request.number }} |
| 31 | +
|
| 32 | + Perform a comprehensive code review with the following focus areas: |
| 33 | +
|
| 34 | + 1. **Code Quality** |
| 35 | + - Clean code principles and best practices |
| 36 | + - Proper error handling and edge cases |
| 37 | + - Code readability and maintainability |
| 38 | +
|
| 39 | + 2. **Security** |
| 40 | + - Check for potential security vulnerabilities |
| 41 | + - Validate input sanitization |
| 42 | + - Review authentication/authorization logic |
| 43 | +
|
| 44 | + 3. **Performance** |
| 45 | + - Identify potential performance bottlenecks |
| 46 | + - Review database queries for efficiency |
| 47 | + - Check for memory leaks or resource issues |
| 48 | +
|
| 49 | + 4. **Testing** |
| 50 | + - Verify adequate test coverage |
| 51 | + - Review test quality and edge cases |
| 52 | + - Check for missing test scenarios |
| 53 | +
|
| 54 | + 5. **Documentation** |
| 55 | + - Ensure code is properly documented |
| 56 | + - Verify README updates for new features |
| 57 | + - Check API documentation accuracy |
| 58 | +
|
| 59 | + 6. **Impact Analysis** |
| 60 | + - Identify and summarize the areas of the codebase impacted by these changes |
| 61 | + - Assess potential ripple effects or regressions caused by this update |
| 62 | + - Highlight any dependencies or modules that might require retesting or validation |
| 63 | +
|
| 64 | + 7. **Bug Detection & Reliability** |
| 65 | + - Identify any actual or potential bugs, including logic errors and incorrect assumptions |
| 66 | + - Check for unintended side effects introduced by new changes |
| 67 | + - Verify that input/output behavior aligns with expected functionality |
| 68 | + - Flag areas with ambiguous or risky logic that may cause future regressions |
| 69 | + - Recommend targeted fixes or refactoring where needed |
| 70 | +
|
| 71 | + Provide detailed feedback using inline comments for specific issues. |
| 72 | + Use top-level comments for general observations or praise. |
| 73 | +
|
| 74 | + # Tools for comprehensive PR review |
| 75 | + claude_args: | |
| 76 | + --allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)" |
0 commit comments