Files
clean-architecture-frontend…/scripts/verify-supply-chain-artifacts.ts
T

25 lines
790 B
TypeScript

import { mkdir } from "node:fs/promises";
import {
supplyChainCoherenceReportSchema,
verifyLocalSupplyChainEvidence,
} from "./lib/local-release-evidence.ts";
import { writeValidatedJsonArtifact } from "./lib/validated-json-artifact.ts";
const report = await verifyLocalSupplyChainEvidence();
await mkdir("artifacts/security", { recursive: true });
await writeValidatedJsonArtifact({
path: "artifacts/security/supply-chain-coherence.json",
schema: supplyChainCoherenceReportSchema,
value: report,
});
if (report.status !== "PASS") {
process.stderr.write(
`Supply-chain artifact coherence failed:\n- ${report.failures.join("\n- ")}\n`,
);
process.exit(1);
}
process.stdout.write(
`Supply-chain artifact coherence: PASS (${report.dependencyCount} dependencies)\n`,
);