diff --git a/.github/workflows/claude-auto-reviewer.yml b/.github/workflows/claude-auto-reviewer.yml new file mode 100644 index 0000000..22b1aac --- /dev/null +++ b/.github/workflows/claude-auto-reviewer.yml @@ -0,0 +1,43 @@ +name: Claude Auto Review +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +jobs: + review: + if: github.event.pull_request.draft == false && github.event.pull_request.user.type != 'Bot' + runs-on: ubuntu-latest + timeout-minutes: 15 + concurrency: + group: claude-review-${{ github.event.pull_request.number }} + cancel-in-progress: true + permissions: + contents: read + pull-requests: write + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + with: + fetch-depth: 1 + + - uses: anthropics/claude-code-action@1dc994ee7a008f0ecc866d9ac23ef036b7229f84 # v1.0.127 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} + prompt: | + REPO: ${{ github.repository }} + PR NUMBER: ${{ github.event.pull_request.number }} + + Please review this pull request with a focus on: + - Code quality and best practices + - Potential bugs or issues + - Security implications + - Performance considerations + + Note: The PR branch is already checked out in the current working directory. + + Use `gh pr comment` for top-level feedback. + Use `mcp__github_inline_comment__create_inline_comment` (with `confirmed: true`) to highlight specific code issues. + Only post GitHub comments - don't submit review text as messages. + + claude_args: | + --allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Read,Grep,Glob"