From 21f20587b0765d95a7c3b9627fe490c1ee55efad Mon Sep 17 00:00:00 2001 From: Wen Chen Date: Fri, 13 Mar 2026 15:07:16 +0000 Subject: [PATCH 1/3] Add Claude to workflow. --- .github/workflows/claude.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/claude.yml diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml new file mode 100644 index 000000000..40e5e8418 --- /dev/null +++ b/.github/workflows/claude.yml @@ -0,0 +1,20 @@ +# .github/workflows/claude.yml +name: Claude Assistant + +on: + issue_comment: + types: [created] + pull_request_review_comment: + types: [created] + issues: + types: [opened, assigned] + pull_request_review: + types: [submitted] + +jobs: + claude-response: + runs-on: ubuntu-latest + steps: + - uses: anthropics/claude-code-action@v1 + with: + claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} From 8045fc8c3e2ae6e8b93486b7b1efd2d4977763b6 Mon Sep 17 00:00:00 2001 From: Wen Chen Date: Sat, 14 Mar 2026 04:16:59 +0000 Subject: [PATCH 2/3] Changed Claude to only review PRs. --- .github/workflows/claude.yml | 58 +++++++++++++++++++++++++++++------- 1 file changed, 47 insertions(+), 11 deletions(-) diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index 40e5e8418..626747b2e 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -1,20 +1,56 @@ -# .github/workflows/claude.yml -name: Claude Assistant +name: Claude PR Review 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-response: + claude-review: runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 - uses: anthropics/claude-code-action@v1 with: claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} + + prompt: | + REPO: ${{ github.repository }} + PR NUMBER: ${{ github.event.pull_request.number }} + + Perform a comprehensive code review with the following focus areas: + + 1. **Code Quality** + - Clean code principles and best practices + - Proper error handling and edge cases + - Code readability and maintainability + + 2. **Security** + - Check for potential security vulnerabilities + - Validate input sanitization + - Review authentication/authorization logic + + 3. **Performance** + - Identify potential performance bottlenecks + - Check for memory leaks or resource issues + + 4. **Testing** + - Verify adequate test coverage + - Review test quality and edge cases + - Check for missing test scenarios + + 5. **Documentation** + - Ensure code is properly documented + - Verify README updates for new features + - Check API documentation accuracy + + Provide detailed feedback using inline comments for specific issues. + Use top-level comments for general observations or praise. + + # Tools for comprehensive PR review + claude_args: | + --allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)" From 88c8a33015b1cdfaef4fc53bdca9c03e52e70a64 Mon Sep 17 00:00:00 2001 From: Wen Chen Date: Sat, 14 Mar 2026 04:28:41 +0000 Subject: [PATCH 3/3] Fixed permissions. --- .github/workflows/claude.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index 626747b2e..36a7f208b 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -10,6 +10,8 @@ jobs: permissions: contents: read pull-requests: write + id-token: write + actions: read # Required for Claude to read CI results on PRs steps: - uses: actions/checkout@v4 with: