Refactor getCodeQLActionRepository out of setup-codeql

This commit is contained in:
Michael B. Gale
2026-10-06 13:45:35 +01:00
parent dedc55ad0e
commit 1a9bda9528
5 changed files with 66 additions and 44 deletions

22
lib/entry-points.js generated
View File

@@ -175774,6 +175774,18 @@ function logPerLanguageBundleFallback({ logger: logger2 }, language, location) {
);
}
// src/setup/repository.ts
var CODEQL_DEFAULT_ACTION_REPOSITORY = "github/codeql-action";
function getCodeQLActionRepository(logger2) {
if (isRunningLocalAction()) {
logger2.info(
"The CodeQL Action is checked out locally. Using the default CodeQL Action repository."
);
return CODEQL_DEFAULT_ACTION_REPOSITORY;
}
return getRequiredEnvParam("GITHUB_ACTION_REPOSITORY");
}
// src/tar.ts
var import_child_process = require("child_process");
var fs12 = __toESM(require("fs"));
@@ -176165,21 +176177,11 @@ function writeToolcacheMarkerFile(extractedPath, logger2) {
}
// src/setup-codeql.ts
var CODEQL_DEFAULT_ACTION_REPOSITORY = "github/codeql-action";
var CODEQL_NIGHTLIES_REPOSITORY_OWNER = "dsp-testing";
var CODEQL_NIGHTLIES_REPOSITORY_NAME = "codeql-cli-nightlies";
var CODEQL_BUNDLE_VERSION_ALIAS = ["linked", "latest"];
var CODEQL_NIGHTLY_TOOLS_INPUTS = ["nightly", "nightly-latest"];
var CODEQL_TOOLCACHE_INPUT = "toolcache";
function getCodeQLActionRepository(logger2) {
if (isRunningLocalAction()) {
logger2.info(
"The CodeQL Action is checked out locally. Using the default CodeQL Action repository."
);
return CODEQL_DEFAULT_ACTION_REPOSITORY;
}
return getRequiredEnvParam("GITHUB_ACTION_REPOSITORY");
}
async function getCodeQLBundleDownloadURL(tagName, apiDetails, codeQLBundleName, logger2) {
const codeQLActionRepository = getCodeQLActionRepository(logger2);
const potentialDownloadSources = [