diff --git a/.github/workflows/claude-pr-review.yml b/.github/workflows/claude-pr-review.yml new file mode 100644 index 00000000..bb2151ca --- /dev/null +++ b/.github/workflows/claude-pr-review.yml @@ -0,0 +1,47 @@ +name: Claude Code Review + +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +concurrency: + group: claude-code-review-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + claude-review: + if: github.event.pull_request.draft == false + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + issues: write + id-token: write + actions: read + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Claude review + uses: anthropics/claude-code-action@v1 + with: + anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} + prompt: | + REPO: ${{ github.repository }} + PR NUMBER: ${{ github.event.pull_request.number }} + + Review this pull request and leave concise, actionable feedback. + Focus on: + - correctness and bugs + - security issues + - breaking changes + - performance issues + - readability and maintainability + - missing or weak test coverage + + Use the repository's CLAUDE.md for style and conventions. + Only comment when there is a concrete issue worth fixing. +