Merge pull request #17692 from Homebrew/ww/attestations-for-dev
This commit is contained in:
commit
6a5bcb339d
@ -40,6 +40,16 @@ module Homebrew
|
|||||||
# @api private
|
# @api private
|
||||||
class GhAuthNeeded < RuntimeError; end
|
class GhAuthNeeded < RuntimeError; end
|
||||||
|
|
||||||
|
# Returns whether attestation verification is enabled.
|
||||||
|
#
|
||||||
|
# @api private
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def self.enabled?
|
||||||
|
Homebrew::EnvConfig.verify_attestations? \
|
||||||
|
|| Homebrew::EnvConfig.developer? \
|
||||||
|
|| Homebrew::Settings.read("devcmdrun") == "true"
|
||||||
|
end
|
||||||
|
|
||||||
# Returns a path to a suitable `gh` executable for attestation verification.
|
# Returns a path to a suitable `gh` executable for attestation verification.
|
||||||
#
|
#
|
||||||
# @api private
|
# @api private
|
||||||
|
@ -1258,7 +1258,7 @@ on_request: installed_on_request?, options:)
|
|||||||
def pour
|
def pour
|
||||||
# We skip `gh` to avoid a bootstrapping cycle, in the off-chance a user attempts
|
# We skip `gh` to avoid a bootstrapping cycle, in the off-chance a user attempts
|
||||||
# to explicitly `brew install gh` without already having a version for bootstrapping.
|
# to explicitly `brew install gh` without already having a version for bootstrapping.
|
||||||
if Homebrew::EnvConfig.verify_attestations? && formula.tap&.core_tap? && formula.name != "gh"
|
if Homebrew::Attestation.enabled? && formula.tap&.core_tap? && formula.name != "gh"
|
||||||
ohai "Verifying attestation for #{formula.name}"
|
ohai "Verifying attestation for #{formula.name}"
|
||||||
begin
|
begin
|
||||||
Homebrew::Attestation.check_core_attestation formula.bottle
|
Homebrew::Attestation.check_core_attestation formula.bottle
|
||||||
|
Loading…
x
Reference in New Issue
Block a user