tighten workshop artifact check

This commit is contained in:
ajnart committed 2026-07-28 22:51:11 +02:00
1 parent 98d56264da
commit 6ae109e8f5
1 file changed
+7 -2
+7 -2
View File
@@ -45,12 +45,17 @@ for (const removedValidator of [
"packages/workshop/src/pocketbase-validator.ts",
"scripts/build-workshop-validator.mjs",
]) {
let artifactExists = true;
try {
await access(resolve(removedValidator));
throw new Error(`Workshop validator artifact must stay removed: ${removedValidator}`);
} catch (error) {
if (error instanceof Error && error.message.startsWith("Workshop validator artifact")) throw error;
if (typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT") {
artifactExists = false;
} else {
throw error;
}
}
if (artifactExists) throw new Error(`Workshop validator artifact must stay removed: ${removedValidator}`);
}
if (!dockerfile.includes("WORKSHOP_REQUIRE_PUBLIC_ORIGIN=true")) {
throw new Error("The production Workshop image must require an explicit public origin");