Send the external repository token to the CLI

This commit does a few related things:

1. Bumps the minimum version for cli config parsing to 2.10.6
2. Ensures that if cli config parsing is enabled, then remove repos
   are _not_ downloaded by the action. It happens in the CLI.
3. Passes the `--external-repository-token-stdin` option to the CLI
   and passes the appropriate token via stdin if cli config parsing is
   enabled.
This commit is contained in:
Andrew Eisenberg
2023-01-05 17:34:59 -08:00
parent cf1437a514
commit 4023575d64
14 changed files with 102 additions and 72 deletions

View File

@@ -15,7 +15,7 @@ import { GitHubApiDetails } from "./api-client";
import * as codeql from "./codeql";
import { AugmentationProperties, Config } from "./config-utils";
import * as defaults from "./defaults.json";
import { Feature } from "./feature-flags";
import { Feature, featureConfig } from "./feature-flags";
import { Language } from "./languages";
import { getRunnerLogger } from "./logging";
import { setupTests, setupActionsVars, createFeatures } from "./testing-utils";
@@ -513,7 +513,7 @@ const injectedConfigMacro = test.macro({
const codeqlObject = await codeql.getCodeQLForTesting();
sinon
.stub(codeqlObject, "getVersion")
.resolves(codeql.CODEQL_VERSION_CONFIG_FILES);
.resolves(featureConfig[Feature.CliConfigFileEnabled].minimumVersion);
const thisStubConfig: Config = {
...stubConfig,
@@ -570,7 +570,7 @@ test(
},
{},
{
packs: ["codeql/javascript-experimental-atm-queries@~0.3.0"],
packs: ["codeql/javascript-experimental-atm-queries@~0.4.0"],
}
);
@@ -591,7 +591,7 @@ test(
packs: {
javascript: [
"codeql/something-else",
"codeql/javascript-experimental-atm-queries@~0.3.0",
"codeql/javascript-experimental-atm-queries@~0.4.0",
],
},
}
@@ -613,7 +613,7 @@ test(
{
packs: {
cpp: ["codeql/something-else"],
javascript: ["codeql/javascript-experimental-atm-queries@~0.3.0"],
javascript: ["codeql/javascript-experimental-atm-queries@~0.4.0"],
},
}
);
@@ -694,7 +694,7 @@ test(
},
},
{
packs: ["xxx", "yyy", "codeql/javascript-experimental-atm-queries@~0.3.0"],
packs: ["xxx", "yyy", "codeql/javascript-experimental-atm-queries@~0.4.0"],
}
);
@@ -826,7 +826,7 @@ test("does not use injected config", async (t: ExecutionContext<unknown>) => {
const codeqlObject = await codeql.getCodeQLForTesting();
sinon
.stub(codeqlObject, "getVersion")
.resolves(codeql.CODEQL_VERSION_CONFIG_FILES);
.resolves(featureConfig[Feature.CliConfigFileEnabled].minimumVersion);
await codeqlObject.databaseInitCluster(
stubConfig,