mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Merge pull request #20229 from Homebrew/attestation_opt_in
attestation: require explicit opt-in.
This commit is contained in:
commit
5bc5d53a23
@ -64,12 +64,8 @@ module Homebrew
|
|||||||
sig { returns(T::Boolean) }
|
sig { returns(T::Boolean) }
|
||||||
def self.enabled?
|
def self.enabled?
|
||||||
return false if Homebrew::EnvConfig.no_verify_attestations?
|
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.verify_attestations?
|
||||||
(Homebrew::EnvConfig.developer? || Homebrew::EnvConfig.devcmdrun?) && GitHub::API.credentials.present?
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns a path to a suitable `gh` executable for attestation verification.
|
# Returns a path to a suitable `gh` executable for attestation verification.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user