Replace string with CommandCacheKey for better type safety

This commit is contained in:
Mario Campos
2026-06-19 14:47:05 -05:00
parent 420c97eadd
commit dd7ff30205
4 changed files with 40 additions and 24 deletions

10
lib/entry-points.js generated
View File

@@ -149867,6 +149867,10 @@ var toolrunner3 = __toESM(require_toolrunner());
var fs6 = __toESM(require("fs"));
var path6 = __toESM(require("path"));
var COMMAND_CACHE_FILENAME = "codeql-action-command-cache.json";
var CommandCacheKey = {
Version: "version",
ResolveLanguages: "resolveLanguages"
};
var inMemoryCache = /* @__PURE__ */ new Map();
function getCommandCacheFilePath() {
return path6.join(getTemporaryDirectory(), COMMAND_CACHE_FILENAME);
@@ -153769,7 +153773,7 @@ async function getCodeQLForCmd(cmd, checkVersion) {
},
async getVersion() {
return getCachedOrRun(
"version" /* Version */,
CommandCacheKey.Version,
cmd,
() => runCliJson(cmd, ["version", "--format=json"], {
noStreamStdout: true
@@ -153931,7 +153935,7 @@ async function getCodeQLForCmd(cmd, checkVersion) {
},
async resolveLanguages() {
return getCachedOrRun(
"resolveLanguages" /* ResolveLanguages */,
CommandCacheKey.ResolveLanguages,
cmd,
async () => {
const isFilterToLanguagesWithQueriesSupported = await this.supportsFeature(
@@ -155212,7 +155216,7 @@ async function createStatusReportBase(actionName, status, actionStartedAt, confi
}
const runnerOs = getRequiredEnvParam("RUNNER_OS");
const codeQlCliVersion = getCachedCommandOutput(
"version" /* Version */,
CommandCacheKey.Version,
void 0,
isVersionInfo
);