diff --git a/Library/Homebrew/dev-cmd/pr-pull.rb b/Library/Homebrew/dev-cmd/pr-pull.rb index 82a6a7f4ae..b7e4cf7522 100644 --- a/Library/Homebrew/dev-cmd/pr-pull.rb +++ b/Library/Homebrew/dev-cmd/pr-pull.rb @@ -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 diff --git a/Library/Homebrew/utils/github.rb b/Library/Homebrew/utils/github.rb index dc2e263c59..a235b77d74 100644 --- a/Library/Homebrew/utils/github.rb +++ b/Library/Homebrew/utils/github.rb @@ -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