Merge remote-tracking branch 'origin/main' into mbg/fs-abstraction

This commit is contained in:
Michael B. Gale
2026-10-12 11:30:28 +01:00
32 changed files with 248 additions and 313 deletions

209
lib/entry-points.js generated
View File

@@ -27216,8 +27216,8 @@ var require_gte = __commonJS({
"node_modules/semver/functions/gte.js"(exports2, module2) {
"use strict";
var compare3 = require_compare();
var gte8 = (a, b, loose) => compare3(a, b, loose) >= 0;
module2.exports = gte8;
var gte7 = (a, b, loose) => compare3(a, b, loose) >= 0;
module2.exports = gte7;
}
});
@@ -27238,7 +27238,7 @@ var require_cmp = __commonJS({
var eq = require_eq();
var neq = require_neq();
var gt = require_gt();
var gte8 = require_gte();
var gte7 = require_gte();
var lt2 = require_lt();
var lte2 = require_lte();
var cmp = (a, op, b, loose) => {
@@ -27268,7 +27268,7 @@ var require_cmp = __commonJS({
case ">":
return gt(a, b, loose);
case ">=":
return gte8(a, b, loose);
return gte7(a, b, loose);
case "<":
return lt2(a, b, loose);
case "<=":
@@ -28076,7 +28076,7 @@ var require_outside = __commonJS({
var gt = require_gt();
var lt2 = require_lt();
var lte2 = require_lte();
var gte8 = require_gte();
var gte7 = require_gte();
var outside = (version, range2, hilo, options) => {
version = new SemVer(version, options);
range2 = new Range2(range2, options);
@@ -28091,7 +28091,7 @@ var require_outside = __commonJS({
break;
case "<":
gtfn = lt2;
ltefn = gte8;
ltefn = gte7;
ltfn = gt;
comp = "<";
ecomp = "<=";
@@ -28406,7 +28406,7 @@ var require_semver2 = __commonJS({
var lt2 = require_lt();
var eq = require_eq();
var neq = require_neq();
var gte8 = require_gte();
var gte7 = require_gte();
var lte2 = require_lte();
var cmp = require_cmp();
var coerce3 = require_coerce();
@@ -28445,7 +28445,7 @@ var require_semver2 = __commonJS({
lt: lt2,
eq,
neq,
gte: gte8,
gte: gte7,
lte: lte2,
cmp,
coerce: coerce3,
@@ -31736,7 +31736,7 @@ var require_brace_expansion = __commonJS({
function lte2(i, y) {
return i <= y;
}
function gte8(i, y) {
function gte7(i, y) {
return i >= y;
}
function combine2(acc, base, pre, values, max, maxLength, dropEmpties, outBase) {
@@ -31769,7 +31769,7 @@ var require_brace_expansion = __commonJS({
var reverse = y < x;
if (reverse) {
incr *= -1;
test = gte8;
test = gte7;
}
var pad = n.some(isPadded2);
var length = 0;
@@ -33921,8 +33921,8 @@ var require_semver3 = __commonJS({
function neq(a, b, loose) {
return compare3(a, b, loose) !== 0;
}
exports2.gte = gte8;
function gte8(a, b, loose) {
exports2.gte = gte7;
function gte7(a, b, loose) {
return compare3(a, b, loose) >= 0;
}
exports2.lte = lte2;
@@ -33953,7 +33953,7 @@ var require_semver3 = __commonJS({
case ">":
return gt(a, b, loose);
case ">=":
return gte8(a, b, loose);
return gte7(a, b, loose);
case "<":
return lt2(a, b, loose);
case "<=":
@@ -34498,7 +34498,7 @@ var require_semver3 = __commonJS({
break;
case "<":
gtfn = lt2;
ltefn = gte8;
ltefn = gte7;
ltfn = gt;
comp = "<";
ecomp = "<=";
@@ -34719,7 +34719,7 @@ var require_cacheUtils = __commonJS({
var crypto3 = __importStar2(require("crypto"));
var fs33 = __importStar2(require("fs"));
var path30 = __importStar2(require("path"));
var semver12 = __importStar2(require_semver3());
var semver11 = __importStar2(require_semver3());
var util4 = __importStar2(require("util"));
var constants_1 = require_constants7();
var versionSalt = "1.0";
@@ -34812,7 +34812,7 @@ var require_cacheUtils = __commonJS({
function getCompressionMethod() {
return __awaiter2(this, void 0, void 0, function* () {
const versionOutput = yield getVersion("zstd", ["--quiet"]);
const version = semver12.clean(versionOutput);
const version = semver11.clean(versionOutput);
core29.debug(`zstd version: ${version}`);
if (versionOutput === "") {
return constants_1.CompressionMethod.Gzip;
@@ -106346,7 +106346,7 @@ var require_manifest = __commonJS({
exports2._findMatch = _findMatch;
exports2._getOsVersion = _getOsVersion;
exports2._readLinuxVersionFile = _readLinuxVersionFile;
var semver12 = __importStar2(require_semver2());
var semver11 = __importStar2(require_semver2());
var core_1 = require_core();
var os8 = require("os");
var cp = require("child_process");
@@ -106360,7 +106360,7 @@ var require_manifest = __commonJS({
for (const candidate of candidates) {
const version = candidate.version;
(0, core_1.debug)(`check ${version} satisfies ${versionSpec}`);
if (semver12.satisfies(version, versionSpec) && (!stable || candidate.stable === stable)) {
if (semver11.satisfies(version, versionSpec) && (!stable || candidate.stable === stable)) {
file = candidate.files.find((item) => {
(0, core_1.debug)(`${item.arch}===${archFilter} && ${item.platform}===${platFilter}`);
let chk = item.arch === archFilter && item.platform === platFilter;
@@ -106369,7 +106369,7 @@ var require_manifest = __commonJS({
if (osVersion === item.platform_version) {
chk = true;
} else {
chk = semver12.satisfies(osVersion, item.platform_version);
chk = semver11.satisfies(osVersion, item.platform_version);
}
}
return chk;
@@ -106629,7 +106629,7 @@ var require_tool_cache = __commonJS({
var os8 = __importStar2(require("os"));
var path30 = __importStar2(require("path"));
var httpm = __importStar2(require_lib());
var semver12 = __importStar2(require_semver2());
var semver11 = __importStar2(require_semver2());
var stream2 = __importStar2(require("stream"));
var util4 = __importStar2(require("util"));
var assert_1 = require("assert");
@@ -106902,7 +106902,7 @@ var require_tool_cache = __commonJS({
}
function cacheDir2(sourceDir, tool, version, arch2) {
return __awaiter2(this, void 0, void 0, function* () {
version = semver12.clean(version) || version;
version = semver11.clean(version) || version;
arch2 = arch2 || os8.arch();
core29.debug(`Caching tool ${tool} ${version} ${arch2}`);
core29.debug(`source dir: ${sourceDir}`);
@@ -106920,7 +106920,7 @@ var require_tool_cache = __commonJS({
}
function cacheFile(sourceFile, targetFile, tool, version, arch2) {
return __awaiter2(this, void 0, void 0, function* () {
version = semver12.clean(version) || version;
version = semver11.clean(version) || version;
arch2 = arch2 || os8.arch();
core29.debug(`Caching tool ${tool} ${version} ${arch2}`);
core29.debug(`source file: ${sourceFile}`);
@@ -106950,7 +106950,7 @@ var require_tool_cache = __commonJS({
}
let toolPath = "";
if (versionSpec) {
versionSpec = semver12.clean(versionSpec) || "";
versionSpec = semver11.clean(versionSpec) || "";
const cachePath = path30.join(_getCacheDirectory(), toolName, versionSpec, arch2);
core29.debug(`checking cache: ${cachePath}`);
if (fs33.existsSync(cachePath) && fs33.existsSync(`${cachePath}.complete`)) {
@@ -107030,7 +107030,7 @@ var require_tool_cache = __commonJS({
}
function _createToolPath(tool, version, arch2) {
return __awaiter2(this, void 0, void 0, function* () {
const folderPath = path30.join(_getCacheDirectory(), tool, semver12.clean(version) || version, arch2 || "");
const folderPath = path30.join(_getCacheDirectory(), tool, semver11.clean(version) || version, arch2 || "");
core29.debug(`destination ${folderPath}`);
const markerPath = `${folderPath}.complete`;
yield io9.rmRF(folderPath);
@@ -107040,15 +107040,15 @@ var require_tool_cache = __commonJS({
});
}
function _completeToolPath(tool, version, arch2) {
const folderPath = path30.join(_getCacheDirectory(), tool, semver12.clean(version) || version, arch2 || "");
const folderPath = path30.join(_getCacheDirectory(), tool, semver11.clean(version) || version, arch2 || "");
const markerPath = `${folderPath}.complete`;
fs33.writeFileSync(markerPath, "");
core29.debug("finished caching tool");
}
function isExplicitVersion(versionSpec) {
const c = semver12.clean(versionSpec) || "";
const c = semver11.clean(versionSpec) || "";
core29.debug(`isExplicit: ${c}`);
const valid4 = semver12.valid(c) != null;
const valid4 = semver11.valid(c) != null;
core29.debug(`explicit? ${valid4}`);
return valid4;
}
@@ -107056,14 +107056,14 @@ var require_tool_cache = __commonJS({
let version = "";
core29.debug(`evaluating ${versions.length} versions`);
versions = versions.sort((a, b) => {
if (semver12.gt(a, b)) {
if (semver11.gt(a, b)) {
return 1;
}
return -1;
});
for (let i = versions.length - 1; i >= 0; i--) {
const potential = versions[i];
const satisfied = semver12.satisfies(potential, versionSpec);
const satisfied = semver11.satisfies(potential, versionSpec);
if (satisfied) {
version = potential;
break;
@@ -113555,7 +113555,7 @@ var require_brace_expansion2 = __commonJS({
function lte2(i, y) {
return i <= y;
}
function gte8(i, y) {
function gte7(i, y) {
return i >= y;
}
function combine2(acc, pre, values, max, maxLength, dropEmpties) {
@@ -113587,7 +113587,7 @@ var require_brace_expansion2 = __commonJS({
var reverse = y < x;
if (reverse) {
incr *= -1;
test = gte8;
test = gte7;
}
var pad = n.some(isPadded2);
var length = 0;
@@ -170185,7 +170185,7 @@ function getDiffRangesJsonFilePath(env = getEnv()) {
return path2.join(getTemporaryDirectory(env), PR_DIFF_RANGE_JSON_FILENAME);
}
function getActionVersion() {
return "4.38.4";
return "4.39.0";
}
function getWorkflowEventName(env = getEnv()) {
return env.getRequired("GITHUB_EVENT_NAME" /* GITHUB_EVENT_NAME */);
@@ -171728,6 +171728,9 @@ async function sendUnhandledErrorStatusReport(actionName, actionStartedAt, error
}
// src/action-common.ts
function extendActionState(state, extra) {
return { ...state, ...extra };
}
async function runInActions(action) {
const startedAt = /* @__PURE__ */ new Date();
const logger2 = getActionsLogger();
@@ -171764,7 +171767,7 @@ async function runInActions(action) {
// src/feature-flags.ts
var fs7 = __toESM(require("fs"));
var path6 = __toESM(require("path"));
var semver4 = __toESM(require_semver2());
var semver3 = __toESM(require_semver2());
// src/defaults.json
var bundleVersion = "codeql-bundle-v2.27.2";
@@ -171884,14 +171887,9 @@ async function getDiffRangeFilePaths(sourceRoot, logger2) {
}
// src/tools-features.ts
var semver3 = __toESM(require_semver2());
function isSupportedToolsFeature(versionInfo, feature) {
return !!versionInfo.features && versionInfo.features[feature];
}
var SafeArtifactUploadVersion = "2.20.3";
function isSafeArtifactUpload(codeQlVersion) {
return !codeQlVersion ? true : semver3.gte(codeQlVersion, SafeArtifactUploadVersion);
}
// src/feature-flags.ts
var DEFAULT_VERSION_FEATURE_FLAG_PREFIX = "default_codeql_version_";
@@ -171931,7 +171929,7 @@ var featureConfig = {
defaultValue: false,
envVar: "CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES",
legacyApi: true,
minimumVersion: "2.15.0"
minimumVersion: void 0
},
["csharp_cache_bmn" /* CsharpCacheBuildModeNone */]: {
defaultValue: false,
@@ -172342,7 +172340,7 @@ var GitHubFeatureFlags = class {
DEFAULT_VERSION_FEATURE_FLAG_PREFIX.length,
f.length - DEFAULT_VERSION_FEATURE_FLAG_SUFFIX.length
).replace(/_/g, ".");
if (!semver4.valid(version)) {
if (!semver3.valid(version)) {
this.logger.warning(
`Ignoring feature flag ${f} as it does not specify a valid CodeQL version.`
);
@@ -172359,7 +172357,7 @@ var GitHubFeatureFlags = class {
const response = await this.getAllFeatures();
const sortedCliVersions = Object.entries(response).map(
([f, isEnabled]) => isEnabled ? this.getCliVersionFromFeatureFlag(f) : void 0
).filter((f) => f !== void 0).sort(semver4.rcompare);
).filter((f) => f !== void 0).sort(semver3.rcompare);
if (sortedCliVersions.length === 0) {
this.logger.warning(
`Feature flags do not specify a default CLI version. Falling back to the CLI version shipped with the Action. This is ${cliVersion}.`
@@ -172966,7 +172964,7 @@ function getDependencyCachingEnabled() {
// src/config/db-config.ts
var path8 = __toESM(require("path"));
var jsonschema = __toESM(require_lib2());
var semver5 = __toESM(require_semver2());
var semver4 = __toESM(require_semver2());
// src/diagnostics.ts
var import_fs = require("fs");
@@ -173381,7 +173379,7 @@ function parsePacksSpecification(packStr) {
}
if (version) {
try {
new semver5.Range(version);
new semver4.Range(version);
} catch {
throw new ConfigurationError(getPacksStrInvalid(packStr));
}
@@ -175235,7 +175233,7 @@ var path13 = __toESM(require("path"));
var import_perf_hooks4 = require("perf_hooks");
var toolcache3 = __toESM(require_tool_cache());
var import_fast_deep_equal = __toESM(require_fast_deep_equal());
var semver10 = __toESM(require_semver2());
var semver9 = __toESM(require_semver2());
// src/codeql-bundle.ts
function getCodeQLBundleName(compressionMethod, platform2, language) {
@@ -175269,7 +175267,7 @@ function getCodeQLBundleFromUrl(url2) {
// src/overlay/caching.ts
var fs12 = __toESM(require("fs"));
var actionsCache3 = __toESM(require_cache4());
var semver6 = __toESM(require_semver2());
var semver5 = __toESM(require_semver2());
var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB = 7500;
var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_BYTES = OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB * 1e6;
var CACHE_VERSION2 = 1;
@@ -175546,7 +175544,7 @@ async function getCodeQlVersionsForOverlayBaseDatabases(rawLanguages, logger2) {
if (!cache.key) continue;
const suffix = cache.key.substring(cacheKeyPrefix.length);
const match2 = suffix.match(versionRegex);
if (match2 && semver6.valid(match2[1])) {
if (match2 && semver5.valid(match2[1])) {
versionSet.add(match2[1]);
}
}
@@ -175556,7 +175554,7 @@ async function getCodeQlVersionsForOverlayBaseDatabases(rawLanguages, logger2) {
);
return [];
}
const versions = [...versionSet].sort(semver6.rcompare);
const versions = [...versionSet].sort(semver5.rcompare);
logger2.info(
`Found overlay databases for the following CodeQL versions in the Actions cache: ${versions.join(", ")}`
);
@@ -175564,7 +175562,7 @@ async function getCodeQlVersionsForOverlayBaseDatabases(rawLanguages, logger2) {
}
// src/per-language-bundles.ts
var semver7 = __toESM(require_semver2());
var semver6 = __toESM(require_semver2());
// src/platform.ts
function getBundlePlatform(platform2 = process.platform, arch2 = process.arch) {
@@ -175671,7 +175669,7 @@ async function getPerLanguageBundleLanguage({
if (cliVersion2 === void 0) {
return explain("the requested CLI version is unknown");
}
if (!semver7.gte(cliVersion2, MIN_PER_LANGUAGE_BUNDLE_CLI_VERSION)) {
if (!semver6.gte(cliVersion2, MIN_PER_LANGUAGE_BUNDLE_CLI_VERSION)) {
return explain(
`the requested CodeQL version ${cliVersion2} is older than ${MIN_PER_LANGUAGE_BUNDLE_CLI_VERSION}, which is the first version for which per-language bundles are published`
);
@@ -175697,7 +175695,7 @@ var stream = __toESM(require("stream"));
var import_toolrunner = __toESM(require_toolrunner());
var io4 = __toESM(require_io());
var toolcache = __toESM(require_tool_cache());
var semver8 = __toESM(require_semver2());
var semver7 = __toESM(require_semver2());
var MIN_REQUIRED_BSD_TAR_VERSION = "3.4.3";
var MIN_REQUIRED_GNU_TAR_VERSION = "1.31";
async function getTarVersion() {
@@ -175739,9 +175737,9 @@ async function isZstdAvailable(logger2) {
case "gnu":
return {
available: foundZstdBinary && // GNU tar only uses major and minor version numbers
semver8.gte(
semver8.coerce(version),
semver8.coerce(MIN_REQUIRED_GNU_TAR_VERSION)
semver7.gte(
semver7.coerce(version),
semver7.coerce(MIN_REQUIRED_GNU_TAR_VERSION)
),
foundZstdBinary,
version: tarVersion
@@ -175750,7 +175748,7 @@ async function isZstdAvailable(logger2) {
return {
available: foundZstdBinary && // Do a loose comparison since these version numbers don't contain
// a patch version number.
semver8.gte(version, MIN_REQUIRED_BSD_TAR_VERSION),
semver7.gte(version, MIN_REQUIRED_BSD_TAR_VERSION),
foundZstdBinary,
version: tarVersion
};
@@ -175859,7 +175857,7 @@ var core11 = __toESM(require_core());
var import_http_client = __toESM(require_lib());
var toolcache2 = __toESM(require_tool_cache());
var import_follow_redirects = __toESM(require_follow_redirects());
var semver9 = __toESM(require_semver2());
var semver8 = __toESM(require_semver2());
var STREAMING_HIGH_WATERMARK_BYTES = 4 * 1024 * 1024;
var STREAMING_STALL_TIMEOUT_MS = 5 * 60 * 1e3;
var TOOLCACHE_TOOL_NAME = "CodeQL";
@@ -175985,7 +175983,7 @@ function getToolcacheToolDirectory(env) {
);
}
function getToolcacheVersionDirectoryName(version) {
return semver9.clean(version) || version;
return semver8.clean(version) || version;
}
function getToolcacheDirectory(version) {
return path12.join(
@@ -176165,13 +176163,13 @@ function tryGetTagNameFromUrl(url2, logger2) {
return match2[1];
}
function convertToSemVer(version, logger2) {
if (!semver10.valid(version)) {
if (!semver9.valid(version)) {
logger2.debug(
`Bundle version ${version} is not in SemVer format. Will treat it as pre-release 0.0.0-${version}.`
);
version = `0.0.0-${version}`;
}
const s = semver10.clean(version);
const s = semver9.clean(version);
if (!s) {
throw new Error(`Bundle version ${version} is not in SemVer format.`);
}
@@ -176387,7 +176385,7 @@ async function getCodeQLSource(toolsInput, defaultCliVersion, rawLanguages, othe
url2 = toolsInput;
if (tagName) {
const bundleVersion3 = tryGetBundleVersionFromTagName(tagName, logger2);
if (bundleVersion3 !== void 0 && semver10.valid(bundleVersion3)) {
if (bundleVersion3 !== void 0 && semver9.valid(bundleVersion3)) {
cliVersion2 = convertToSemVer(bundleVersion3, logger2);
}
}
@@ -176769,7 +176767,7 @@ async function downloadCodeQLBundle(action, source, apiDetails, tarVersion, temp
async function useZstdBundle(cliVersion2, tarSupportsZstd) {
return (
// In testing, gzip performs better than zstd on Windows.
process.platform !== "win32" && tarSupportsZstd && semver10.gte(cliVersion2, CODEQL_VERSION_ZSTD_BUNDLE)
process.platform !== "win32" && tarSupportsZstd && semver9.gte(cliVersion2, CODEQL_VERSION_ZSTD_BUNDLE)
);
}
function getTempExtractionDir(tempDir) {
@@ -176823,7 +176821,7 @@ async function getLatestNightlyBundle(action, rawLanguages, otherLanguagePacksRe
}
}
function getLatestToolcacheVersion(logger2) {
const allVersions = toolcache3.findAllVersions("CodeQL").sort((a, b) => semver10.compare(b, a));
const allVersions = toolcache3.findAllVersions("CodeQL").sort((a, b) => semver9.compare(b, a));
logger2.debug(
`Found the following versions of the CodeQL tools in the toolcache: ${JSON.stringify(
allVersions
@@ -176911,7 +176909,7 @@ async function getCombinedTracerConfig(logger2, codeql, config) {
// src/codeql.ts
var cachedCodeQL = void 0;
var CODEQL_MINIMUM_VERSION = "2.19.4";
var CODEQL_MINIMUM_VERSION = "2.20.7";
var CODEQL_NEXT_MINIMUM_VERSION = "2.21.3";
var GHES_VERSION_MOST_RECENTLY_DEPRECATED = "3.17";
var GHES_MOST_RECENT_DEPRECATION_DATE = "2026-09-24";
@@ -177558,7 +177556,7 @@ async function determineAutobuildLanguages(codeql, config, logger2) {
}
return languages;
}
async function setupCppAutobuild(codeql, logger2) {
async function setupCppAutobuild(logger2) {
const envVar = featureConfig["cpp_dependency_installation_enabled" /* CppDependencyInstallation */].envVar;
const featureName = "C++ automatic installation of dependencies";
const gitHubVersion = await getGitHubVersion();
@@ -177569,7 +177567,7 @@ async function setupCppAutobuild(codeql, logger2) {
getTemporaryDirectory(),
logger2
);
if (await features.getValue("cpp_dependency_installation_enabled" /* CppDependencyInstallation */, codeql)) {
if (await features.getValue("cpp_dependency_installation_enabled" /* CppDependencyInstallation */)) {
if (process.env["RUNNER_ENVIRONMENT" /* RUNNER_ENVIRONMENT */] === "self-hosted" && process.env[envVar] !== "true") {
logger2.info(
`Disabling ${featureName} as we are on a self-hosted runner.${getWorkflowEventName() !== "dynamic" ? ` To override this, set the ${envVar} environment variable to 'true' in your workflow. See ${"https://docs.github.com/en/actions/learn-github-actions/variables#defining-environment-variables-for-a-single-workflow" /* DEFINE_ENV_VARIABLES */} for more information.` : ""}`
@@ -177590,7 +177588,7 @@ async function runAutobuild(config, language, logger2) {
logger2.startGroup(`Attempting to automatically build ${language} code`);
const codeQL = await getCodeQL(logger2, config.codeQLCmd);
if (language === "cpp" /* cpp */) {
await setupCppAutobuild(codeQL, logger2);
await setupCppAutobuild(logger2);
}
if (config.buildMode) {
await codeQL.extractUsingBuildMode(config, language);
@@ -177914,7 +177912,7 @@ async function runExtraction(codeql, features, config, logger2) {
}
if (config.buildMode) {
if (language === "cpp" /* cpp */ && config.buildMode === "autobuild" /* Autobuild */) {
await setupCppAutobuild(codeql, logger2);
await setupCppAutobuild(logger2);
}
if (language === "java" /* java */ && config.buildMode === "none" /* None */) {
process.env["CODEQL_EXTRACTOR_JAVA_OPTION_BUILDLESS_DEPENDENCY_DIR"] = getJavaTempDependencyDir();
@@ -180674,11 +180672,6 @@ async function run({
"`expect-error` input parameter is for internal use only. It should only be set by codeql-action or a fork."
);
}
if (process.env.CODEQL_PROXY_HOST === "" && !await codeQlVersionAtLeast(codeql, "2.20.7")) {
delete process.env.CODEQL_PROXY_HOST;
delete process.env.CODEQL_PROXY_PORT;
delete process.env.CODEQL_PROXY_CA_CERTIFICATE;
}
if (getOptionalInput("cleanup-level")) {
logger2.info(
"The 'cleanup-level' input is ignored since the CodeQL Action now automatically manages database cleanup. This input can safely be removed from your workflow."
@@ -181047,7 +181040,7 @@ function isPadded(el) {
function lte(i, y) {
return i <= y;
}
function gte7(i, y) {
function gte6(i, y) {
return i >= y;
}
function combine(acc, pre, values, max, maxLength, dropEmpties) {
@@ -181082,7 +181075,7 @@ function expandSequence(body, isAlphaSequence, max, maxLength) {
const reverse = y < x;
if (reverse) {
incr *= -1;
test = gte7;
test = gte6;
}
const pad = n.some(isPadded);
let length = 0;
@@ -185543,7 +185536,7 @@ async function scanArtifactsForTokens(filesToScan, logger2) {
function sanitizeArtifactName(name) {
return name.replace(/[^a-zA-Z0-9_-]+/g, "");
}
async function uploadCombinedSarifArtifacts(logger2, gitHubVariant, codeQlVersion) {
async function uploadCombinedSarifArtifacts(logger2, gitHubVariant) {
const tempDir = getTemporaryDirectory();
if (process.env["CODEQL_ACTION_DEBUG_COMBINED_SARIF"] === "true") {
await withGroup("Uploading combined SARIF debug artifact", async () => {
@@ -185562,13 +185555,12 @@ async function uploadCombinedSarifArtifacts(logger2, gitHubVariant, codeQlVersio
}
}
try {
await uploadDebugArtifacts(
await uploadArtifacts(
logger2,
toUpload,
baseTempDir,
"combined-sarif-artifacts",
gitHubVariant,
codeQlVersion
gitHubVariant
);
} catch (e) {
logger2.warning(
@@ -185627,7 +185619,7 @@ async function tryBundleDatabase(codeql, config, language, logger2) {
return void 0;
}
}
async function tryUploadAllAvailableDebugArtifacts(codeql, config, logger2, codeQlVersion) {
async function tryUploadAllAvailableDebugArtifacts(codeql, config, logger2) {
const filesToUpload = [];
try {
for (const language of config.languages) {
@@ -185680,13 +185672,12 @@ async function tryUploadAllAvailableDebugArtifacts(codeql, config, logger2, code
try {
await withGroup(
"Uploading debug artifacts",
async () => uploadDebugArtifacts(
async () => uploadArtifacts(
logger2,
filesToUpload,
config.dbLocation,
config.debugArtifactName,
config.gitHubVersion.type,
codeQlVersion
config.gitHubVersion.type
)
);
} catch (e) {
@@ -185714,16 +185705,6 @@ function getArtifactSuffix(matrix) {
}
return suffix;
}
async function uploadDebugArtifacts(logger2, toUpload, rootDir, artifactName, ghVariant, codeQlVersion) {
const uploadSupported = isSafeArtifactUpload(codeQlVersion);
if (!uploadSupported) {
core15.info(
`Skipping debug artifact upload because the current CLI does not support safe upload. Please upgrade to CLI v${SafeArtifactUploadVersion} or later.`
);
return "upload-not-supported";
}
return uploadArtifacts(logger2, toUpload, rootDir, artifactName, ghVariant);
}
async function uploadArtifacts(logger2, toUpload, rootDir, artifactName, ghVariant) {
if (toUpload.length === 0) {
return "no-artifacts-to-upload";
@@ -185814,12 +185795,9 @@ async function runWrapper2() {
logger2
);
if (config !== void 0) {
const codeql = await getCodeQL(logger2, config.codeQLCmd);
const version = await codeql.getVersion();
await uploadCombinedSarifArtifacts(
logger2,
config.gitHubVersion.type,
version.version
config.gitHubVersion.type
);
}
}
@@ -185945,7 +185923,7 @@ var fs30 = __toESM(require("fs"));
var path25 = __toESM(require("path"));
var core19 = __toESM(require_core());
var io7 = __toESM(require_io());
var semver11 = __toESM(require_semver2());
var semver10 = __toESM(require_semver2());
// src/config/inputs.ts
async function getToolsInput(action, repositoryProperties) {
@@ -186388,7 +186366,9 @@ async function run3(actionState) {
`Failed to parse analysis kinds for 'starting' status report: ${getErrorMessage(err)}`
);
}
const actionStateWithFeatures = { ...actionState, features };
const actionStateWithFeatures = extendActionState(actionState, {
features
});
configFile = await getConfigFileInput(
actionStateWithFeatures,
repositoryProperties,
@@ -186446,15 +186426,9 @@ async function run3(actionState) {
// requested rust - don't enable it via language autodetection.
getRawLanguagesNoAutodetect(getOptionalInput("languages")).includes("rust" /* rust */)
) {
const experimental = "2.19.3";
const publicPreview = "2.22.1";
const actualVer = (await codeql.getVersion()).version;
if (semver11.lt(actualVer, experimental)) {
throw new ConfigurationError(
`Rust analysis is supported by CodeQL CLI version ${experimental} or higher, but found version ${actualVer}`
);
}
if (semver11.lt(actualVer, publicPreview)) {
if (semver10.lt(actualVer, publicPreview)) {
actionState.env.export("CODEQL_ENABLE_EXPERIMENTAL_FEATURES" /* EXPERIMENTAL_FEATURES */, "true");
logger2.info("Experimental Rust analysis enabled");
}
@@ -186654,10 +186628,6 @@ exec ${goBinaryPath} "$@"`
if (await features.getValue("force_jgit" /* ForceJGit */)) {
actionState.env.export("CODEQL_GIT_BACKEND", "jgit");
}
const kotlinLimitVar = "CODEQL_EXTRACTOR_KOTLIN_OVERRIDE_MAXIMUM_VERSION_LIMIT";
if (await codeQlVersionAtLeast(codeql, "2.20.3") && !await codeQlVersionAtLeast(codeql, "2.20.4")) {
actionState.env.export(kotlinLimitVar, "2.1.20");
}
if (shouldRestoreCache(config.dependencyCachingEnabled)) {
const dependencyCachingResult = await downloadDependencyCaches(
codeql,
@@ -186967,13 +186937,7 @@ async function uploadFailureInfo(uploadAllAvailableDebugArtifacts, printDebugLog
logger2.info(
"Debug mode is on. Uploading available database bundles and logs as Actions debugging artifacts..."
);
const version = await codeql.getVersion();
await uploadAllAvailableDebugArtifacts(
codeql,
config,
logger2,
version.version
);
await uploadAllAvailableDebugArtifacts(codeql, config, logger2);
await printDebugLogs2(config);
}
if (isSelfHostedRunner()) {
@@ -187410,7 +187374,9 @@ async function run6(actionState) {
logger2
);
const repositoryProperties = repositoryPropertiesResult.orElse({});
const actionStateWithFeatures = { ...actionState, features };
const actionStateWithFeatures = extendActionState(actionState, {
features
});
const statusReportBase = await createStatusReportBase(
"setup-codeql" /* SetupCodeQL */,
"starting",
@@ -188205,7 +188171,8 @@ async function run7(action) {
all_credentials: credentials,
ca
};
const proxyBin = await getProxyBinaryPath({ ...action, features });
const actionWithFeatures = extendActionState(action, { features });
const proxyBin = await getProxyBinaryPath(actionWithFeatures);
const proxyInfo = await startProxy(
proxyBin,
proxyConfig,
@@ -188444,13 +188411,7 @@ async function runWrapper11() {
}
await withGroup(
"Uploading combined SARIF debug artifact",
() => uploadCombinedSarifArtifacts(
logger2,
gitHubVersion.type,
// The codeqlVersion is not applicable for uploading non-codeql sarif.
// We can assume all versions are safe to upload.
void 0
)
() => uploadCombinedSarifArtifacts(logger2, gitHubVersion.type)
);
}
} catch (error3) {