Merge pull request #20229 from Homebrew/attestation_opt_in

attestation: require explicit opt-in.
This commit is contained in:
Mike McQuaid 2025-07-10 08:24:48 +00:00 committed by GitHub
commit 5bc5d53a23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -64,12 +64,8 @@ module Homebrew
sig { returns(T::Boolean) }
def self.enabled?
return false if Homebrew::EnvConfig.no_verify_attestations?
return true if Homebrew::EnvConfig.verify_attestations?
return false if ENV.fetch("CI", false)
return false if OS.not_tier_one_configuration?
# Always check credentials last to avoid unnecessary credential extraction.
(Homebrew::EnvConfig.developer? || Homebrew::EnvConfig.devcmdrun?) && GitHub::API.credentials.present?
Homebrew::EnvConfig.verify_attestations?
end
# Returns a path to a suitable `gh` executable for attestation verification.