Pass args in pr-automerge instead of using global args.

This commit is contained in:
Markus Reiter 2020-07-26 09:44:26 +02:00
parent e9ade913c4
commit bd0346e083

View File

@ -32,15 +32,15 @@ module Homebrew
end
def pr_automerge
pr_automerge_args.parse
args = pr_automerge_args.parse
without_labels = Homebrew.args.without_labels || ["do not merge", "new formula"]
tap = Tap.fetch(Homebrew.args.tap || CoreTap.instance.name)
without_labels = args.without_labels || ["do not merge", "new formula"]
tap = Tap.fetch(args.tap || CoreTap.instance.name)
query = "is:pr is:open repo:#{tap.full_name}"
query += Homebrew.args.ignore_failures? ? " -status:pending" : " status:success"
query += " review:approved" unless Homebrew.args.without_approval?
query += " label:\"#{args.with_label}\"" if Homebrew.args.with_label
query += args.ignore_failures? ? " -status:pending" : " status:success"
query += " review:approved" unless args.without_approval?
query += " label:\"#{args.with_label}\"" if args.with_label
without_labels&.each { |label| query += " -label:\"#{label}\"" }
odebug "Searching: #{query}"