Build package with updated changes
Co-authored-by: bdehamer <398027+bdehamer@users.noreply.github.com>
This commit is contained in:
+12
-3
@@ -120950,7 +120950,6 @@ const predicateFromInputs = async (inputs) => {
|
||||
catch {
|
||||
throw new Error(`predicate file not found: ${predicatePath}`);
|
||||
}
|
||||
/* istanbul ignore next */
|
||||
const stat = await promises_default().stat(predicatePath);
|
||||
/* istanbul ignore next */
|
||||
if (stat.size > MAX_PREDICATE_SIZE_BYTES) {
|
||||
@@ -120978,11 +120977,21 @@ const generateProvenancePredicate = async () => {
|
||||
// SBOMs cannot exceed 16MB.
|
||||
const MAX_SBOM_SIZE_BYTES = 16 * 1024 * 1024;
|
||||
const parseSBOMFromPath = async (filePath) => {
|
||||
const fileContent = await promises_default().readFile(filePath, 'utf8');
|
||||
const stats = await promises_default().stat(filePath);
|
||||
let stats;
|
||||
try {
|
||||
stats = await promises_default().stat(filePath);
|
||||
}
|
||||
catch (error) {
|
||||
const err = error;
|
||||
if (err.code === 'ENOENT') {
|
||||
throw new Error('SBOM file not found');
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
if (stats.size > MAX_SBOM_SIZE_BYTES) {
|
||||
throw new Error(`SBOM file exceeds maximum allowed size: ${MAX_SBOM_SIZE_BYTES} bytes`);
|
||||
}
|
||||
const fileContent = await promises_default().readFile(filePath, 'utf8');
|
||||
const sbom = JSON.parse(fileContent);
|
||||
if (checkIsSPDX(sbom)) {
|
||||
return { type: 'spdx', object: sbom };
|
||||
|
||||
Reference in New Issue
Block a user