← 返回
安全合规 中文

Merge Check

Analyze a GitHub pull request for mergeability — predict whether it will get merged based on technical, architectural, process, social, and compliance factor...
分析 GitHub 拉取请求的可合并性——基于技术、架构、流程、社交和合规因素预测是否会被合并。
tag-assistant
安全合规 clawhub v1.0.0 1 版本 99744.5 Key: 无需
★ 0
Stars
📥 1,171
下载
💾 7
安装
1
版本
#latest

概述

Merge Check

Predicts whether a GitHub PR will get merged by analyzing it against a comprehensive rejection vector taxonomy. Not a generic code quality tool — this answers: "Will this PR get merged by the maintainer?"

Quick Start

  1. Run the data gathering script:

```bash

bash skills/merge-check/scripts/merge-check.sh owner/repo#123

# or

bash skills/merge-check/scripts/merge-check.sh https://github.com/owner/repo/pull/123

```

  1. Parse the JSON output
  2. Analyze against the dimensions below
  3. Produce the mergeability report

Analysis Dimensions

After gathering data, analyze across ALL of these dimensions. Load skills/merge-check/references/rejection-taxonomy.md for the detailed rejection vector framework.

1. Technical Signals (Automated Gates)

  • CI status: Are all checks passing? Any failed or pending?
  • Build status: Does it compile/build?
  • Coverage: Any coverage regression indicated?

2. PR Hygiene

  • Size (most predictive single factor):
  • 🟢 <400 LOC changed — ideal, easy to review
  • 🟡 400–1000 LOC — risky, reviewer fatigue
  • 🔴 >1000 LOC — danger zone, likely to stall or get rejected
  • File spread: Concentrated in one area or scattered across directories?
  • Single concern: Does it do one thing, or is it a kitchen-sink PR?
  • Title & description: Clear, descriptive? Or vague/empty?
  • Linked issue: Does it reference an issue? (Signals intentionality)
  • Commit hygiene: Clean messages? Reasonable count? Squash-ready?

3. Architectural Fit

  • Pattern consistency: Does it follow repo conventions? (language, directory structure, naming)
  • Dependencies: New dependencies introduced? (High friction signal)
  • Scope creep: Does it touch things outside its stated purpose?
  • File types: Consistent with repo's tech stack?

4. Review Status

  • Approvals: Any already? How many required?
  • Changes requested: Outstanding and unaddressed? (Strong rejection signal)
  • Reviewer assignment: Are required reviewers assigned?
  • Review comment sentiment: Positive, neutral, or adversarial?
  • CODEOWNERS: Does the PR touch files with code owners? Are they reviewing?

5. Process Compliance

  • Draft status: Draft PRs won't merge
  • Blocking labels: WIP, do-not-merge, needs-work, etc.
  • PR template: Was it followed? (Empty template = red flag)
  • CLA/DCO: If repo requires it, is it signed?

6. Social/Meta Signals

  • Author merge history: What % of this author's recent PRs were merged in this repo?
  • Staleness: How long has it been open? (>2 weeks = concern, >30 days = likely abandoned)
  • Activity level: Recent comments/updates, or radio silence?
  • First-time contributor: Higher rejection rate for newcomers

Output Format

Produce a structured report:

Mergeability Score

  • 🟢 High (>80% likely to merge) — No blockers, reviews positive, CI green
  • 🟡 Medium (40–80%) — Some concerns but addressable
  • 🔴 Low (<40%) — Significant blockers present

Report Sections

  1. Mergeability Score: 🟢/🟡/🔴 with percentage estimate
  2. Risk Factors: Bullet list of specific concerns, ordered by severity
  3. Strengths: What's working in the PR's favor
  4. Recommendations: Actionable steps to improve mergeability (if not already 🟢)
  5. Verdict: One-sentence summary

Example Output

## PR Mergeability Report: owner/repo#123

**Score: 🟡 Medium (~55%)**

### Risk Factors
- ⚠️ 847 lines changed — approaching reviewer fatigue threshold
- ⚠️ Changes requested by @maintainer not yet addressed
- ⚠️ Touches 12 files across 6 directories — scattered scope
- ℹ️ No linked issue

### Strengths
- ✅ All 14 CI checks passing
- ✅ Clear title and detailed description
- ✅ Author has 73% merge rate in this repo (8/11 recent PRs)
- ✅ Active discussion — last update 2 hours ago

### Recommendations
1. Address @maintainer's review comments before requesting re-review
2. Consider splitting into smaller PRs (config changes vs logic changes)
3. Link the relevant issue for traceability

### Verdict
Solid PR with passing CI and an active author, but stalled on unaddressed review feedback — resolving those comments is the critical path to merge.

Script Reference

The script (scripts/merge-check.sh) gathers all data via gh CLI and outputs a single JSON object with these keys:

KeyContents
---------------
prFull PR metadata (title, body, author, state, draft, labels, reviewers)
filesList of changed files with patch stats
diff_statsTotal additions, deletions, changed files count
checksCI/check run results for the head commit
reviewsAll reviews (approved, changes_requested, commented)
review_commentsInline review comments
issue_commentsPR conversation comments
commitsCommit list with messages
repoRepository metadata (language, size, defaults)
author_historyAuthor's recent closed PRs and merge rate
has_codeownersBoolean
has_contributingBoolean

Error Handling

The script outputs "error" fields when individual API calls fail (e.g., rate limits, 404s). Analyze what's available and note any missing data in the report.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 07:19 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

security-compliance

OpenClaw Backup

alex3alex
备份与恢复 OpenClaw 数据。适用于创建备份、设置自动备份计划、从备份恢复或管理备份轮转。处理 ~/.openclaw 目录归档并包含适当的排除规则。
★ 89 📥 30,586
security-compliance

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,210 📥 266,157
developer-tools

Github Cli

tag-assistant
GitHub CLI (gh) 综合参考指南,涵盖仓库、Issue、PR、Actions、发布、Gist、搜索、Projects v2、API、密钥/变量、标签、Codespaces 等。
★ 6 📥 10,507