merge-pr

Solid

Merge a pull request with status checks, squash merge, and branch cleanup. Handles worktree contexts.

Code & Development 416 stars 49 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 93/100

Stars 20%
87
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Merge Pull Request Merge a pull request with consistent practices: verify checks, squash merge, clean up the branch, and pull latest main. ## Command Options - `$ARGUMENTS`: PR number (optional — defaults to the PR for the current branch) ## Your task ### Step 1: Identify the PR - If a PR number was provided, use it - Otherwise, detect from the current branch: `gh pr view --json number,title,state,headRefName,baseRefName` - Confirm the PR exists and is open - Display the PR title and number before proceeding ### Step 2: Verify merge readiness Check each of the following and report status: - **CI status**: Run `gh pr checks` to verify all required checks have passed - **Merge conflicts**: Run `gh pr view --json mergeable` to verify no conflicts If CI has not passed, **stop and report**. Do not proceed with the merge. ### Step 3: Merge the PR - Squash merge: `gh pr merge --squash` - Do **not** pass `--delete-branch` — GitHub is configured to auto-delete remote branches on merge. Local branch cleanup is handled in Step 4. ### Step 4: Detect worktree context Before updating local state, determine whether you are inside a git worktree: ```bash git rev-parse --git-dir git rev-parse --git-common-dir ``` - If these values are **identical**, you are in a normal repo — proceed with Step 5a. - If they **differ**, you are in a worktree — proceed with Step 5b. ### Step 5a: Update local state (normal repo) After `gh pr merge` completes: - Switch to the base branch (e.g...

Details

Author
joshukraine
Repository
joshukraine/dotfiles
Created
11 years ago
Last Updated
yesterday
Language
Shell
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category