|
4 | 4 | pull_request: |
5 | 5 | types: [opened, synchronize, ready_for_review, reopened] |
6 | 6 |
|
| 7 | +permissions: |
| 8 | + contents: read |
| 9 | + pull-requests: write |
| 10 | + issues: read |
| 11 | + id-token: write |
| 12 | + |
7 | 13 | jobs: |
8 | 14 | claude-review: |
9 | 15 | if: | |
10 | 16 | github.event.pull_request.draft == false && |
11 | 17 | github.event.pull_request.head.repo.full_name == github.repository |
12 | | - runs-on: ubuntu-latest |
13 | | - permissions: |
14 | | - contents: read |
15 | | - pull-requests: write |
16 | | - issues: read |
17 | | - id-token: write |
18 | | - |
19 | | - steps: |
20 | | - - name: Checkout repository |
21 | | - uses: actions/checkout@v6 |
22 | | - with: |
23 | | - fetch-depth: 1 |
24 | | - |
25 | | - - name: Minimize previous Claude review comments |
26 | | - env: |
27 | | - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
28 | | - run: | |
29 | | - gh pr view ${{ github.event.pull_request.number }} \ |
30 | | - --json comments \ |
31 | | - --jq '.comments[] | select(.author.login == "claude") | .id' \ |
32 | | - | while read -r node_id; do |
33 | | - gh api graphql -f query=' |
34 | | - mutation { |
35 | | - minimizeComment(input: {subjectId: "'"$node_id"'", classifier: OUTDATED}) { |
36 | | - minimizedComment { isMinimized } |
37 | | - } |
38 | | - }' |
39 | | - done |
40 | | -
|
41 | | - - name: Run Claude Code Review |
42 | | - uses: anthropics/claude-code-action@v1 |
43 | | - with: |
44 | | - claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} |
45 | | - plugin_marketplaces: 'https://github.com/anthropics/claude-code.git' |
46 | | - plugins: 'code-review@claude-code-plugins' |
47 | | - prompt: | |
48 | | - /code-review:code-review --comment ${{ github.repository }}/pull/${{ github.event.pull_request.number }} |
49 | | -
|
50 | | - IMPORTANT: You MUST always post a PR comment, even if no issues are found. |
51 | | - Do NOT skip the review for any reason — never treat a PR as "trivial" or |
52 | | - "obviously correct." Always run the full review pipeline and post a comment |
53 | | - with the results. If no issues are found, post the "No issues found" summary. |
| 18 | + uses: sensiblebit/.github/.github/workflows/claude-code-review.yml@main |
| 19 | + secrets: |
| 20 | + CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} |
0 commit comments