fix: allow not validating SBOM
This commit is contained in:
parent
9e2ff327eb
commit
9d75d09a82
@ -121,12 +121,12 @@ class SBOM
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { params(bottling: T::Boolean).returns(T::Boolean) }
|
sig { params(bottling: T::Boolean).returns(T.nilable(T::Boolean)) }
|
||||||
def valid?(bottling: false)
|
def valid?(bottling: false)
|
||||||
unless require? "json_schemer"
|
unless require? "json_schemer"
|
||||||
error_message = "Need json_schemer to validate SBOM, run `brew install-bundler-gems --add-groups=bottle`!"
|
error_message = "Need json_schemer to validate SBOM, run `brew install-bundler-gems --add-groups=bottle`!"
|
||||||
odie error_message if ENV["HOMEBREW_ENFORCE_SBOM"]
|
odie error_message if ENV["HOMEBREW_ENFORCE_SBOM"]
|
||||||
return false
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
schema = SBOM.fetch_schema!
|
schema = SBOM.fetch_schema!
|
||||||
@ -156,7 +156,8 @@ class SBOM
|
|||||||
# will no longer be valid.
|
# will no longer be valid.
|
||||||
Formula.clear_cache unless spdxfile.exist?
|
Formula.clear_cache unless spdxfile.exist?
|
||||||
|
|
||||||
if validate && !valid?(bottling:)
|
valid = valid?(bottling:)
|
||||||
|
if validate && valid.present? && !valid
|
||||||
opoo "SBOM is not valid, not writing to disk!"
|
opoo "SBOM is not valid, not writing to disk!"
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user