Merge pull request #17712 from Homebrew/homebrew_no_verify_attestations

This commit is contained in:
Mike McQuaid 2024-07-13 17:50:35 -04:00 committed by GitHub
commit 3ff8b65109
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -45,9 +45,13 @@ module Homebrew
# @api private
sig { returns(T::Boolean) }
def self.enabled?
Homebrew::EnvConfig.verify_attestations? \
|| Homebrew::EnvConfig.developer? \
|| Homebrew::Settings.read("devcmdrun") == "true"
# TODO: allow this undocumented variable until this is rolled out more
# widely and then we can remove or document it.
return false if ENV.fetch("HOMEBREW_NO_VERIFY_ATTESTATIONS", false)
Homebrew::EnvConfig.verify_attestations? ||
Homebrew::EnvConfig.developer? ||
Homebrew::Settings.read("devcmdrun") == "true"
end
# Returns a path to a suitable `gh` executable for attestation verification.