claude-code-review.yml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. name: Claude Code Review
  2. on:
  3. pull_request:
  4. types: [opened, synchronize]
  5. # Optional: Only run on specific file changes
  6. # paths:
  7. # - "src/**/*.ts"
  8. # - "src/**/*.tsx"
  9. # - "src/**/*.js"
  10. # - "src/**/*.jsx"
  11. jobs:
  12. claude-review:
  13. # Optional: Filter by PR author
  14. # if: |
  15. # github.event.pull_request.user.login == 'external-contributor' ||
  16. # github.event.pull_request.user.login == 'new-developer' ||
  17. # github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
  18. runs-on: ubuntu-latest
  19. permissions:
  20. contents: read
  21. pull-requests: read
  22. issues: read
  23. id-token: write
  24. steps:
  25. - name: Checkout repository
  26. uses: actions/checkout@v4
  27. with:
  28. fetch-depth: 1
  29. - name: Run Claude Code Review
  30. id: claude-review
  31. uses: anthropics/claude-code-action@v1
  32. with:
  33. anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
  34. prompt: |
  35. REPO: ${{ github.repository }}
  36. PR NUMBER: ${{ github.event.pull_request.number }}
  37. Please review this pull request and provide feedback on:
  38. - Code quality and best practices
  39. - Potential bugs or issues
  40. - Performance considerations
  41. - Security concerns
  42. - Test coverage
  43. Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.
  44. Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.
  45. # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
  46. # or https://docs.claude.com/en/docs/claude-code/sdk#command-line for available options
  47. claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'