diff --git a/.gitea/workflows/pr-checker.yml b/.gitea/workflows/pr-checker.yml index 2881863..8eb3472 100644 --- a/.gitea/workflows/pr-checker.yml +++ b/.gitea/workflows/pr-checker.yml @@ -252,10 +252,19 @@ jobs: "opencode-go": { "options": { "apiKey": "%s" } } + }, + "permission": { + "edit": "deny", + "bash": "deny", + "webfetch": "deny" } }' "$OPENCODE_API_KEY" > opencode.json # --print-logs: surface auth/provider errors in the CI log instead # of failing with an opaque exit code + # Read-only agent: denying edit/bash/webfetch means no headless + # permission prompts can hang or kill the run, and the reviewer + # physically cannot modify the repo. + EXIT_CODE=0 opencode run \ --print-logs \ --model opencode-go/deepseek-v4-pro#max \ @@ -325,12 +334,12 @@ jobs: End your response with a final verdict line, exactly one of: VERDICT: APPROVE (no BLOCKER findings) VERDICT: REQUEST_CHANGES (at least one BLOCKER)" \ - > /tmp/review.md 2>&1 - EXIT_CODE=$? + > /tmp/review.md 2>&1 || EXIT_CODE=$? + # always show the output - never swallow the error text cat /tmp/review.md - if [ $EXIT_CODE -ne 0 ]; then + 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 + exit "$EXIT_CODE" fi - name: Post review as PR comment