ghprmerge

command module
v0.9.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

GitHub release License Active

ghprmerge

A command-line tool to automatically evaluate, merge, and optionally rebase GitHub pull requests sharing the same source branch across an organization.

Use case: merging automated dependency update pull requests (e.g., Dependabot) without requiring clicking through each repository individually.

Quick Start

# Set your GitHub token
export GITHUB_TOKEN=ghp_xxxxxxxxxxxx

# Optionally set the org as an environment variable (or use --org)
export GITHUB_ORG=myorg

# Check version
ghprmerge --version

# Show help with subcommand descriptions
ghprmerge --help

# Rebase out-of-date branches
ghprmerge rebase --org myorg --source-branch dependabot/

# Merge ready PRs (that are already up-to-date)
ghprmerge merge --org myorg --source-branch dependabot/

# Close matching PRs without merging them
ghprmerge close --org myorg --source-branch stale/

# Delete source branches after successfully closing their PRs
ghprmerge close --org myorg --source-branch stale/ --delete-source-branch

# Completed success, skipped, and neutral checks pass; pending checks block merging
# PRs with no checks configured are allowed

# Merge PRs even if behind (skip rebase requirement)
ghprmerge merge --org myorg --source-branch dependabot/ --skip-rebase

# Wait at least 30 seconds between merge requests (or set GHPRMERGE_MIN_MERGE_DELAY=30)
ghprmerge merge --org myorg --source-branch dependabot/ --min-merge-delay 30

# Match multiple source branches
ghprmerge merge --org myorg --source-branch dependabot/ --source-branch feature/

# Filter by author (e.g. only Dependabot PRs opened by the app)
ghprmerge merge --author 'dependabot[bot]' --org myorg --source-branch dependabot/

# Close PRs opened by a specific author
ghprmerge close --author JaredHatfield --org myorg --source-branch stale/

# Use --confirm to review pending actions before taking action
ghprmerge rebase --org myorg --source-branch dependabot/ --confirm

# Stream all repo results as they are scanned
ghprmerge merge --verbose --org myorg --source-branch dependabot/

# Disable colored output
ghprmerge merge --no-color --org myorg --source-branch dependabot/

# Report mode: group open PRs by source branch
ghprmerge report --org myorg

# Report with prefix filter and JSON output
ghprmerge report --json --org myorg --source-branch-prefix dependabot/

# Report with minimum group size
ghprmerge report --org myorg --min-group-size 3

Documentation

License

MIT License - see LICENSE for details.

Parallel processing

Use four repository workers to speed up scans and independent actions:

GHPRMERGE_WORKERS=4 ghprmerge report --org myorg
ghprmerge report --org myorg --workers 4
ghprmerge merge --org myorg --source-branch dependabot/ --workers 4 --min-merge-delay 2 --confirm
ghprmerge rebase --org myorg --source-branch dependabot/ --workers 4
ghprmerge close --org myorg --source-branch obsolete/ --workers 4 --confirm

The default is one worker. Set GHPRMERGE_WORKERS to a positive integer to change the default for all commands; an explicit --workers flag overrides it. PRs within each repository stay sequential. Start with a modest worker count: higher concurrency can reach GitHub rate limits sooner. Workers share rate-limit cooldowns and bounded retries. --min-merge-delay spaces merge requests across all workers.

Read rebase results
ghprmerge report --author 'dependabot[bot]' --min-group-size 1
ghprmerge rebase --source-branch dependabot/maven/ --source-branch dependabot/docker/

Report shows checks and branch freshness together, such as checks failing; 6 commits behind. Rebase processes all eligible matching PRs, including multiple patterns in the same repository. rebase requested means the comment/API request was submitted; completion is not verified. no rebase needed means the branch is already up to date, and may still have failing checks. Wait for branch updates and passing checks before running merge.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
config
Package config handles configuration and command line argument parsing for ghprmerge.
Package config handles configuration and command line argument parsing for ghprmerge.
github
Package github provides interfaces and implementations for interacting with GitHub API.
Package github provides interfaces and implementations for interacting with GitHub API.
merger
Package merger implements the core logic for discovering, evaluating, and merging pull requests.
Package merger implements the core logic for discovering, evaluating, and merging pull requests.
output
Package output handles formatting and displaying results.
Package output handles formatting and displaying results.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL