Add some extra validation for runs.using

This commit is contained in:
Michael B. Gale
2026-05-21 00:00:51 +01:00
parent bee9891358
commit eeaa56bdbb
+7 -1
View File
@@ -53,12 +53,18 @@ const checkNodeVersionsPlugin = {
// Find the `runs.using` value in the specification.
const using = specification.runs.using;
if (using === undefined) {
if (using === undefined || using === null) {
throw new Error(
`Couldn't find 'runs.using' in ${actionSpecification}`,
);
}
if (typeof using !== "string" || !using.startsWith("node")) {
throw new Error(
`Expected 'runs.using' to be a string starting with 'node' in ${actionSpecification}`,
);
}
if (nodeVersion === undefined) {
// First one we found: set it as the baseline.
nodeVersion = using;