fix(ci): accept exact Node 24 security image pins

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-09-28 17:53:48 -05:00
1 parent d97ef47a81
commit 349836dc57
3 files changed
+24 -1

No files matched your search

+2 -1
View File
@@ -1,6 +1,7 @@
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { isNode24ImageTag } from "./node-image-policy.mjs";
const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
const expectedEngine = ">=24.11.0";
@@ -48,7 +49,7 @@ walk(repoRoot, (filePath) => {
if (!path.basename(filePath).startsWith("Dockerfile")) return;
const source = fs.readFileSync(filePath, "utf8");
for (const match of source.matchAll(/^\s*FROM\s+node:([^\s]+)/gm)) {
if (!match[1].startsWith("24-")) failures.push(`${relative(filePath)}: Node base image must use the Node 24 major, found node:${match[1]}`);
if (!isNode24ImageTag(match[1])) failures.push(`${relative(filePath)}: Node base image must use the Node 24 major, found node:${match[1]}`);
}
for (const match of source.matchAll(/^\s*ARG\s+NODE_(?:MAJOR|VERSION)=([^\s]+)/gm)) {
if (match[1] !== "24") failures.push(`${relative(filePath)}: Node build argument must be 24, found ${match[1]}`);