merge-pr

Verifies and merges ready GitHub pull requests with head SHA guards and branch protection compliance.

7|5|Updated Jul 22, 2025
One-click install
npx skills add https://github.com/nebius/nebius-ps-services --skill merge-pr-nebius
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: merge-pr
Source: https://github.com/nebius/nebius-ps-services/tree/main/skills/merge-pr
Command: npx skills add https://github.com/nebius/nebius-ps-services --skill merge-pr-nebius

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Merging a GitHub pull request safely requires checking draft state, review decisions, required checks, mergeability, and the exact head commit before merging. This Skill automates that verification sequence and refuses admin bypasses, preventing accidental merges of unready or changed code. ## Core Features & Use Cases - Readiness Verification: Resolves a PR by number, URL, or current branch and checks draft state, mergeability, review decision, and status check rollup before merging. - Head SHA Guarded Merge: Merges with gh pr merge --match-head-commit using squash, merge, or rebase, or the no-strategy path required by GitHub merge queues. - Pending Check Handling: Watches pending checks with gh pr checks --watch --fail-fast and stops if any required check fails. - Use Case: After create-pr opens a release-prep PR, use this Skill to wait for CI, verify reviews, and merge the exact reviewed commit without bypassing branch protection. ## Quick Start Use $merge-pr to verify and merge pull request number 42 with the squash method once its checks and reviews are ready.

Frequently Asked Questions about merge-pr

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

FAQPage Schema
How do I safely merge a GitHub pull request from the command line?

Use the GitHub CLI with `gh pr merge <pr> --squash --match-head-commit <sha>` after verifying checks, reviews, and mergeability with `gh pr view`. The match-head-commit flag guarantees you merge the exact commit that was reviewed.

How to merge a PR when required checks are still pending?

Run `gh pr checks <pr> --watch --fail-fast` to wait for pending checks to finish. If checks pass, refresh the PR metadata and merge with the latest head SHA; if they fail, report the failing checks and do not merge.

Does this work with GitHub merge queues?

Yes. When the base branch requires a merge queue, the Skill omits the merge strategy and runs `gh pr merge <pr> --match-head-commit <sha>` so GitHub adds the PR to the queue after checks and reviews are ready.

Can I bypass branch protection or use admin merge?

No. The Skill never passes `--admin` and never force merges or overrides branch protection. Required reviews, failing checks, draft state, and conflicts are treated as blockers, not conditions to bypass.

What merge methods are supported for GitHub PRs?

Squash is the default method for ordinary protected branches, with merge and rebase available via `--merge-method squash|merge|rebase`. Merge queue branches use the no-strategy path instead of an explicit method.

When should I not use this merge workflow?

Do not use it for Agentic SDLC runs, which are owned by `sdlc-merge-pr`, or when you need to modify files, rebase branches, or push updates. Use `review-pr` or `create-pr` for those tasks instead.