Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rnorth/gh-combine-prs
A `gh` extension for combining multiple PRs (e.g. Dependabot PRs) into one.
https://github.com/rnorth/gh-combine-prs
gh-extension
Last synced: 11 days ago
JSON representation
A `gh` extension for combining multiple PRs (e.g. Dependabot PRs) into one.
- Host: GitHub
- URL: https://github.com/rnorth/gh-combine-prs
- Owner: rnorth
- License: apache-2.0
- Created: 2021-09-02T11:36:08.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-20T19:01:28.000Z (about 1 year ago)
- Last Synced: 2024-10-23T08:53:31.796Z (19 days ago)
- Topics: gh-extension
- Language: Shell
- Homepage:
- Size: 22.5 KB
- Stars: 100
- Watchers: 4
- Forks: 14
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-gh-cli-extensions - **combine-prs** - An extension for GitHub CLI that combines multiple PRs into one. (Github)
- jimsghstars - rnorth/gh-combine-prs - A `gh` extension for combining multiple PRs (e.g. Dependabot PRs) into one. (Shell)
README
# gh-combine-prs
This is an extension for [GitHub CLI](https://cli.github.com/) that combines multiple PRs into one.
It is intended for use in repositories that receive many PRs that can be merged simultaneously, e.g. trivial Dependabot version bump PRs.The tool will attempt to create one PR that contains all PRs that:
* match a provided query - e.g. `--query "author:app/dependabot"` so that only Dependabot PRs are processed
* and have checks passing
* and that can be merged cleanly - e.g. if two combinable PRs conflict with one another, only one will be merged.This tool does not automerge into the `master`/`main` branch - it just attempts to create one unified PR for review and automated checks to run against.
*Note: When you merge the combined PR, it is recommended that you create a Merge Commit.
This allows GitHub to automatically detect that all of the original combined PRs have been merged, so that their state can be set correctly.*## Installation
Prerequisites:
* [GitHub CLI](https://cli.github.com/) is already installed and authenticated
* [`jq`](https://stedolan.github.io/jq/) is installedTo install this extension:
```
gh extension install rnorth/gh-combine-prs
```## Usage
```
cd $DIRECTORY_OF_YOUR_REPOgh combine-prs --query "QUERY"
```### Required arguments
--query "QUERY"
sets the query used to find combinable PRs.
e.g. --query "author:app/dependabot"
to combine Dependabot PRs### Optional arguments
--selected-pr-numbers COMMA,SEPARATED,LIST
if set, will only work on PRs with the selected numbers.
e.g. --selected-pr-numbers 42,13,78
Defaults to selecting every PR matching the QUERY
--limit LIMIT
sets the maximum number of PRs that will be combined.
Defaults to 50
--skip-pr-check
if set, will combine matching PRs even if they are not passing checks.
Defaults to false when not specified## License
See [LICENSE](./LICENSE)