merge-pr

Merge GitHub pull requests via squash with safety checks and branch cleanup.

Updated Feb 3, 2026
One-click install
npx skills add https://github.com/sky770825/openclaw-console-hub --skill merge-pr-sky770825
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: merge-pr
Source: https://github.com/sky770825/openclaw-console-hub/tree/main/openclaw-main/.agents/skills/merge-pr
Command: npx skills add https://github.com/sky770825/openclaw-console-hub --skill merge-pr-sky770825

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the process of merging prepared GitHub Pull Requests (PRs) using a squash strategy, ensuring a clean and controlled integration into the main branch.

Core Features & Use Cases

  • Automated Squashing: Merges PRs using gh pr merge --squash, preserving commit history clarity.
  • Branch Cleanup: Automatically deletes the source branch after a successful merge.
  • Safety Checks: Includes checks for draft PRs, failing CI checks, and branches that are behind the main branch before merging.
  • Use Case: After a code review and preparation, use this skill to merge a feature branch into main without manual intervention, ensuring all checks pass and the branch is cleaned up.

Quick Start

Use the merge-pr skill to merge pull request number 123.

Frequently Asked Questions about merge-pr

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I squash and merge a GitHub pull request automatically?

To squash and merge a GitHub pull request automatically, this skill executes `gh pr merge --squash --delete-branch` after verifying all CI checks pass and the PR is not in draft status.

What checks are performed before merging a pull request?

Before merging a pull request, sanity checks are performed for draft PR status, failing CI checks, and branch staleness to ensure the source branch is not behind the main branch.

Does merging a GitHub PR delete the source branch after completion?

Yes, merging a GitHub PR deletes the source branch automatically post-merge and cleans up local worktrees and temporary branches upon verifying the PR state is `MERGED`.

Can I queue a GitHub pull request merge before CI checks finish?

Yes, you can queue a GitHub pull request merge before CI checks finish by utilizing the optional `--auto` flag, which enables auto-merging once all required checks pass.

What happens if my pull request is still in draft status?

If your pull request is still in draft status, the merge process is blocked by a sanity check to prevent merging unreviewed or incomplete code into the main branch.

Why does my pull request fail to merge when the branch is behind main?

Your pull request fails to merge when the branch is behind main because a staleness check prevents integration, requiring you to update your feature branch with the latest changes first.