Skip to content

Commit d15b195

Browse files
committed
chore(ci): attempt to re-implement CC review as an action
1 parent e6c362d commit d15b195

3 files changed

Lines changed: 58 additions & 45 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Claude Code Review
2+
description: Runs Claude AI code review on a pull request
3+
4+
inputs:
5+
claude_code_oauth_token:
6+
description: OAuth token for Claude Code
7+
required: true
8+
repository:
9+
description: Repository in owner/repo format
10+
required: true
11+
pr_number:
12+
description: Pull request number
13+
required: true
14+
15+
runs:
16+
using: composite
17+
steps:
18+
- name: Harden-Runner
19+
uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
20+
with:
21+
egress-policy: audit
22+
23+
- name: Checkout repository
24+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
25+
with:
26+
fetch-depth: 1
27+
28+
- name: Run Claude Code Review
29+
id: claude-review
30+
# Pinned to v1 for supply-chain safety
31+
uses: anthropics/claude-code-action@b2fdd80112e5f140e097b11d7a3d9edf0b226fd0
32+
with:
33+
allowed_bots: 'renovate[bot]'
34+
claude_args: |
35+
--max-turns 10
36+
track_progress: true
37+
claude_code_oauth_token: ${{ inputs.claude_code_oauth_token }}
38+
# Uses vendored code-review skill from .claude/commands/code-review.md
39+
prompt: '/project:code-review --comment ${{ inputs.repository }}/pull/${{ inputs.pr_number }}'

.github/workflows/claude-code-review-reusable.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

.github/workflows/claude-code-review.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,22 @@ jobs:
88
claude-review:
99
# only run when PR is from this repository (fork PRs don't receive secrets)
1010
if: github.event.pull_request.head.repo.full_name == github.repository
11-
# Job body always comes from main so edits to these workflows on a PR cannot break the check.
12-
uses: boneskull/gh-stack/.github/workflows/claude-code-review-reusable.yml@1aa24a5ca8eaddc47822b2d799e772255dcf2c6b # main
13-
secrets: inherit
11+
concurrency:
12+
group: claude-review-${{ github.repository }}-${{ github.event.pull_request.number }}
13+
cancel-in-progress: true
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
pull-requests: write
18+
issues: write
19+
id-token: write
20+
21+
steps:
22+
# Action definition is always fetched from main, so PRs that edit it
23+
# don't affect the running version until merged.
24+
- name: Run Claude Code Review
25+
uses: boneskull/gh-stack/.github/actions/claude-code-review@main
26+
with:
27+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
28+
repository: ${{ github.repository }}
29+
pr_number: ${{ github.event.pull_request.number }}

0 commit comments

Comments
 (0)