PR Autocheck
End-to-end pipeline for a newly submitted PR: code review → service health → Discord sync.
All steps are deterministic shell + jq; no gh required (falls back to git diff).
Quick start
Run from inside the target git repository:
bash scripts/run.sh --base origin/main --head HEAD --repo myrepo --pr 130
This prints the combined JSON report, saves a copy to reports/, and posts an
embed to Discord when DISCORD_WEBHOOK_URL is set.
Configuration
| Env | Purpose | Default |
|---|---|---|
DISCORD_WEBHOOK_URL |
Discord channel webhook for delivery | unset → payload saved to reports/, exit 3 |
HEALTHCHECK_CMD |
Override health command (must emit JSON) | healthcheck skill healthcheck.sh --json |
PR_AUTOCHECK_AI |
1 allow optional AI deepening, 0 skip |
1 |
Steps & scripts
scripts/review.sh BASE HEAD— deterministic review of the diff. Flags hardcoded secrets, dynamic eval/exec, debug prints, TODO/FIXME, oversized diffs. Emits{status, files_changed, findings[], summary}.- Service health — reuses the
healthcheckskill (--json) when available, otherwise reportsunknowninstead of failing the pipeline. scripts/notify-discord.sh— builds a color-coded Discord embed from the combined report and POSTs it to the webhook. No webhook = no fake success: it saves the payload and exits3so callers can surface "delivery pending".
scripts/run.sh orchestrates all three and computes an overall severity
(ok / warn / critical).
Wiring as a post-submit hook
Point your PR event (CI job, GitHub Action, or OpenClaw cron) at:
DISCORD_WEBHOOK_URL="https://discord.com/api/webhooks/..." \
bash scripts/run.sh --base "$BASE_SHA" --head "$HEAD_SHA" --repo "$REPO" --pr "$PR_NUMBER"
Exit code is 0 (pipeline ran); inspect the JSON overall field and the
discord_exit line on stderr to gate merges or alert.
