merge-pr

Merge a GitHub pull request with squash strategy after verifying checks.

Updated Jan 20, 2026
One-click install
npx skills add https://github.com/Team-Hireal/RealChat --skill merge-pr-team-hireal
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: merge-pr
Source: https://github.com/Team-Hireal/RealChat/tree/main/openclaw/.agents/skills/merge-pr
Command: npx skills add https://github.com/Team-Hireal/RealChat --skill merge-pr-team-hireal

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 Merging: Merges PRs using gh pr merge --squash.
  • Branch Cleanup: Automatically deletes the feature branch after a successful merge.
  • Safety Guardrails: Includes checks to prevent merging draft PRs, merging PRs with failing checks, or merging branches that are behind main.
  • Use Case: After a PR has been reviewed and prepared for merging, this Skill can be invoked to complete the merge process 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 automatically squash and merge a GitHub pull request?

To automatically squash and merge a GitHub pull request, the Skill executes `gh pr merge --squash` after verifying the PR is not a draft, all checks pass, and the branch is not behind main. It ensures a clean integration into the main branch.

What happens to the feature branch after a squash merge on GitHub?

After a successful squash merge on GitHub, the feature branch is automatically deleted. The Skill includes branch cleanup as a post-merge step to ensure obsolete branches are removed from the repository.

Can I merge a GitHub PR if the branch is behind main or has failing checks?

You cannot merge a GitHub PR if the branch is behind main or has failing checks. The Skill enforces safety guardrails by verifying all required checks are passing and the branch is fully updated before executing the squash merge.

What is the best way to prevent merging draft pull requests in GitHub automation?

To prevent merging draft pull requests in GitHub automation, the Skill includes a built-in check to verify the PR is not in a draft state. It halts the merge process immediately if the draft status is detected.

Does the automated GitHub merge process verify the final PR state?

Yes, the automated GitHub merge process verifies the final PR state is set to MERGED. It records the final merge SHA and cleans up the temporary worktree only after confirming the merge was successfully completed.