← 返回
开发者工具 中文

Merge Pr Check

Use this skill when the user asks to merge a PR, check if a PR is ready to merge, "merge PR", "can this PR be merged", "merge-pr-check". Requires Gitee MCP S...
用于处理PR合并请求,检查PR是否可以合并。触发词:merge PR、can this PR be merged、merge-pr-check。需要Gitee MCP服务支持。
oschina oschina 来源
开发者工具 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 571
下载
💾 4
安装
1
版本
#latest

概述

> Note: If you have mcporter installed locally, you should use mcporter to invoke the MCP tool instead of directly calling the MCP tool. The mcporter CLI provides a more convenient interface and better error handling.

Merge PR Check via Gitee MCP

Check whether a Pull Request meets the criteria for merging, then execute the merge after confirmation.

Prerequisites

  • Gitee MCP Server configured (tools: get_pull_detail, list_pull_comments, get_diff_files, merge_pull)
  • User must provide: repository owner, repository name, PR number

Steps

Step 1: Fetch PR Status

Use get_pull_detail to retrieve PR details and check:

Basic status

  • Whether the PR is open (stop if already closed/merged)
  • Whether it is a Draft — if so, inform the user it must be converted to a regular PR first
  • Whether source and target branches are correct

Pre-merge checklist

  • Whether the PR has a description explaining the purpose of the changes
  • Whether a reviewer has been assigned

Step 2: Analyze Comments and Review Feedback

Use list_pull_comments to retrieve all comments and check:

  • Whether any reviewer has explicitly objected to merging (e.g., "NACK", "needs changes", "do not merge")
  • Whether there are unresolved discussions (questions raised but not replied to)
  • Whether there are any LGTM or Approved responses

Step 3: Quick Diff Check

Use get_diff_files to inspect changed files:

  • Whether there are obvious omissions (e.g., code changed but related config not updated)
  • Whether unexpected files are included (debug code, temp files)
  • Whether the scope of changes matches the PR description

Step 4: Provide Merge Recommendation

Based on the checks above, output a merge assessment report:

## PR Merge Check Report

**PR**: #[number] [title]
**Status**: [Open/Draft/Closed]

### Checklist

✅ PR is in Open state
✅ Has a change description
⚠️  No reviewer approval yet
✅ Diff scope is reasonable

### Conclusion

[Ready to merge / Recommend waiting for review / Not recommended to merge]

Reason: [Specific explanation]

Step 5: Execute Merge (requires user confirmation)

If the checks pass, ask the user to confirm the merge.

After confirmation, use merge_pull with these parameters:

  • merge_method: merge strategy — merge (creates a merge commit), squash (squashes commits), or rebase
  • Default recommendation: merge; suggest squash if the PR has many messy commits
  • commit_message: merge commit message (optional, defaults to PR title)

After a successful merge, output the result and ask whether the user wants to delete the source branch.

Notes

  • Merging is irreversible — always wait for explicit user confirmation before proceeding
  • If there are conflicts, the Gitee API will return an error — prompt the user to resolve conflicts first
  • It is recommended to confirm that CI has passed before merging (check the PR's status checks)

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 21:23 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Mcporter

steipete
使用 mcporter CLI 直接列出、配置、认证及调用 MCP 服务器/工具(支持 HTTP 或 stdio),涵盖临时服务器、配置编辑及 CLI/类型生成功能。
★ 194 📥 67,398
business-ops

Triage Issues

oschina
当用户请求对问题进行分类、整理问题列表、显示所有打开的问题、对问题进行归类时使用此技能。
★ 0 📥 616
dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 676 📥 325,618