From de98cf60ae74d861dd0cfa3c04389235047e7a3f Mon Sep 17 00:00:00 2001 From: "dayuan.jiang" Date: Sat, 29 Nov 2025 00:29:56 +0900 Subject: [PATCH] Add Claude Code GitHub Actions with Bedrock and auto PR review --- .github/workflows/claude-code.yml | 80 +++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 .github/workflows/claude-code.yml diff --git a/.github/workflows/claude-code.yml b/.github/workflows/claude-code.yml new file mode 100644 index 0000000..91f86b2 --- /dev/null +++ b/.github/workflows/claude-code.yml @@ -0,0 +1,80 @@ +name: Claude Code + +on: + issue_comment: + types: [created] + pull_request_review_comment: + types: [created] + issues: + types: [opened, assigned] + pull_request_review: + types: [submitted] + pull_request: + types: [opened, synchronize] + +jobs: + claude: + if: | + (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || + (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) || + (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) || + (github.event_name == 'issues' && contains(github.event.issue.body, '@claude')) + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + issues: write + id-token: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} + aws-region: us-east-1 + + - name: Run Claude Code + uses: anthropics/claude-code-action@beta + with: + use_bedrock: "true" + bedrock_model_id: "us.anthropic.claude-sonnet-4-5-20250929-v1:0" + github_token: ${{ secrets.GITHUB_TOKEN }} + + pr-review: + if: github.event_name == 'pull_request' + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + id-token: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} + aws-region: us-east-1 + + - name: Run Claude Code PR Review + uses: anthropics/claude-code-action@beta + with: + use_bedrock: "true" + bedrock_model_id: "us.anthropic.claude-sonnet-4-5-20250929-v1:0" + github_token: ${{ secrets.GITHUB_TOKEN }} + direct_prompt: | + Review this PR and provide feedback on: + 1. Code quality and best practices + 2. Potential bugs or issues + 3. Security concerns + 4. Performance implications + 5. Suggestions for improvement + + Be concise and actionable. Focus on important issues rather than nitpicking style.