mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-22 20:29:18 +01:00
fix(ci): accept exact Node 24 security image pins
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
d97ef47a81
commit
349836dc57
3 files changed
+24
-1
No files matched your search
@@ -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]}`);
|
||||
|
||||
Reference in new issue
Block a user