|
| 1 | +name: Claude PR review |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + types: [opened, synchronize, reopened, ready_for_review] |
| 6 | + |
| 7 | +# Cancel a superseded review when the branch is pushed again. |
| 8 | +concurrency: |
| 9 | + group: claude-review-${{ github.event.pull_request.number }} |
| 10 | + cancel-in-progress: true |
| 11 | + |
| 12 | +jobs: |
| 13 | + review: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + # Secrets, including CLAUDE_CODE_OAUTH_TOKEN, are unavailable to fork |
| 16 | + # pull requests. |
| 17 | + if: >- |
| 18 | + github.event.pull_request.draft == false && |
| 19 | + github.event.pull_request.head.repo.full_name == github.repository |
| 20 | + permissions: |
| 21 | + contents: read |
| 22 | + pull-requests: write |
| 23 | + issues: write |
| 24 | + actions: read |
| 25 | + # claude-code-action exchanges an OIDC token for its GitHub App token. |
| 26 | + id-token: write |
| 27 | + steps: |
| 28 | + - uses: actions/checkout@v6 |
| 29 | + with: |
| 30 | + fetch-depth: 0 |
| 31 | + |
| 32 | + - name: Fetch the base branch |
| 33 | + run: | |
| 34 | + git fetch --no-tags origin \ |
| 35 | + +refs/heads/${{ github.event.pull_request.base.ref }}:refs/heads/${{ github.event.pull_request.base.ref }} || true |
| 36 | +
|
| 37 | + - name: Set up Python |
| 38 | + uses: actions/setup-python@v6 |
| 39 | + with: |
| 40 | + python-version: "3.12" |
| 41 | + |
| 42 | + - name: Install poetry |
| 43 | + uses: snok/install-poetry@v1 |
| 44 | + with: |
| 45 | + version: 1.5.1 |
| 46 | + |
| 47 | + - name: Install the project dependencies |
| 48 | + run: poetry install --no-interaction --no-root |
| 49 | + |
| 50 | + - name: Install the docs dependencies |
| 51 | + run: pip install -r docs/requirements.txt |
| 52 | + |
| 53 | + - name: Run the hier-config-review skill |
| 54 | + uses: anthropics/claude-code-action@v1 |
| 55 | + with: |
| 56 | + claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} |
| 57 | + track_progress: true |
| 58 | + prompt: | |
| 59 | + /hier-config-review |
| 60 | +
|
| 61 | + Review this pull request. The base branch is |
| 62 | + `${{ github.event.pull_request.base.ref }}`, so use |
| 63 | + `git diff ${{ github.event.pull_request.base.ref }}...HEAD` for the diff. |
| 64 | +
|
| 65 | + The Python environment is ready. Do not run `poetry install`. |
| 66 | +
|
| 67 | + Report only. Do not change, stage, or commit any file. |
| 68 | +
|
| 69 | + Post the full report as your pull request comment. Group the findings |
| 70 | + by severity (Blockers, Should fix, Nits). Give each finding a |
| 71 | + `file:line` reference and name the standard it violates. End with the |
| 72 | + pass/fail verdict against the "Before Opening a PR" checklist in |
| 73 | + AGENTS.md. |
| 74 | + claude_args: | |
| 75 | + --max-turns 60 |
| 76 | + --allowedTools Read,Grep,Glob,Bash,mcp__github_comment__update_claude_comment |
0 commit comments