Skip to content

Commit b4dfdef

Browse files
authored
Merge branch 'main' into drive-by
2 parents 9fa80b8 + 4cfd119 commit b4dfdef

File tree

4 files changed

+98
-3
lines changed

4 files changed

+98
-3
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ jobs:
2424
cache: true
2525

2626
- name: test
27-
run: go test -v -cover ./...
27+
run: script/test

README.md

Lines changed: 82 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ A gh cli extension to automatically combine multiple pull requests into one.
77
[![test](https://github.com/github/gh-combine/actions/workflows/test.yml/badge.svg)](https://github.com/github/gh-combine/actions/workflows/test.yml)
88
[![release](https://github.com/github/gh-combine/actions/workflows/release.yml/badge.svg)](https://github.com/github/gh-combine/actions/workflows/release.yml)
99

10+
## About ⭐
11+
12+
This project is a gh cli extension that is used to combine multiple pull requests into one. It is inspired by the [github/combine-prs](https://github.com/github/combine-prs) Action but with a focus on the gh cli.
13+
14+
The primary use case for this extension is to combine multiple pull requests from dependabot into one. Even though dependabot supports [grouped version updates](https://github.blog/changelog/2023-06-30-grouped-version-updates-for-dependabot-public-beta/), these groups are limited by their type. For example, you cannot have dependabot combine a group of Ruby and JavaScript updates into one pull request. They are treated as separate groups. This extension solves that problem by bundling those updates into one pull request.
15+
1016
## Installation 💻
1117

1218
Install this gh cli extension by running the following command:
@@ -25,8 +31,82 @@ gh ext upgrade combine
2531

2632
## Usage 🚀
2733

34+
### Basic
35+
36+
Basic usage of the `combine` command to combine multiple dependent pull requests into one for a given repository:
37+
38+
```bash
39+
gh combine owner/repo
40+
```
41+
42+
> By default, this command runs with the `--branch-prefix dependabot/` flag set. All branches in the `owner/repo` repository that start with `dependabot/` will be combined.
43+
44+
### With Passing CI
45+
46+
Combine multiple pull requests together but only if their CI checks are passing:
47+
48+
```bash
49+
gh combine owner/repo --require-ci
50+
```
51+
52+
### With Passing CI and Approvals
53+
54+
```bash
55+
gh combine owner/repo --require-ci --require-approved
56+
```
57+
58+
### Combine Pull Requests from Multiple Repositories
59+
60+
```bash
61+
gh combine owner/repo1 owner/repo2
62+
63+
# alternatively separate with a comma
64+
gh combine owner/repo1,owner/repo2
65+
66+
# or use the --owner flag if all the repos are owned by the same owner
67+
gh combine --owner owner repo1 repo2 repo3
68+
```
69+
70+
### Use a File to Specify Repositories
71+
72+
```bash
73+
gh combine --file repos.txt
74+
```
75+
76+
Where `repos.txt` is a file with a list of repositories to combine (one per line):
77+
78+
```txt
79+
owner/repo1
80+
owner/repo2
81+
owner/repo3
82+
```
83+
84+
### Require a Minimum Number of PRs to Combine
85+
86+
By using the `--minimum` flag you can require a minimum number of pull requests that must be combined for a new PR to be opened. If less than the minimum number of pull requests are combined, the command will exit without opening a new PR.
87+
2888
```bash
29-
gh combine TODO
89+
gh combine owner/repo --minimum 3
3090
```
3191

32-
Run `gh combine --help` for more information.
92+
### Only Combine Pull Requests that match a given Label
93+
94+
```bash
95+
gh combine owner/repo --label dependencies
96+
```
97+
98+
You can also require a set of multiple labels
99+
100+
```bash
101+
gh combine owner/repo --labels security,dependencies
102+
```
103+
104+
### Running with Debug Logging
105+
106+
```bash
107+
LOG_LEVEL=DEBUG gh combine owner/repo
108+
```
109+
110+
---
111+
112+
Run `gh combine --help` for more information and full command/options usage.

script/lint

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#! /usr/bin/env bash
2+
3+
set -e
4+
5+
go fmt ./...

script/test

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#! /usr/bin/env bash
2+
3+
set -e
4+
5+
# if the tparse binary is not found, don't use it
6+
if ! command -v tparse &> /dev/null; then
7+
go test -v -cover ./...
8+
else
9+
set -o pipefail && go test -json ./... | tparse -all -trimpath github.com/github/
10+
fi

0 commit comments

Comments
 (0)