From 07057a4addc54c35baff3a1d92461b0a3cff1699 Mon Sep 17 00:00:00 2001 From: Simon Marty Date: Tue, 7 Jul 2026 10:58:46 -0700 Subject: [PATCH] Add Claude Code review action --- .github/workflows/code-review.yml | 58 +++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/code-review.yml diff --git a/.github/workflows/code-review.yml b/.github/workflows/code-review.yml new file mode 100644 index 0000000..4ffaae8 --- /dev/null +++ b/.github/workflows/code-review.yml @@ -0,0 +1,58 @@ +name: Claude Code Review +on: + pull_request_target: + types: [opened, synchronize, ready_for_review, reopened] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + review: + runs-on: ubuntu-latest + environment: code-review + permissions: + contents: read + pull-requests: write + actions: read + id-token: write + steps: + - uses: actions/checkout@v6 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 1 + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v6 + with: + role-to-assume: ${{ secrets.CODE_REVIEW_ROLE }} + aws-region: us-west-2 + + - uses: actions/create-github-app-token@v3 + id: app-token + with: + client-id: ${{ vars.APP_CLIENT_ID }} + private-key: ${{ secrets.APP_PRIVATE_KEY }} + + - uses: anthropics/claude-code-action@v1 + with: + github_token: ${{ steps.app-token.outputs.token }} + use_bedrock: "true" + additional_permissions: | + actions: read + claude_args: | + --model us.anthropic.claude-opus-4-8 + --allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)" + + track_progress: true # ✨ Enables tracking comments + 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 + + Provide detailed feedback using inline comments for specific issues.