diff --git a/.github/workflows/claude-review-mode.yml b/.github/workflows/claude-review-mode.yml deleted file mode 100644 index 986dd1b..0000000 --- a/.github/workflows/claude-review-mode.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Claude Review Mode - -on: - pull_request: - types: [opened, synchronize] - issue_comment: - types: [created] - -jobs: - code-review: - # Run on PR events, or when someone comments "@claude review" on a PR - if: | - github.event_name == 'pull_request' || - (github.event_name == 'issue_comment' && - github.event.issue.pull_request && - contains(github.event.comment.body, '@claude review')) - runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: write - issues: write - statuses: write # May be needed for some review operations - checks: write # May be needed for review checks - # Note: id-token not needed since review mode doesn't use OIDC for GitHub auth - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Full history for better diff analysis - - - name: Code Review with Claude - uses: km-anthropic/claude-code-action@main - with: - mode: review - anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} - # github_token not needed - uses default GITHUB_TOKEN for GitHub operations - timeout_minutes: "30" - custom_instructions: | - Focus on: - - Code quality and maintainability - - Security vulnerabilities - - Performance issues - - Best practices and design patterns - - Test coverage gaps - - Be constructive and provide specific suggestions for improvements. - Use GitHub's suggestion format when proposing code changes. \ No newline at end of file diff --git a/.github/workflows/claude-review.yml b/.github/workflows/claude-review.yml index 10706cc..b5c0ed8 100644 --- a/.github/workflows/claude-review.yml +++ b/.github/workflows/claude-review.yml @@ -2,13 +2,14 @@ name: Auto review PRs on: pull_request: - types: [opened] + types: [opened, synchronize] jobs: auto-review: permissions: contents: read - id-token: write + pull-requests: write + issues: write runs-on: ubuntu-latest steps: @@ -18,9 +19,11 @@ jobs: fetch-depth: 1 - name: Auto review PR - uses: anthropics/claude-code-action@main + uses: km-anthropic/claude-code-action@main with: - direct_prompt: | + mode: review + anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} + custom_instructions: | Please review this PR. Look at the changes and provide thoughtful feedback on: - Code quality and best practices - Potential bugs or issues @@ -29,5 +32,3 @@ jobs: - 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"