Gate the new registries input behind version constraints

This commit is contained in:
Andrew Eisenberg
2022-09-07 14:36:38 -07:00
parent 376fea671d
commit 4fa3e8b483
6 changed files with 17 additions and 3 deletions

3
lib/config-utils.js generated
View File

@@ -1010,6 +1010,9 @@ async function downloadPacks(codeQL, languages, packs, registries, apiDetails, t
let qlconfigFile;
let registriesAuthTokens;
if (registries) {
if (!(await (0, util_1.codeQlVersionAbove)(codeQL, codeql_1.CODEQL_VERSION_GHES_PACK_DOWNLOAD))) {
throw new Error(`'registries' input is not supported on CodeQL versions less than ${codeql_1.CODEQL_VERSION_GHES_PACK_DOWNLOAD}.`);
}
// generate a qlconfig.yml file to hold the registry configs.
const qlconfig = createRegistriesBlock(registries);
qlconfigFile = path.join(tmpDir, "qlconfig.yml");