Merge pull request #9134 from Rylan12/pr-pull-ci-cyntax-only

pr-pull: skip bottles for CI-syntax-only PRs
This commit is contained in:
Mike McQuaid 2020-11-16 14:20:26 +00:00 committed by GitHub
commit 76ef45fac7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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