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

Fix type comparison for gh #18031

Closed
wants to merge 3 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Library/Homebrew/attestation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ def self.enabled?
return false if ENV.fetch("CI", false)
return false if OS.unsupported_configuration?

gh_version = Formula["gh"].any_installed_version.to_s
return false if gh_version.nil? || gh_version < "2.49"
pmartindev marked this conversation as resolved.
Show resolved Hide resolved

# Always check credentials last to avoid unnecessary credential extraction.
(Homebrew::EnvConfig.developer? || Homebrew::EnvConfig.devcmdrun?) && GitHub::API.credentials.present?
end
Expand All @@ -78,7 +81,7 @@ def self.gh_executable
# to prevent a cycle during bootstrapping. This can eventually be resolved
# by vendoring a pure-Ruby Sigstore verifier client.
with_env(HOMEBREW_NO_VERIFY_ATTESTATIONS: "1") do
@gh_executable = ensure_executable!("gh", reason: "verifying attestations", latest: true)
@gh_executable = ensure_formula_installed!("gh", reason: "verifying attestations", latest: true).opt_bin/"gh"
end

T.must(@gh_executable)
Expand Down
Loading