-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (42 loc) · 1.5 KB
/
Copy pathpr-review.yml
File metadata and controls
48 lines (42 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: PR Review
on:
pull_request:
types: [opened, synchronize, reopened]
branches: [main]
permissions:
contents: write
pull-requests: write
jobs:
review:
name: Relay PR Review
runs-on: ubuntu-latest
if: github.event.pull_request.head.repo.full_name == github.repository
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Install pi-relay
id: relay
run: |
git clone --depth=1 https://github.com/benaiad/pi-relay.git /tmp/pi-relay
cd /tmp/pi-relay && npm ci && npm run build
echo "root=/tmp/pi-relay" >> "$GITHUB_OUTPUT"
- name: Run PR review
run: |
node ${{ steps.relay.outputs.root }}/dist/cli/main.js \
bundled/ci/pr-review.md \
-e pr_number="${{ github.event.pull_request.number }}" \
--model "$RELAY_MODEL" \
--thinking "${RELAY_THINKING:-off}"
env:
RELAY_MODEL: ${{ secrets.RELAY_MODEL }}
RELAY_THINKING: ${{ secrets.RELAY_THINKING }}
RELAY_PLAN_DIR: ${{ steps.relay.outputs.root }}/bundled/ci
GH_TOKEN: ${{ github.token }}
# Add your provider's API key secret below. Name depends on provider:
# zai → ZAI_API_KEY, anthropic → ANTHROPIC_API_KEY, openai → OPENAI_API_KEY
ZAI_API_KEY: ${{ secrets.ZAI_API_KEY }}