pr-automerge: allow multiple comma separated -labels

This commit is contained in:
Dawid Dziurla 2020-04-15 20:57:35 +02:00 committed by Jonathan Chang
parent ecea0e5abd
commit 8305919c93
3 changed files with 9 additions and 8 deletions

View File

@ -17,8 +17,8 @@ module Homebrew
description: "Target repository tap (default: `homebrew/core`)"
flag "--with-label=",
description: "Pull requests must have this label (default: `ready to merge`)"
flag "--without-label=",
description: "Pull requests must not have this label (default: `do not merge`)"
comma_array "--without-labels=",
description: "Pull requests must not have these labels (default: `do not merge`, `new formula`)"
switch "--publish",
description: "Run `brew pr-publish` on matching pull requests."
switch "--ignore-failures",
@ -33,11 +33,12 @@ module Homebrew
ENV["HOMEBREW_FORCE_HOMEBREW_ON_LINUX"] = "1" unless OS.mac?
with_label = Homebrew.args.with_label || "ready to merge"
without_label = Homebrew.args.without_label || "do not merge"
without_labels = Homebrew.args.without_labels || ["do not merge", "new formula"]
tap = Tap.fetch(Homebrew.args.tap || CoreTap.instance.name)
query = "is:pr is:open repo:#{tap.full_name} label:\"#{with_label}\" -label:\"#{without_label}\""
query = "is:pr is:open repo:#{tap.full_name} label:\"#{with_label}\""
query += args.ignore_failures? ? " -status:pending" : " status:success"
without_labels&.each { |label| query += " -label:\"#{label}\"" }
odebug "Searching: #{query}"
prs = GitHub.search_issues query

View File

@ -854,8 +854,8 @@ Finds pull requests that can be automatically merged using `brew pr-publish`.
Target repository tap (default: `homebrew/core`)
* `--with-label`:
Pull requests must have this label (default: `ready to merge`)
* `--without-label`:
Pull requests must not have this label (default: `do not merge`)
* `--without-labels`:
Pull requests must not have these labels (default: `do not merge`, `new formula`)
* `--publish`:
Run `brew pr-publish` on matching pull requests.
* `--ignore-failures`:

View File

@ -1100,8 +1100,8 @@ Target repository tap (default: \fBhomebrew/core\fR)
Pull requests must have this label (default: \fBready to merge\fR)
.
.TP
\fB\-\-without\-label\fR
Pull requests must not have this label (default: \fBdo not merge\fR)
\fB\-\-without\-labels\fR
Pull requests must not have these labels (default: \fBdo not merge\fR, \fBnew formula\fR)
.
.TP
\fB\-\-publish\fR