gh:pr-merge

Merge approved GitHub PRs after validating checks and protection rules.

Updated May 31, 2025
One-click install
npx skills add https://github.com/dEitY719/dotfiles --skill gh-pr-merge-deity719
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gh:pr-merge
Source: https://github.com/dEitY719/dotfiles/tree/main/claude/skills/gh-pr-merge
Command: npx skills add https://github.com/dEitY719/dotfiles --skill gh-pr-merge-deity719

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Merges an approved GitHub PR using one of three strategies — rebase, squash, or merge commit — without asking for confirmation.

Core Features & Use Cases

  • Pre-flight checks validate PR state, draft status, mergeability, review decision, required checks, and branch protection rules before merging.
  • Strategy flexibility supports rebase, squash, or merge, and always deletes the head branch on success.
  • Post-merge hygiene updates project boards and prints a compact SHA of the merge.

Quick Start

Run the /gh-pr-merge command with a PR number and optional strategy to merge an approved PR without confirmation.

Frequently Asked Questions about gh:pr-merge

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

FAQPage Schema
How do I automatically merge an approved GitHub PR only after CI checks pass?

To automatically merge an approved GitHub PR after CI checks pass, this Skill runs parallel pre-flight validations on required checks and branch protection rules, performing a non-interactive merge once all conditions are met.

Can I automate a GitHub squash merge or rebase for protected branches without manual confirmation?

Yes, you can automate a GitHub squash merge or rebase for protected branches by specifying your desired strategy, which executes a non-interactive merge and deletes the head branch on success.

What happens if I try to merge a draft PR or a pull request with merge conflicts?

When attempting to merge a draft PR or a pull request with merge conflicts, the automation enforces a hard stop and aborts the process to prevent unsafe or incomplete merges.

How do I safely merge multiple approved pull requests in one go while respecting branch protection rules?

You can safely merge approved pull requests in one go by running the command with a PR number, which validates review decisions and branch protection rules before performing the merge and reporting the compact SHA.

Does the GitHub merge automation delete the remote branch after a successful rebase or squash?

Yes, the GitHub merge automation applies the --delete-branch flag upon a successful rebase, squash, or merge commit, removing the remote head branch and outputting the resulting commit SHA.

What is the best way to validate GitHub PR state and review decisions before triggering an automated merge?

The best way to validate GitHub PR state and review decisions before merging is running a pre-flight check, which assesses draft status, mergeability, required checks, and branch protection rules.