feat: ci cd pipelien #1
@@ -190,9 +190,15 @@ jobs:
|
||||
|
||||
- name: Get PR diff
|
||||
run: |
|
||||
git diff --merge-base \
|
||||
"origin/${{ github.base_ref }}" > /tmp/pr.diff
|
||||
wc -l /tmp/pr.diff
|
||||
# lockfile changes bloat the diff (175KB here) and are pointless to
|
||||
# review - pnpm audit already covers dependencies. Excluding the
|
||||
# lockfile also keeps the diff small enough to hand to the model.
|
||||
# The diff goes to a file IN the workspace so the agent can read it
|
||||
# with its file tools (passing 190KB as a CLI argument fails with
|
||||
# "Argument list too long", MAX_ARG_STRLEN is 128KiB).
|
||||
git diff --merge-base "origin/${{ github.base_ref }}" \
|
||||
-- . ':(exclude)pnpm-lock.yaml' > .pr-review-diff.patch
|
||||
wc -c .pr-review-diff.patch
|
||||
|
||||
- name: Run opencode review
|
||||
env:
|
||||
@@ -201,12 +207,18 @@ jobs:
|
||||
# deepseek-v4-pro#max: flagship reasoning model at maximum thinking
|
||||
# budget. Requires funds on the opencode account.
|
||||
# Cheaper fallbacks: opencode/deepseek-v4.1-flash, or remove "#max".
|
||||
# Output is redirected (not piped through tee): if opencode fails,
|
||||
# the job must fail here so the error log is never posted as a
|
||||
# "review" comment.
|
||||
opencode run \
|
||||
--model opencode/deepseek-v4-pro#max \
|
||||
"You are a principal engineer performing a rigorous code review on a
|
||||
pull request. You have tool access: read repo files for context when
|
||||
the diff alone is ambiguous, but review ONLY code changed in this PR.
|
||||
|
||||
The full PR diff is in the file .pr-review-diff.patch in the repo
|
||||
root. Read it first with your file tools.
|
||||
|
||||
## Project context
|
||||
- Stack: Nuxt 4 (Vue 3, TypeScript) SSR web app in the repo root.
|
||||
Backend/API services are being added in Golang.
|
||||
@@ -251,7 +263,7 @@ jobs:
|
||||
unoptimized images, blocking Nitro middleware).
|
||||
|
||||
## Output format (strict)
|
||||
Review the diff at the end of this message. For every finding:
|
||||
Review the diff in .pr-review-diff.patch. For every finding:
|
||||
[BLOCKER] file:line - what and why + concrete fix suggestion
|
||||
[WARN] file:line - what and why + concrete fix suggestion
|
||||
[NIT] file:line - optional improvement
|
||||
@@ -266,8 +278,13 @@ jobs:
|
||||
End your response with a final verdict line, exactly one of:
|
||||
VERDICT: APPROVE (no BLOCKER findings)
|
||||
VERDICT: REQUEST_CHANGES (at least one BLOCKER)" \
|
||||
"$(cat /tmp/pr.diff)" \
|
||||
2>&1 | tee /tmp/review.md
|
||||
> /tmp/review.md 2>&1
|
||||
EXIT_CODE=$?
|
||||
cat /tmp/review.md
|
||||
if [ $EXIT_CODE -ne 0 ]; then
|
||||
echo "::error::opencode review failed (exit ${EXIT_CODE}) - NOT posting this output as a review comment"
|
||||
exit $EXIT_CODE
|
||||
fi
|
||||
|
||||
- name: Post review as PR comment
|
||||
continue-on-error: true # token missing/expired must not fail the build
|
||||
|
||||
Reference in new issue
Block a user