PR Auto-Check
Automated pipeline that runs on new PR submission: code review → health check → Discord notification.
Workflow
-
Run the pipeline script — collects CI status, diff stats, and health check results:
bash {baseDir}/scripts/pr_auto_check.sh --pr <number> [--repo <owner/repo>] [--json]--json: machine-readable output (for piping)- Without
--json: human-readable report printed to stdout - Prints the temp result-file path as the last line (for piping to notification)
-
Conduct code review — use the
code-reviewskill on the PR diff. Focus on:- Critical issues and security findings
- CI/CD failures (if any)
- Summarize findings into the report
-
Post result to Discord:
bash {baseDir}/scripts/notify_discord.sh --webhook <DISCORD_WEBHOOK_URL> --result <json-file>
One-liner (CI/CD integration)
RESULT=$(bash {baseDir}/scripts/pr_auto_check.sh --pr 42 --json) && \
bash {baseDir}/scripts/notify_discord.sh --webhook "$WEBHOOK" --result "$RESULT"
Required Environment
ghCLI authenticated (gh auth login)jqfor JSON processingcurlfor Discord webhook- Discord webhook URL (set as
DISCORD_WEBHOOKenv var or pass--webhook) - Optional:
healthcheckskill installed for service health validation
Discord Webhook Setup
- Server Settings → Integrations → Webhooks → New Webhook
- Copy the webhook URL
- Set
DISCORD_WEBHOOKin your environment or pass via--webhook
Exit Codes (pr_auto_check.sh)
| Code | Meaning |
|---|---|
| 0 | All checks passed |
| 1 | CI failures or health warnings |
| 2 | Critical health issues |
Output Format
See references/output-format.md for the JSON schema.
