pr-pull: skip bottles for CI-syntax-only PRs

This commit is contained in:
Rylan Polster 2020-11-14 02:52:43 -05:00
parent e945b1c42a
commit e14ce96f22
2 changed files with 8 additions and 2 deletions

View File

@ -285,8 +285,9 @@ module Homebrew
Utils::Git.cherry_pick!(path, "--ff", "--allow-empty", *commits, verbose: args.verbose?, resolve: args.resolve?)
end
def formulae_need_bottles?(tap, original_commit, args:)
def formulae_need_bottles?(tap, original_commit, user, repo, pr, args:)
return if args.dry_run?
return false if GitHub.pull_request_labels(user, repo, pr).include? "CI-syntax-only"
changed_formulae(tap, original_commit).any? do |f|
!f.bottle_unneeded? && !f.bottle_disabled?
@ -394,7 +395,7 @@ module Homebrew
args: args)
end
unless formulae_need_bottles?(tap, original_commit, args: args)
unless formulae_need_bottles?(tap, original_commit, user, repo, pr, args: args)
ohai "Skipping artifacts for ##{pr} as the formulae don't need bottles"
next
end

View File

@ -779,4 +779,9 @@ module GitHub
end
end
end
def pull_request_labels(user, repo, pr)
pr_data = open_api(url_to("repos", user, repo, "pulls", pr))
pr_data["labels"].map { |label| label["name"] }
end
end