fix: claude code review workflow + disable rustfmt cron #14
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # WARNING: Do not let /install-github-app overwrite this file. | |
| # The auto-generated version uses the code-review CLI plugin which | |
| # silently fails in CI (see https://github.com/anthropics/claude-code/issues/26227). | |
| # This version uses a direct prompt per the official docs. | |
| name: Claude Code Review | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, ready_for_review, reopened] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number }} | |
| cancel-in-progress: true | |
| jobs: | |
| claude-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: 1 | |
| - name: Minimize old Claude comments | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const { data: comments } = await github.rest.issues.listComments({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.payload.pull_request.number, | |
| per_page: 100, | |
| }); | |
| const claudeComments = comments.filter(c => | |
| c.user?.login === 'claude[bot]' || c.user?.login === 'github-actions[bot]' | |
| ); | |
| for (const comment of claudeComments) { | |
| await github.graphql(` | |
| mutation MinimizeComment($id: ID!) { | |
| minimizeComment(input: { subjectId: $id, classifier: OUTDATED }) { | |
| minimizedComment { isMinimized } | |
| } | |
| } | |
| `, { id: comment.node_id }); | |
| } | |
| - name: Run Claude Code Review | |
| id: claude-review | |
| uses: anthropics/claude-code-action@v1 | |
| with: | |
| claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} | |
| track_progress: true | |
| prompt: | | |
| REPO: ${{ github.repository }} | |
| PR NUMBER: ${{ github.event.pull_request.number }} | |
| Please review this pull request with a focus on: | |
| - Code quality and Rust best practices | |
| - Potential bugs, logic errors, or unsafe patterns | |
| - Security implications (especially around cryptographic operations and Lightning/Bitcoin handling) | |
| - Performance considerations | |
| Note: The PR branch is already checked out in the current working directory. | |
| Use `gh pr comment` for top-level feedback. | |
| Use `mcp__github_inline_comment__create_inline_comment` to highlight specific code issues. | |
| Only post GitHub comments - don't submit review text as messages. | |
| claude_args: >- | |
| --allowedTools | |
| "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)" |