Skip to content

Commit 4fa3e8b

Browse files
committed
Gate the new registries input behind version constraints
1 parent 376fea6 commit 4fa3e8b

File tree

6 files changed

+17
-3
lines changed

6 files changed

+17
-3
lines changed

lib/codeql.js

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/codeql.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/config-utils.js

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/config-utils.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/codeql.ts

+1
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ export const CODEQL_VERSION_ML_POWERED_QUERIES = "2.7.5";
255255
const CODEQL_VERSION_LUA_TRACER_CONFIG = "2.10.0";
256256
export const CODEQL_VERSION_CONFIG_FILES = "2.10.1";
257257
const CODEQL_VERSION_LUA_TRACING_GO_WINDOWS_FIXED = "2.10.4";
258+
export const CODEQL_VERSION_GHES_PACK_DOWNLOAD = "2.10.5";
258259

259260
/**
260261
* This variable controls using the new style of tracing from the CodeQL

src/config-utils.ts

+9
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import * as semver from "semver";
99
import * as api from "./api-client";
1010
import {
1111
CodeQL,
12+
CODEQL_VERSION_GHES_PACK_DOWNLOAD,
1213
CODEQL_VERSION_ML_POWERED_QUERIES,
1314
CODEQL_VERSION_ML_POWERED_QUERIES_WINDOWS,
1415
ResolveQueriesOutput,
@@ -1842,6 +1843,14 @@ export async function downloadPacks(
18421843
let qlconfigFile: string | undefined;
18431844
let registriesAuthTokens: string | undefined;
18441845
if (registries) {
1846+
if (
1847+
!(await codeQlVersionAbove(codeQL, CODEQL_VERSION_GHES_PACK_DOWNLOAD))
1848+
) {
1849+
throw new Error(
1850+
`'registries' input is not supported on CodeQL versions less than ${CODEQL_VERSION_GHES_PACK_DOWNLOAD}.`
1851+
);
1852+
}
1853+
18451854
// generate a qlconfig.yml file to hold the registry configs.
18461855
const qlconfig = createRegistriesBlock(registries);
18471856
qlconfigFile = path.join(tmpDir, "qlconfig.yml");

0 commit comments

Comments
 (0)