Skip to content
Back to skills

Merge Pull Request

ASecurity

Use when merging a single GitHub pull request. Handles pre-flight checks, waits for CI, and executes the merge with the repo's default method or merge queue.

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 10, 2026
ai-agentsgit

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned November 9, 2026

npx -y skills add LandonSchropp/agent-toolkit --skill merge-pull-request --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Merge Pull Request?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Merge Pull Request
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/landonschropp-merge-pull-request/badge)](https://www.skillsdirectory.com/skills/landonschropp-merge-pull-request)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: merge-pull-request
description: Use when merging a single GitHub pull request. Handles pre-flight checks, waits for CI, and executes the merge with the repo's default method or merge queue.
---

# Merge Pull Request

This skill runs inside herdr and merges a pull request opened from this workspace's branch. Pass `--pull-request-url <url>` to each script.

## Process

1. **Wait until ready:** Run `herdr-pull-request-status watch --workspace "$HERDR_WORKSPACE_ID"` with the `Monitor` tool, at its longest timeout, and re-arm it each time it expires. Wait for the pull request's line to show `ready to merge`. `waiting for CI` and `in merge queue` resolve on their own. Any other status is a blocker, such as `CI failed`, `changes requested` or `waiting for review`, so stop and surface it to the user. Never call `herdr-pull-request-status add` here, since it attaches the pull request to this workspace's sidebar.

2. **Merge:** Run `scripts/merge-pull-request.sh`. Detects whether the target branch uses a merge queue — if so, adds the pull request to the queue without a strategy flag. Otherwise detects the repo's allowed methods (rebase > squash > merge commit) and merges with that method, leaving the remote branch for the repository's auto-delete setting. Never delete the merged branch from the remote yourself, such as with `gh pr merge --delete-branch` or `git push --delete`.

3. **Confirm:** Run `scripts/wait-for-pull-request-to-be-merged.sh`. Polls until the pull request state is `MERGED`, and fails if it leaves the merge queue without merging. Required when a merge queue is involved since the merge completes asynchronously; run it in the background so the user can keep working, and if it fails, find out why from the pull request's checks and tell the user.

## Rationalizations

| Thought                                                        | Reality                                                                       |
| -------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| "CI is almost done, I'll skip the wait"                        | Wait for `ready to merge`. `watch` handles the wait.                          |
| "The pull request is blocked on approvals, I'll use `--admin`" | Admin bypass is a user decision, not the skill's. Surface the block and stop. |

Files in this skill

  • SKILL.md1.8 KB
  • scripts/is-pull-request-ready.sh3.4 KB
  • scripts/merge-pull-request.sh3.1 KB
  • scripts/wait-for-pull-request-to-be-merged.sh1.3 KB
  • scripts/wait-for-pull-request-to-be-ready.sh1.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.