From 6bfad08d0640ab1e3814aa99f6bf1d33e2547c49 Mon Sep 17 00:00:00 2001 From: km-anthropic Date: Fri, 8 Aug 2025 17:14:44 -0700 Subject: [PATCH 1/8] Update claude.yml --- .github/workflows/claude.yml | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index 99407a33b..1fe27e940 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -13,27 +13,23 @@ on: 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') || contains(github.event.issue.title, '@claude'))) + (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') || + contains(github.event.issue.title, '@claude') + )) runs-on: ubuntu-latest permissions: - contents: read - pull-requests: read - issues: read - id-token: write + contents: write + pull-requests: write + issues: write steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - name: Run Claude Code - id: claude - uses: anthropics/claude-code-action@beta + uses: km-anthropic/claude-code-action@v1-dev with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} - allowed_tools: "Bash(bun install),Bash(bun test:*),Bash(bun run format),Bash(bun typecheck)" - custom_instructions: "You have also been granted tools for editing files and running bun commands (install, run, test, typecheck) for testing your changes: bun install, bun test, bun run format, bun typecheck." - model: "claude-opus-4-1-20250805" From 62fdf84685a20adc16c16b0b0a6b3898ff34dda3 Mon Sep 17 00:00:00 2001 From: km-anthropic Date: Fri, 8 Aug 2025 17:16:08 -0700 Subject: [PATCH 2/8] Update claude.yml --- .github/workflows/claude.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index 1fe27e940..e694e46e5 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -13,12 +13,9 @@ on: 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 == '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') || contains(github.event.issue.title, '@claude') From 9689dd85852cfd240af984c1a90af4b682bded81 Mon Sep 17 00:00:00 2001 From: km-anthropic Date: Fri, 8 Aug 2025 17:18:22 -0700 Subject: [PATCH 3/8] Update claude.yml --- .github/workflows/claude.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index e694e46e5..9acd259d7 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -25,6 +25,7 @@ jobs: contents: write pull-requests: write issues: write + id-token: write # Required for OIDC token exchange steps: - name: Run Claude Code uses: km-anthropic/claude-code-action@v1-dev From d518f628f6ed8cb3b3de29885239ad2c10267655 Mon Sep 17 00:00:00 2001 From: km-anthropic Date: Fri, 8 Aug 2025 17:20:02 -0700 Subject: [PATCH 4/8] Update claude.yml --- .github/workflows/claude.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index 9acd259d7..7ca6d4bb4 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -27,6 +27,9 @@ jobs: issues: write id-token: write # Required for OIDC token exchange steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Run Claude Code uses: km-anthropic/claude-code-action@v1-dev with: From 3a445bbd301a06d6d86b1cde97ea542899c86070 Mon Sep 17 00:00:00 2001 From: km-anthropic Date: Mon, 11 Aug 2025 06:59:04 -0700 Subject: [PATCH 5/8] Update claude.yml --- .github/workflows/claude.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index 7ca6d4bb4..ac8907a87 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -31,6 +31,6 @@ jobs: uses: actions/checkout@v4 - name: Run Claude Code - uses: km-anthropic/claude-code-action@v1-dev + uses: anthropics/claude-code-action@v1-dev with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} From 8cc0a734ee1154a029947b9977e3259b19456d6e Mon Sep 17 00:00:00 2001 From: km-anthropic Date: Mon, 11 Aug 2025 12:42:34 -0700 Subject: [PATCH 6/8] Create auto-review.yml --- .github/workflows/auto-review.yml | 55 +++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/auto-review.yml diff --git a/.github/workflows/auto-review.yml b/.github/workflows/auto-review.yml new file mode 100644 index 000000000..f630cea0c --- /dev/null +++ b/.github/workflows/auto-review.yml @@ -0,0 +1,55 @@ +name: Claude Auto Review Test + +on: + pull_request: + types: [opened, synchronize] + workflow_dispatch: + inputs: + pr_number: + description: 'PR number to review' + required: false + type: string + +jobs: + auto-review: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + issues: write + id-token: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Automatic PR Review + uses: anthropics/claude-code-action@v1-dev + with: + anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} + timeout_minutes: "60" + prompt: | + Please review this pull request and provide comprehensive feedback. + + Focus on: + - Code quality and best practices + - Potential bugs or issues + - Performance considerations + - Security implications + - Test coverage + - Documentation updates if needed + + Provide constructive feedback with specific suggestions for improvement. + Use inline comments to highlight specific areas of concern. + + After your review, submit a proper GitHub review with your findings. + claude_args: | + --allowed-tools mcp__github-comment-server__create_pending_pull_request_review + --allowed-tools mcp__github-comment-server__add_comment_to_pending_review + --allowed-tools mcp__github-comment-server__submit_pending_pull_request_review + --allowed-tools mcp__github-comment-server__get_pull_request_diff + --allowed-tools mcp__github-comment-server__get_pull_request_files + --allowed-tools mcp__github-comment-server__get_pull_request + --allowed-tools mcp__github-comment-server__list_pull_request_reviews + --allowed-tools mcp__github-comment-server__list_pull_request_review_comments From 161ec2d5cf98079fa3127915c4fa89000252a8fe Mon Sep 17 00:00:00 2001 From: km-anthropic Date: Mon, 11 Aug 2025 12:42:45 -0700 Subject: [PATCH 7/8] Delete .github/workflows/claude-review.yml --- .github/workflows/claude-review.yml | 33 ----------------------------- 1 file changed, 33 deletions(-) delete mode 100644 .github/workflows/claude-review.yml diff --git a/.github/workflows/claude-review.yml b/.github/workflows/claude-review.yml deleted file mode 100644 index 10706cc20..000000000 --- a/.github/workflows/claude-review.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Auto review PRs - -on: - pull_request: - types: [opened] - -jobs: - auto-review: - permissions: - contents: read - id-token: write - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - - name: Auto review PR - uses: anthropics/claude-code-action@main - with: - direct_prompt: | - Please review this PR. Look at the changes and provide thoughtful feedback on: - - Code quality and best practices - - Potential bugs or issues - - Suggestions for improvements - - Overall architecture and design decisions - - Documentation consistency: Verify that README.md and other documentation files are updated to reflect any code changes (especially new inputs, features, or configuration options) - - Be constructive and specific in your feedback. Give inline comments where applicable. - anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} - allowed_tools: "mcp__github__create_pending_pull_request_review,mcp__github__add_comment_to_pending_review,mcp__github__submit_pending_pull_request_review,mcp__github__get_pull_request_diff" From 92ffa15ac52203576adabb724555c7d8dd50091f Mon Sep 17 00:00:00 2001 From: km-anthropic Date: Mon, 11 Aug 2025 12:44:10 -0700 Subject: [PATCH 8/8] tmp --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3597680fd..aa4435876 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![Claude Code Action responding to a comment](https://github.com/user-attachments/assets/1d60c2e9-82ed-4ee5-b749-f9e021c85f4d) -# Claude Code Action +# I LOVE Claude Code Action A general-purpose [Claude Code](https://claude.ai/code) action for GitHub PRs and issues that can answer questions and implement code changes. This action listens for a trigger phrase in comments and activates Claude act on the request. It supports multiple authentication methods including Anthropic direct API, Amazon Bedrock, and Google Vertex AI.