Skip to content

Commit 9a343ef

Browse files
Add AI code review workflow (port of rust-sdk code-review.yml)
alibaba/open-code-review v1.12.0 (SHA-pinned) on pull_request events, reviewing with glm-5.3-flash via the z.ai API using the OCR_LLM_TOKEN secret. Fork PRs are skipped cleanly (no secret exposure); concurrency grouped per PR; npm CLI additionally pinned via ocr_version.
1 parent fa16e45 commit 9a343ef

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

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

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: AI Code Review
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
11+
concurrency:
12+
group: ocr-${{ github.event.pull_request.number }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
review:
17+
# Fork PRs cannot read secrets; skip them cleanly.
18+
if: github.event.pull_request.head.repo.fork == false
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 40
21+
steps:
22+
- uses: alibaba/open-code-review@494bf1c8d7a19196ab166960a06fef38d69a1d16 # v1.12.0
23+
with:
24+
# Pin the npm CLI too: the SHA pin freezes the action harness, but
25+
# it installs @alibaba-group/open-code-review@latest at runtime.
26+
ocr_version: '1.12.0'
27+
llm_url: https://api.z.ai/api/coding/paas/v4
28+
llm_auth_token: ${{ secrets.OCR_LLM_TOKEN }}
29+
llm_model: glm-5.3-flash
30+
llm_use_anthropic: false
31+
# GLM-5.3 family rejects thinking.type=disabled, which is the
32+
# action's default extra_body — this override is required.
33+
llm_extra_body: '{"thinking": {"type": "enabled"}}'
34+
llm_reasoning_effort: low
35+
incremental: 'true'
36+
route_severity_below: 'low'
37+
max_tokens_budget: '500000'
38+
review_task_timeout: '15'
39+
stream_progress: 'true'

0 commit comments

Comments
 (0)