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 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" diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index 99407a33b..ac8907a87 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -16,24 +16,21 @@ jobs: (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 == '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 + id-token: write # Required for OIDC token exchange 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: anthropics/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" 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.