当前位置: 首页 > Skill >

PR Autocheck

PR Autocheck

PR Autocheck

Automated post-submit checks for an AI code-review platform. Use when a new pull request is submitted (or on demand) to run a code review, validate service h...

0.1.0 2026.11.13 807
获取Skill文件查看使用说明
作 者:叶言 许可证: 更新时间:2026.11.13
本文目录收起

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

  1. 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}.
  2. Service health — reuses the healthcheck skill (--json) when available, otherwise reports unknown instead of failing the pipeline.
  3. 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 exits 3 so 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.

相关文章

更多
Git项目协作模式详解:从集中式到Forking工作流

Git的分布式特性支持多种团队协作模式。本文详细解析了集中式工作流、分支工作流、GitFlow工作流及Forking工作流的适用场景、操作流程与优缺点。集中式模式简单但易冲突;分支模式通过Feature隔离提升安全性;GitFlow通过master、develop、release和hotfix分支实现标准化发布流程,适合大型项目;Forking模式则通过独立仓库和Pull Request机制,完美适配开源社区与外部贡献者管理。

2025.02.08 510
Skill 文件

相关 Skill

更多
gy3 gy3 Use when preparing a concise pull request summary, review notes, or change explanation from git diffs, commit logs, or implementation details.
Deterministic security fixes for infrastructure code via Gomboc.ai Community Edition Deterministic security fixes for infrastructure code via Gomboc.ai Community Edition 自动扫描并确定性修复 Terraform、CloudFormation 和 IaC 中的安全问题,提供可合并的 Pull Request 并集成 CI/CD。
Pr Review Pr Review 全面审查Pull Request,关注代码质量、安全、性能和可维护性,适用于任何代码审查任务。
Pr Description Generator Pr Description Generator 自动从 git diff 和提交历史生成 Pull Request 描述,解析常规提交并对变更进行分类(功能、修复、重构等)。
comprehensive-review-pr-enhance comprehensive-review-pr-enhance 你是一名 PR 优化专家,专注于创建便于高效代码审查的高质量 pull request。生成全面的 PR 描述、自动化审查流程,并确保 PR 在清晰度、规模与可