diff --git a/Library/Homebrew/dev-cmd/pr-pull.rb b/Library/Homebrew/dev-cmd/pr-pull.rb index 82a6a7f4aed51..b7e4cf752242e 100644 --- a/Library/Homebrew/dev-cmd/pr-pull.rb +++ b/Library/Homebrew/dev-cmd/pr-pull.rb @@ -285,8 +285,9 @@ def cherry_pick_pr!(user, repo, pr, args:, path: ".") 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 @@ def pr_pull 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 dc2e263c599f4..a235b77d74de1 100644 --- a/Library/Homebrew/utils/github.rb +++ b/Library/Homebrew/utils/github.rb @@ -779,4 +779,9 @@ def pull_request_commits(user, repo, pr, per_page: 100) 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