bump: skip PR checking when livecheck fails

`brew bump` will check for PRs related to a package even if livecheck
fails to identify new versions. This reworks related conditions to
ensure that related PR checks are only run when livecheck returns
version information.
This commit is contained in:
Sam Ford 2024-11-24 20:37:18 -05:00
parent 918206e1fd
commit 1cbcc44cb4
No known key found for this signature in database
GPG Key ID: 7AF5CBEE1DD6F76D

View File

@ -366,15 +366,17 @@ module Homebrew
new_version = BumpVersionParser.new(general: "unable to get versions") new_version = BumpVersionParser.new(general: "unable to get versions")
end end
# We use the arm version for the pull request version. This is consistent if !args.no_pull_requests? &&
# with the behavior of bump-cask-pr. (new_version.general != "unable to get versions") &&
pull_request_version = if multiple_versions && new_version.general != "unable to get versions" (new_version != current_version)
new_version.arm.to_s # We use the ARM version for the pull request version. This is
else # consistent with the behavior of bump-cask-pr.
new_version.general.to_s pull_request_version = if multiple_versions
end new_version.arm.to_s
else
new_version.general.to_s
end
if !args.no_pull_requests? && (new_version != current_version)
duplicate_pull_requests = retrieve_pull_requests( duplicate_pull_requests = retrieve_pull_requests(
formula_or_cask, formula_or_cask,
name, name,
@ -460,7 +462,9 @@ module Homebrew
#{outdated_synced_formulae.join(", ")}. #{outdated_synced_formulae.join(", ")}.
EOS EOS
end end
if !args.no_pull_requests? && !versions_equal if !args.no_pull_requests? &&
(new_version.general != "unable to get versions") &&
!versions_equal
if duplicate_pull_requests if duplicate_pull_requests
duplicate_pull_requests_text = duplicate_pull_requests duplicate_pull_requests_text = duplicate_pull_requests
elsif maybe_duplicate_pull_requests elsif maybe_duplicate_pull_requests