Skip to content

Commit ddb67ae

Browse files
pitajMark-Simulacrum
authored andcommitted
add more config options for no_merges
for rust-lang/triagebot#1704
1 parent ff7da6f commit ddb67ae

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

src/triagebot/no-merge.md

+39
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,45 @@ This feature is enabled on a repository by having a `[no-merges]` table in `tria
1919
[no-merges]
2020
```
2121

22+
There are three optional values that can be specified in the table:
23+
24+
* `exclude_labels` --- A list of strings of label names to exclude.
25+
PRs with these labels set will not be checked for merge commits.
26+
27+
* `labels` --- A list of strings of label names to add.
28+
These labels will be set on the PR when merge commits are detected.
29+
30+
* `message` --- Override the default message posted for merge commits.
31+
The message will always be followed up with "The following commits are merge commits:" and then a list of the merge commits.
32+
33+
#### Default message
34+
35+
> There are merge commits (commits with multiple parents) in your changes. We have a [no merge policy](https://rustc-dev-guide.rust-lang.org/git.html#no-merge-policy) so these commits will need to be removed for this pull request to be merged.
36+
>
37+
> You can start a rebase with the following commands:
38+
>
39+
> ```shell-session
40+
> $ # rebase
41+
> $ git rebase -i master
42+
> $ # delete any merge commits in the editor that appears
43+
> $ git push --force-with-lease
44+
> ```
45+
46+
## Example
47+
48+
```toml
49+
[no-merges]
50+
# PRs with the following labels will be skipped
51+
exclude_labels = ["rollup", "sync"]
52+
# Add the following labels to PRs with merge commits
53+
labels = ["has-merge-commits", "S-waiting-on-author"]
54+
# Post the following warning message as a comment on PRs with merge commits
55+
message = """
56+
This repository does not allow merge commits.
57+
Your PR cannot be merged until it is rebased.
58+
"""
59+
```
60+
2261
## Implementation
2362

2463
See [`src/handlers/no_merges.rs`](https://github.com/rust-lang/triagebot/blob/HEAD/src/handlers/no_merges.rs).

0 commit comments

Comments
 (0)