mirror of
https://github.com/github/codeql-action.git
synced 2026-05-21 21:08:32 +00:00
Add some extra validation for runs.using
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user