Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Nov 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions Library/Homebrew/dev-cmd/pr-pull.rb
Expand Up @@ -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?
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions Library/Homebrew/utils/github.rb
Expand Up @@ -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