Pass environment explicitly to CLI caching functions

This commit is contained in:
Mario Campos
2026-08-12 11:24:37 -05:00
parent 40f80a8df0
commit 33d70867d5
5 changed files with 18 additions and 18 deletions

10
lib/entry-points.js generated
View File

@@ -146251,7 +146251,7 @@ var cachedCodeQlVersion = void 0;
function getCommandCacheFilePath(env) {
return import_path.default.join(getTemporaryDirectory(env), COMMAND_CACHE_FILENAME);
}
function cacheCodeQlVersion(cmd, version, env = getEnv()) {
function cacheCodeQlVersion(cmd, version, env) {
if (cachedCodeQlVersion !== void 0) {
throw new Error("cacheCodeQlVersion() should be called only once");
}
@@ -146262,7 +146262,7 @@ function cacheCodeQlVersion(cmd, version, env = getEnv()) {
"utf8"
);
}
function getCachedCodeQlVersion(cmd, env = getEnv()) {
function getCachedCodeQlVersion(env, cmd) {
if (cachedCodeQlVersion !== void 0) {
return cachedCodeQlVersion;
}
@@ -146834,7 +146834,7 @@ async function createStatusReportBase(actionName, status, actionStartedAt, confi
core7.exportVariable("CODEQL_WORKFLOW_STARTED_AT" /* WORKFLOW_STARTED_AT */, workflowStartedAt);
}
const runnerOs = getRequiredEnvParam("RUNNER_OS");
const codeQlCliVersion = getCachedCodeQlVersion();
const codeQlCliVersion = getCachedCodeQlVersion(getEnv());
const actionRef = process.env["GITHUB_ACTION_REF"] || "";
const testingEnvironment = getTestingEnvironment();
if (testingEnvironment) {
@@ -151870,7 +151870,7 @@ async function getCodeQLForCmd(cmd, checkVersion) {
return cmd;
},
async getVersion() {
let result = getCachedCodeQlVersion(cmd);
let result = getCachedCodeQlVersion(getEnv(), cmd);
if (result === void 0) {
result = await runCliJson(
cmd,
@@ -151879,7 +151879,7 @@ async function getCodeQLForCmd(cmd, checkVersion) {
noStreamStdout: true
}
);
cacheCodeQlVersion(cmd, result);
cacheCodeQlVersion(cmd, result, getEnv());
}
return result;
},