-
-
Notifications
You must be signed in to change notification settings - Fork 1k
feat(ci): enable Claude experimental review mode #780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,7 +13,7 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # ratchet:actions/checkout@v4 | ||
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # ratchet:actions/checkout@v4 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ Excellent Security Practice: Great use of commit hash pinning for The consistent application of this pattern across all workflow files demonstrates strong supply chain security practices. |
||
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4 | ||
| with: | ||
| node-version-file: .tool-versions | ||
|
|
@@ -26,7 +26,7 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # ratchet:actions/checkout@v4 | ||
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # ratchet:actions/checkout@v4 | ||
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4 | ||
| with: | ||
| node-version-file: .tool-versions | ||
|
|
@@ -39,7 +39,7 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # ratchet:actions/checkout@v4 | ||
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # ratchet:actions/checkout@v4 | ||
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4 | ||
| with: | ||
| node-version-file: .tool-versions | ||
|
|
@@ -52,7 +52,7 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # ratchet:actions/checkout@v4 | ||
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # ratchet:actions/checkout@v4 | ||
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4 | ||
| with: | ||
| node-version-file: .tool-versions | ||
|
|
@@ -69,7 +69,7 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # ratchet:actions/checkout@v4 | ||
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # ratchet:actions/checkout@v4 | ||
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4 | ||
| with: | ||
| node-version-file: .tool-versions | ||
|
|
@@ -86,7 +86,7 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # ratchet:actions/checkout@v4 | ||
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # ratchet:actions/checkout@v4 | ||
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4 | ||
| with: | ||
| node-version-file: .tool-versions | ||
|
|
@@ -102,7 +102,7 @@ jobs: | |
| name: Lint GitHub Actions | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # ratchet:actions/checkout@v4 | ||
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # ratchet:actions/checkout@v4 | ||
| - uses: rhysd/actionlint@4e683ab8014a63fafa117492a0c6053758e6d593 # ratchet:rhysd/actionlint@v1.7.3 | ||
| with: | ||
| args: "-color" | ||
|
|
@@ -111,8 +111,8 @@ jobs: | |
| name: Check typos | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # ratchet:actions/checkout@v4 | ||
| - uses: crate-ci/typos@52bd719c2c91f9d676e2aa359fc8e0db8925e6d8 # ratchet:crate-ci/typos@master | ||
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # ratchet:actions/checkout@v4 | ||
| - uses: crate-ci/typos@a67079b4ae32e18c3f53d75368c52ce53b5fb56b # ratchet:crate-ci/typos@master | ||
|
|
||
| test: | ||
| name: Test | ||
|
|
@@ -122,7 +122,7 @@ jobs: | |
| node-version: [20.x, 21.x, 22.x, 23.x, 24.x] | ||
| runs-on: ${{ matrix.os }} | ||
| steps: | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # ratchet:actions/checkout@v4 | ||
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # ratchet:actions/checkout@v4 | ||
| - name: Use Node.js ${{ matrix.node-version }} | ||
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4 | ||
| with: | ||
|
|
@@ -141,7 +141,7 @@ jobs: | |
| bun-version: [latest] | ||
| runs-on: ${{ matrix.os }} | ||
| steps: | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # ratchet:actions/checkout@v4 | ||
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # ratchet:actions/checkout@v4 | ||
| - name: Setup Bun ${{ matrix.bun-version }} | ||
| uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # ratchet:oven-sh/setup-bun@v2 | ||
| with: | ||
|
|
@@ -155,7 +155,7 @@ jobs: | |
| name: Test coverage | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # ratchet:actions/checkout@v4 | ||
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # ratchet:actions/checkout@v4 | ||
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4 | ||
| with: | ||
| node-version-file: .tool-versions | ||
|
|
@@ -180,7 +180,7 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # ratchet:actions/checkout@v4 | ||
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # ratchet:actions/checkout@v4 | ||
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4 | ||
| with: | ||
| node-version-file: .tool-versions | ||
|
|
@@ -200,7 +200,7 @@ jobs: | |
| node-version: [20.x, 21.x, 22.x, 23.x, 24.x] | ||
| runs-on: ${{ matrix.os }} | ||
| steps: | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # ratchet:actions/checkout@v4 | ||
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # ratchet:actions/checkout@v4 | ||
| - name: Use Node.js ${{ matrix.node-version }} | ||
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4 | ||
| with: | ||
|
|
@@ -227,7 +227,7 @@ jobs: | |
| bun-version: [latest] | ||
| runs-on: ${{ matrix.os }} | ||
| steps: | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # ratchet:actions/checkout@v4 | ||
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # ratchet:actions/checkout@v4 | ||
| - name: Setup Bun ${{ matrix.bun-version }} | ||
| uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # ratchet:oven-sh/setup-bun@v2 | ||
| with: | ||
|
|
@@ -250,14 +250,14 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| if: ${{ github.ref == 'refs/heads/main' }} | ||
| steps: | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # ratchet:actions/checkout@v4 | ||
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # ratchet:actions/checkout@v4 | ||
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # ratchet:actions/setup-node@v4 | ||
| with: | ||
| node-version-file: .tool-versions | ||
| cache: npm | ||
| - run: npm ci | ||
| - run: npm run website-generate-schema | ||
| - uses: stefanzweifel/git-auto-commit-action@01d77ca6cb089da1360e540865f7d035c95aa199 # ratchet:stefanzweifel/git-auto-commit-action@v4 | ||
| - uses: stefanzweifel/git-auto-commit-action@3ea6ae190baf489ba007f7c92608f33ce20ef04a # ratchet:stefanzweifel/git-auto-commit-action@v4 | ||
| with: | ||
| commit_message: 'chore(schema): auto generate schema' | ||
| commit_user_name: "github-actions[bot]" | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,31 +2,44 @@ name: Claude Auto review PRs | |||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||
| types: [opened] | ||||||||||||||||||||||||||||
| types: [opened, synchronize] | ||||||||||||||||||||||||||||
| issue_comment: | ||||||||||||||||||||||||||||
| types: [created] | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||
| auto-review: | ||||||||||||||||||||||||||||
| 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')) | ||||||||||||||||||||||||||||
|
Comment on lines
+12
to
+16
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Security Consideration: The current condition allows any user to trigger the Claude review by commenting "@claude review". For public repositories, consider restricting this to repository collaborators to prevent potential abuse or spam:
Suggested change
This ensures only trusted users can trigger manual reviews. |
||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||||||||
| pull-requests: write | ||||||||||||||||||||||||||||
| issues: write | ||||||||||||||||||||||||||||
| id-token: write | ||||||||||||||||||||||||||||
yamadashy marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||
| - name: Checkout repository | ||||||||||||||||||||||||||||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # ratchet:actions/checkout@v4 | ||||||||||||||||||||||||||||
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # ratchet:actions/checkout@v4 | ||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||
| fetch-depth: 1 | ||||||||||||||||||||||||||||
| fetch-depth: 0 # Full history for better diff analysis | ||||||||||||||||||||||||||||
|
Comment on lines
24
to
+27
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Potential Issue with issue_comment Trigger: When triggered by Consider checking out the PR's head ref for comment triggers:
Suggested change
This ensures the correct code is analyzed regardless of trigger method. |
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Auto review PR | ||||||||||||||||||||||||||||
| uses: anthropics/claude-code-action@4f4f43f0444d2d14cf449afc644f13facd71ebc4 # ratchet:anthropics/claude-code-action@main | ||||||||||||||||||||||||||||
| - name: Code Review with Claude | ||||||||||||||||||||||||||||
| uses: anthropics/claude-code-action@78b07473f50218c6494719ef164ed1ebd31da25c # ratchet:anthropics/claude-code-action@main | ||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔄 Updated Claude Integration: Good update to the latest Note: The experimental review mode configuration looks solid with appropriate permissions and custom instructions focused on code quality, security, and best practices. |
||||||||||||||||||||||||||||
| 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 | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Be constructive and specific in your feedback. Give inline comments where applicable. | ||||||||||||||||||||||||||||
| mode: experimental-review | ||||||||||||||||||||||||||||
| anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} | ||||||||||||||||||||||||||||
| allowed_tools: "mcp__github__create_pending_pull_request_review,mcp__github__add_pull_request_review_comment_to_pending_review,mcp__github__submit_pending_pull_request_review,mcp__github__get_pull_request_diff" | ||||||||||||||||||||||||||||
| # github_token not needed - uses default GITHUB_TOKEN for GitHub operations | ||||||||||||||||||||||||||||
yamadashy marked this conversation as resolved.
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The comment on line 34 states "github_token not needed" but this may not be accurate for the experimental-review mode. The Consider explicitly providing the token for clarity and to ensure proper functionality:
Suggested change
|
||||||||||||||||||||||||||||
| 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. | ||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,11 +26,11 @@ jobs: | |
| build-mode: none | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # ratchet:actions/checkout@v4 | ||
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # ratchet:actions/checkout@v4 | ||
|
|
||
| # Initializes the CodeQL tools for scanning. | ||
| - name: Initialize CodeQL | ||
| uses: github/codeql-action/init@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # ratchet:github/codeql-action/init@v3 | ||
| uses: github/codeql-action/init@df559355d593797519d70b90fc8edd5db049e7a2 # ratchet:github/codeql-action/init@v3 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛡️ Security Scanning Updates: CodeQL actions properly updated to latest commit hashes, ensuring you're using the most current security scanning capabilities with enhanced rule sets and language detection.
yamadashy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| with: | ||
| languages: ${{ matrix.language }} | ||
| build-mode: ${{ matrix.build-mode }} | ||
|
|
@@ -46,6 +46,6 @@ jobs: | |
| exit 1 | ||
|
|
||
| - name: Perform CodeQL Analysis | ||
| uses: github/codeql-action/analyze@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # ratchet:github/codeql-action/analyze@v3 | ||
| uses: github/codeql-action/analyze@df559355d593797519d70b90fc8edd5db049e7a2 # ratchet:github/codeql-action/analyze@v3 | ||
| with: | ||
| category: "/language:${{matrix.language}}" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,15 +10,15 @@ jobs: | |
| runs-on: macos-latest | ||
| steps: | ||
| - name: Set up Homebrew | ||
| uses: Homebrew/actions/setup-homebrew@b3fb6f7cb1475434d4285b90020c2aa51f1e0b12 # ratchet:Homebrew/actions/setup-homebrew@master | ||
| uses: Homebrew/actions/setup-homebrew@87d3af7a72e5ede081b6dafce1798551a74fb366 # ratchet:Homebrew/actions/setup-homebrew@master | ||
| with: | ||
| test-bot: false | ||
|
|
||
| - name: Configure Git user | ||
| uses: Homebrew/actions/git-user-config@b3fb6f7cb1475434d4285b90020c2aa51f1e0b12 # ratchet:Homebrew/actions/git-user-config@master | ||
| uses: Homebrew/actions/git-user-config@87d3af7a72e5ede081b6dafce1798551a74fb366 # ratchet:Homebrew/actions/git-user-config@master | ||
|
|
||
| - name: Bump packages | ||
| uses: Homebrew/actions/bump-packages@b3fb6f7cb1475434d4285b90020c2aa51f1e0b12 # ratchet:Homebrew/actions/bump-packages@master | ||
| uses: Homebrew/actions/bump-packages@87d3af7a72e5ede081b6dafce1798551a74fb366 # ratchet:Homebrew/actions/bump-packages@master | ||
|
Comment on lines
+13
to
+21
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📦 Homebrew Actions Synchronized: All three Homebrew actions updated to the same commit hash
This synchronization is excellent for maintaining compatibility and avoiding version mismatches in the Homebrew release pipeline. |
||
| with: | ||
| token: ${{ secrets.COMMITTER_TOKEN }} | ||
| formulae: repomix | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,7 @@ jobs: | |
| ratchet: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # ratchet:actions/checkout@v4 | ||
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # ratchet:actions/checkout@v4 | ||
| - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # ratchet:actions/setup-go@v5 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔧 Self-Verifying Security: Great to see the Ratchet verification workflow itself getting updated! This creates a self-reinforcing security loop where:
This is a perfect example of "eating your own dog food" for security practices. |
||
| with: | ||
| go-version: stable | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Security Best Practice: Excellent use of commit hash pinning for
actions/checkout. This protects against tag manipulation attacks while the Ratchet comment maintains human readability by showing this maps to@v4.