diff --git a/eslint.config.mjs b/eslint.config.mjs index 34fe49a9df..ae8f5fc971 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -140,6 +140,18 @@ export default [ "no-async-foreach/no-async-foreach": "error", "no-sequences": "error", "no-shadow": "off", + + // A basic check that we don't use `exportVariable` from `@actions/core`. This rule depends on + // the module being imported as `core`, but that is a good enough check for us. + "no-restricted-syntax": [ + "error", + { + selector: + "MemberExpression[object.name='core'][property.name='exportVariable']", + message: "Use `exportVariable` from `environment.ts` instead.", + }, + ], + // This is overly restrictive with unsetting `EnvVar`s "@typescript-eslint/no-dynamic-delete": "off", "@typescript-eslint/no-shadow": "error", @@ -157,6 +169,15 @@ export default [ ], }, }, + { + files: ["src/environment.ts"], + + // We allow `exportVariable` from `@actions/core` to be used in this file + // since it defines the wrapper around it that other modules use. + rules: { + "no-restricted-syntax": "off", + }, + }, { files: ["**/*.ts", "**/*.js"], diff --git a/lib/entry-points.js b/lib/entry-points.js index e8ae317031..b891edf025 100644 --- a/lib/entry-points.js +++ b/lib/entry-points.js @@ -21392,7 +21392,7 @@ var require_core = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.platform = exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = exports2.markdownSummary = exports2.summary = exports2.ExitCode = void 0; - exports2.exportVariable = exportVariable15; + exports2.exportVariable = exportVariable3; exports2.setSecret = setSecret2; exports2.addPath = addPath2; exports2.getInput = getInput2; @@ -21424,7 +21424,7 @@ var require_core = __commonJS({ ExitCode2[ExitCode2["Success"] = 0] = "Success"; ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; })(ExitCode || (exports2.ExitCode = ExitCode = {})); - function exportVariable15(name, val) { + function exportVariable3(name, val) { const convertedVal = (0, utils_1.toCommandValue)(val); process.env[name] = convertedVal; const filePath = process.env["GITHUB_ENV"] || ""; @@ -30620,7 +30620,7 @@ var require_internal_glob_options_helper = __commonJS({ })(); Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getOptions = getOptions; - var core31 = __importStar2(require_core()); + var core29 = __importStar2(require_core()); function getOptions(copy) { const result = { followSymbolicLinks: true, @@ -30632,23 +30632,23 @@ var require_internal_glob_options_helper = __commonJS({ if (copy) { if (typeof copy.followSymbolicLinks === "boolean") { result.followSymbolicLinks = copy.followSymbolicLinks; - core31.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); + core29.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); } if (typeof copy.implicitDescendants === "boolean") { result.implicitDescendants = copy.implicitDescendants; - core31.debug(`implicitDescendants '${result.implicitDescendants}'`); + core29.debug(`implicitDescendants '${result.implicitDescendants}'`); } if (typeof copy.matchDirectories === "boolean") { result.matchDirectories = copy.matchDirectories; - core31.debug(`matchDirectories '${result.matchDirectories}'`); + core29.debug(`matchDirectories '${result.matchDirectories}'`); } if (typeof copy.omitBrokenSymbolicLinks === "boolean") { result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; - core31.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + core29.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); } if (typeof copy.excludeHiddenFiles === "boolean") { result.excludeHiddenFiles = copy.excludeHiddenFiles; - core31.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); + core29.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); } } return result; @@ -32278,7 +32278,7 @@ var require_internal_globber = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.DefaultGlobber = void 0; - var core31 = __importStar2(require_core()); + var core29 = __importStar2(require_core()); var fs30 = __importStar2(require("fs")); var globOptionsHelper = __importStar2(require_internal_glob_options_helper()); var path28 = __importStar2(require("path")); @@ -32331,7 +32331,7 @@ var require_internal_globber = __commonJS({ } const stack = []; for (const searchPath of patternHelper.getSearchPaths(patterns)) { - core31.debug(`Search path '${searchPath}'`); + core29.debug(`Search path '${searchPath}'`); try { yield __await2(fs30.promises.lstat(searchPath)); } catch (err) { @@ -32406,7 +32406,7 @@ var require_internal_globber = __commonJS({ } catch (err) { if (err.code === "ENOENT") { if (options.omitBrokenSymbolicLinks) { - core31.debug(`Broken symlink '${item.path}'`); + core29.debug(`Broken symlink '${item.path}'`); return void 0; } throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`); @@ -32422,7 +32422,7 @@ var require_internal_globber = __commonJS({ traversalChain.pop(); } if (traversalChain.some((x) => x === realPath)) { - core31.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); + core29.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); return void 0; } traversalChain.push(realPath); @@ -32525,7 +32525,7 @@ var require_internal_hash_files = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.hashFiles = hashFiles2; var crypto3 = __importStar2(require("crypto")); - var core31 = __importStar2(require_core()); + var core29 = __importStar2(require_core()); var fs30 = __importStar2(require("fs")); var stream2 = __importStar2(require("stream")); var util = __importStar2(require("util")); @@ -32534,7 +32534,7 @@ var require_internal_hash_files = __commonJS({ return __awaiter2(this, arguments, void 0, function* (globber, currentWorkspace, verbose = false) { var _a, e_1, _b, _c; var _d; - const writeDelegate = verbose ? core31.info : core31.debug; + const writeDelegate = verbose ? core29.info : core29.debug; let hasMatch = false; const githubWorkspace = currentWorkspace ? currentWorkspace : (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); const result = crypto3.createHash("sha256"); @@ -33925,7 +33925,7 @@ var require_cacheUtils = __commonJS({ exports2.assertDefined = assertDefined; exports2.getCacheVersion = getCacheVersion; exports2.getRuntimeToken = getRuntimeToken; - var core31 = __importStar2(require_core()); + var core29 = __importStar2(require_core()); var exec3 = __importStar2(require_exec()); var glob2 = __importStar2(require_glob()); var io9 = __importStar2(require_io()); @@ -33976,7 +33976,7 @@ var require_cacheUtils = __commonJS({ _e = false; const file = _c; const relativeFile = path28.relative(workspace, file).replace(new RegExp(`\\${path28.sep}`, "g"), "/"); - core31.debug(`Matched: ${relativeFile}`); + core29.debug(`Matched: ${relativeFile}`); if (relativeFile === "") { paths.push("."); } else { @@ -34004,7 +34004,7 @@ var require_cacheUtils = __commonJS({ return __awaiter2(this, arguments, void 0, function* (app, additionalArgs = []) { let versionOutput = ""; additionalArgs.push("--version"); - core31.debug(`Checking ${app} ${additionalArgs.join(" ")}`); + core29.debug(`Checking ${app} ${additionalArgs.join(" ")}`); try { yield exec3.exec(`${app}`, additionalArgs, { ignoreReturnCode: true, @@ -34015,10 +34015,10 @@ var require_cacheUtils = __commonJS({ } }); } catch (err) { - core31.debug(err.message); + core29.debug(err.message); } versionOutput = versionOutput.trim(); - core31.debug(versionOutput); + core29.debug(versionOutput); return versionOutput; }); } @@ -34026,7 +34026,7 @@ var require_cacheUtils = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { const versionOutput = yield getVersion("zstd", ["--quiet"]); const version = semver11.clean(versionOutput); - core31.debug(`zstd version: ${version}`); + core29.debug(`zstd version: ${version}`); if (versionOutput === "") { return constants_1.CompressionMethod.Gzip; } else { @@ -74324,7 +74324,7 @@ var require_uploadUtils = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.UploadProgress = void 0; exports2.uploadCacheArchiveSDK = uploadCacheArchiveSDK; - var core31 = __importStar2(require_core()); + var core29 = __importStar2(require_core()); var storage_blob_1 = require_commonjs15(); var errors_1 = require_errors2(); var UploadProgress = class { @@ -74366,7 +74366,7 @@ var require_uploadUtils = __commonJS({ const percentage = (100 * (transferredBytes / this.contentLength)).toFixed(1); const elapsedTime = Date.now() - this.startTime; const uploadSpeed = (transferredBytes / (1024 * 1024) / (elapsedTime / 1e3)).toFixed(1); - core31.info(`Sent ${transferredBytes} of ${this.contentLength} (${percentage}%), ${uploadSpeed} MBs/sec`); + core29.info(`Sent ${transferredBytes} of ${this.contentLength} (${percentage}%), ${uploadSpeed} MBs/sec`); if (this.isDone()) { this.displayedComplete = true; } @@ -74423,14 +74423,14 @@ var require_uploadUtils = __commonJS({ }; try { uploadProgress.startDisplayTimer(); - core31.debug(`BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}`); + core29.debug(`BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}`); const response = yield blockBlobClient.uploadFile(archivePath, uploadOptions); if (response._response.status >= 400) { throw new errors_1.InvalidResponseError(`uploadCacheArchiveSDK: upload failed with status code ${response._response.status}`); } return response; } catch (error3) { - core31.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error3.message}`); + core29.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error3.message}`); throw error3; } finally { uploadProgress.stopDisplayTimer(); @@ -74515,7 +74515,7 @@ var require_requestUtils = __commonJS({ exports2.retry = retry2; exports2.retryTypedResponse = retryTypedResponse; exports2.retryHttpClientResponse = retryHttpClientResponse; - var core31 = __importStar2(require_core()); + var core29 = __importStar2(require_core()); var http_client_1 = require_lib(); var constants_1 = require_constants7(); function isSuccessStatusCode(statusCode) { @@ -74573,9 +74573,9 @@ var require_requestUtils = __commonJS({ isRetryable = isRetryableStatusCode(statusCode); errorMessage = `Cache service responded with ${statusCode}`; } - core31.debug(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); + core29.debug(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); if (!isRetryable) { - core31.debug(`${name} - Error is not retryable`); + core29.debug(`${name} - Error is not retryable`); break; } yield sleep(delay2); @@ -74834,7 +74834,7 @@ var require_downloadUtils = __commonJS({ exports2.downloadCacheHttpClient = downloadCacheHttpClient; exports2.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; exports2.downloadCacheStorageSDK = downloadCacheStorageSDK; - var core31 = __importStar2(require_core()); + var core29 = __importStar2(require_core()); var http_client_1 = require_lib(); var storage_blob_1 = require_commonjs15(); var buffer = __importStar2(require("buffer")); @@ -74872,7 +74872,7 @@ var require_downloadUtils = __commonJS({ this.segmentIndex = this.segmentIndex + 1; this.segmentSize = segmentSize; this.receivedBytes = 0; - core31.debug(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`); + core29.debug(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`); } /** * Sets the number of bytes received for the current segment. @@ -74906,7 +74906,7 @@ var require_downloadUtils = __commonJS({ const percentage = (100 * (transferredBytes / this.contentLength)).toFixed(1); const elapsedTime = Date.now() - this.startTime; const downloadSpeed = (transferredBytes / (1024 * 1024) / (elapsedTime / 1e3)).toFixed(1); - core31.info(`Received ${transferredBytes} of ${this.contentLength} (${percentage}%), ${downloadSpeed} MBs/sec`); + core29.info(`Received ${transferredBytes} of ${this.contentLength} (${percentage}%), ${downloadSpeed} MBs/sec`); if (this.isDone()) { this.displayedComplete = true; } @@ -74956,7 +74956,7 @@ var require_downloadUtils = __commonJS({ })); downloadResponse.message.socket.setTimeout(constants_1.SocketTimeout, () => { downloadResponse.message.destroy(); - core31.debug(`Aborting download, socket timed out after ${constants_1.SocketTimeout} ms`); + core29.debug(`Aborting download, socket timed out after ${constants_1.SocketTimeout} ms`); }); yield pipeResponseToStream(downloadResponse, writeStream); const contentLengthHeader = downloadResponse.message.headers["content-length"]; @@ -74967,7 +74967,7 @@ var require_downloadUtils = __commonJS({ throw new Error(`Incomplete download. Expected file size: ${expectedLength}, actual file size: ${actualLength}`); } } else { - core31.debug("Unable to validate download, no Content-Length header"); + core29.debug("Unable to validate download, no Content-Length header"); } }); } @@ -75085,7 +75085,7 @@ var require_downloadUtils = __commonJS({ const properties = yield client.getProperties(); const contentLength = (_a = properties.contentLength) !== null && _a !== void 0 ? _a : -1; if (contentLength < 0) { - core31.debug("Unable to determine content length, downloading file with http-client..."); + core29.debug("Unable to determine content length, downloading file with http-client..."); yield downloadCacheHttpClient(archiveLocation, archivePath); } else { const maxSegmentSize = Math.min(134217728, buffer.constants.MAX_LENGTH); @@ -75175,7 +75175,7 @@ var require_options = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getUploadOptions = getUploadOptions; exports2.getDownloadOptions = getDownloadOptions; - var core31 = __importStar2(require_core()); + var core29 = __importStar2(require_core()); function getUploadOptions(copy) { const result = { useAzureSdk: false, @@ -75195,9 +75195,9 @@ var require_options = __commonJS({ } result.uploadConcurrency = !isNaN(Number(process.env["CACHE_UPLOAD_CONCURRENCY"])) ? Math.min(32, Number(process.env["CACHE_UPLOAD_CONCURRENCY"])) : result.uploadConcurrency; result.uploadChunkSize = !isNaN(Number(process.env["CACHE_UPLOAD_CHUNK_SIZE"])) ? Math.min(128 * 1024 * 1024, Number(process.env["CACHE_UPLOAD_CHUNK_SIZE"]) * 1024 * 1024) : result.uploadChunkSize; - core31.debug(`Use Azure SDK: ${result.useAzureSdk}`); - core31.debug(`Upload concurrency: ${result.uploadConcurrency}`); - core31.debug(`Upload chunk size: ${result.uploadChunkSize}`); + core29.debug(`Use Azure SDK: ${result.useAzureSdk}`); + core29.debug(`Upload concurrency: ${result.uploadConcurrency}`); + core29.debug(`Upload chunk size: ${result.uploadChunkSize}`); return result; } function getDownloadOptions(copy) { @@ -75233,12 +75233,12 @@ var require_options = __commonJS({ if (segmentDownloadTimeoutMins && !isNaN(Number(segmentDownloadTimeoutMins)) && isFinite(Number(segmentDownloadTimeoutMins))) { result.segmentTimeoutInMs = Number(segmentDownloadTimeoutMins) * 60 * 1e3; } - core31.debug(`Use Azure SDK: ${result.useAzureSdk}`); - core31.debug(`Download concurrency: ${result.downloadConcurrency}`); - core31.debug(`Request timeout (ms): ${result.timeoutInMs}`); - core31.debug(`Cache segment download timeout mins env var: ${process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]}`); - core31.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); - core31.debug(`Lookup only: ${result.lookupOnly}`); + core29.debug(`Use Azure SDK: ${result.useAzureSdk}`); + core29.debug(`Download concurrency: ${result.downloadConcurrency}`); + core29.debug(`Request timeout (ms): ${result.timeoutInMs}`); + core29.debug(`Cache segment download timeout mins env var: ${process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]}`); + core29.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); + core29.debug(`Lookup only: ${result.lookupOnly}`); return result; } } @@ -75432,7 +75432,7 @@ var require_cacheHttpClient = __commonJS({ exports2.downloadCache = downloadCache; exports2.reserveCache = reserveCache; exports2.saveCache = saveCache5; - var core31 = __importStar2(require_core()); + var core29 = __importStar2(require_core()); var http_client_1 = require_lib(); var auth_1 = require_auth(); var fs30 = __importStar2(require("fs")); @@ -75450,7 +75450,7 @@ var require_cacheHttpClient = __commonJS({ throw new Error("Cache Service Url not found, unable to restore cache."); } const url2 = `${baseUrl}_apis/artifactcache/${resource}`; - core31.debug(`Resource Url: ${url2}`); + core29.debug(`Resource Url: ${url2}`); return url2; } function createAcceptHeader(type2, apiVersion) { @@ -75478,7 +75478,7 @@ var require_cacheHttpClient = __commonJS({ return httpClient.getJson(getCacheApiUrl(resource)); })); if (response.statusCode === 204) { - if (core31.isDebug()) { + if (core29.isDebug()) { yield printCachesListForDiagnostics(keys[0], httpClient, version); } return null; @@ -75491,9 +75491,9 @@ var require_cacheHttpClient = __commonJS({ if (!cacheDownloadUrl) { throw new Error("Cache not found."); } - core31.setSecret(cacheDownloadUrl); - core31.debug(`Cache Result:`); - core31.debug(JSON.stringify(cacheResult)); + core29.setSecret(cacheDownloadUrl); + core29.debug(`Cache Result:`); + core29.debug(JSON.stringify(cacheResult)); return cacheResult; }); } @@ -75507,10 +75507,10 @@ var require_cacheHttpClient = __commonJS({ const cacheListResult = response.result; const totalCount = cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.totalCount; if (totalCount && totalCount > 0) { - core31.debug(`No matching cache found for cache key '${key}', version '${version} and scope ${process.env["GITHUB_REF"]}. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key + core29.debug(`No matching cache found for cache key '${key}', version '${version} and scope ${process.env["GITHUB_REF"]}. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key Other caches with similar key:`); for (const cacheEntry of (cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.artifactCaches) || []) { - core31.debug(`Cache Key: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheKey}, Cache Version: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheVersion}, Cache Scope: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.scope}, Cache Created: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.creationTime}`); + core29.debug(`Cache Key: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheKey}, Cache Version: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheVersion}, Cache Scope: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.scope}, Cache Created: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.creationTime}`); } } } @@ -75553,7 +75553,7 @@ Other caches with similar key:`); } function uploadChunk(httpClient, resourceUrl, openStream, start, end) { return __awaiter2(this, void 0, void 0, function* () { - core31.debug(`Uploading chunk of size ${end - start + 1} bytes at offset ${start} with content range: ${getContentRange(start, end)}`); + core29.debug(`Uploading chunk of size ${end - start + 1} bytes at offset ${start} with content range: ${getContentRange(start, end)}`); const additionalHeaders = { "Content-Type": "application/octet-stream", "Content-Range": getContentRange(start, end) @@ -75575,7 +75575,7 @@ Other caches with similar key:`); const concurrency = utils.assertDefined("uploadConcurrency", uploadOptions.uploadConcurrency); const maxChunkSize = utils.assertDefined("uploadChunkSize", uploadOptions.uploadChunkSize); const parallelUploads = [...new Array(concurrency).keys()]; - core31.debug("Awaiting all uploads"); + core29.debug("Awaiting all uploads"); let offset = 0; try { yield Promise.all(parallelUploads.map(() => __awaiter2(this, void 0, void 0, function* () { @@ -75618,16 +75618,16 @@ Other caches with similar key:`); yield (0, uploadUtils_1.uploadCacheArchiveSDK)(signedUploadURL, archivePath, options); } else { const httpClient = createHttpClient(); - core31.debug("Upload cache"); + core29.debug("Upload cache"); yield uploadFile(httpClient, cacheId, archivePath, options); - core31.debug("Commiting cache"); + core29.debug("Commiting cache"); const cacheSize = utils.getArchiveFileSizeInBytes(archivePath); - core31.info(`Cache Size: ~${Math.round(cacheSize / (1024 * 1024))} MB (${cacheSize} B)`); + core29.info(`Cache Size: ~${Math.round(cacheSize / (1024 * 1024))} MB (${cacheSize} B)`); const commitCacheResponse = yield commitCache(httpClient, cacheId, cacheSize); if (!(0, requestUtils_1.isSuccessStatusCode)(commitCacheResponse.statusCode)) { throw new Error(`Cache service responded with ${commitCacheResponse.statusCode} during commit cache.`); } - core31.info("Cache saved successfully"); + core29.info("Cache saved successfully"); } }); } @@ -81110,7 +81110,7 @@ var require_cache4 = __commonJS({ exports2.isFeatureAvailable = isFeatureAvailable; exports2.restoreCache = restoreCache5; exports2.saveCache = saveCache5; - var core31 = __importStar2(require_core()); + var core29 = __importStar2(require_core()); var path28 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); var cacheHttpClient = __importStar2(require_cacheHttpClient()); @@ -81169,7 +81169,7 @@ var require_cache4 = __commonJS({ function restoreCache5(paths_1, primaryKey_1, restoreKeys_1, options_1) { return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - core31.debug(`Cache service version: ${cacheServiceVersion}`); + core29.debug(`Cache service version: ${cacheServiceVersion}`); checkPaths(paths); switch (cacheServiceVersion) { case "v2": @@ -81184,8 +81184,8 @@ var require_cache4 = __commonJS({ return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { restoreKeys = restoreKeys || []; const keys = [primaryKey, ...restoreKeys]; - core31.debug("Resolved Keys:"); - core31.debug(JSON.stringify(keys)); + core29.debug("Resolved Keys:"); + core29.debug(JSON.stringify(keys)); if (keys.length > 10) { throw new ValidationError(`Key Validation Error: Keys are limited to a maximum of 10.`); } @@ -81203,19 +81203,19 @@ var require_cache4 = __commonJS({ return void 0; } if (options === null || options === void 0 ? void 0 : options.lookupOnly) { - core31.info("Lookup only - skipping download"); + core29.info("Lookup only - skipping download"); return cacheEntry.cacheKey; } archivePath = path28.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core31.debug(`Archive Path: ${archivePath}`); + core29.debug(`Archive Path: ${archivePath}`); yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); - if (core31.isDebug()) { + if (core29.isDebug()) { yield (0, tar_1.listTar)(archivePath, compressionMethod); } const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core31.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); + core29.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); yield (0, tar_1.extractTar)(archivePath, compressionMethod); - core31.info("Cache restored successfully"); + core29.info("Cache restored successfully"); return cacheEntry.cacheKey; } catch (error3) { const typedError = error3; @@ -81223,16 +81223,16 @@ var require_cache4 = __commonJS({ throw error3; } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core31.error(`Failed to restore: ${error3.message}`); + core29.error(`Failed to restore: ${error3.message}`); } else { - core31.warning(`Failed to restore: ${error3.message}`); + core29.warning(`Failed to restore: ${error3.message}`); } } } finally { try { yield utils.unlinkFile(archivePath); } catch (error3) { - core31.debug(`Failed to delete archive: ${error3}`); + core29.debug(`Failed to delete archive: ${error3}`); } } return void 0; @@ -81243,8 +81243,8 @@ var require_cache4 = __commonJS({ options = Object.assign(Object.assign({}, options), { useAzureSdk: true }); restoreKeys = restoreKeys || []; const keys = [primaryKey, ...restoreKeys]; - core31.debug("Resolved Keys:"); - core31.debug(JSON.stringify(keys)); + core29.debug("Resolved Keys:"); + core29.debug(JSON.stringify(keys)); if (keys.length > 10) { throw new ValidationError(`Key Validation Error: Keys are limited to a maximum of 10.`); } @@ -81262,30 +81262,30 @@ var require_cache4 = __commonJS({ }; const response = yield twirpClient.GetCacheEntryDownloadURL(request3); if (!response.ok) { - core31.debug(`Cache not found for version ${request3.version} of keys: ${keys.join(", ")}`); + core29.debug(`Cache not found for version ${request3.version} of keys: ${keys.join(", ")}`); return void 0; } const isRestoreKeyMatch = request3.key !== response.matchedKey; if (isRestoreKeyMatch) { - core31.info(`Cache hit for restore-key: ${response.matchedKey}`); + core29.info(`Cache hit for restore-key: ${response.matchedKey}`); } else { - core31.info(`Cache hit for: ${response.matchedKey}`); + core29.info(`Cache hit for: ${response.matchedKey}`); } if (options === null || options === void 0 ? void 0 : options.lookupOnly) { - core31.info("Lookup only - skipping download"); + core29.info("Lookup only - skipping download"); return response.matchedKey; } archivePath = path28.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core31.debug(`Archive path: ${archivePath}`); - core31.debug(`Starting download of archive to: ${archivePath}`); + core29.debug(`Archive path: ${archivePath}`); + core29.debug(`Starting download of archive to: ${archivePath}`); yield cacheHttpClient.downloadCache(response.signedDownloadUrl, archivePath, options); const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core31.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); - if (core31.isDebug()) { + core29.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); + if (core29.isDebug()) { yield (0, tar_1.listTar)(archivePath, compressionMethod); } yield (0, tar_1.extractTar)(archivePath, compressionMethod); - core31.info("Cache restored successfully"); + core29.info("Cache restored successfully"); return response.matchedKey; } catch (error3) { const typedError = error3; @@ -81293,9 +81293,9 @@ var require_cache4 = __commonJS({ throw error3; } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core31.error(`Failed to restore: ${error3.message}`); + core29.error(`Failed to restore: ${error3.message}`); } else { - core31.warning(`Failed to restore: ${error3.message}`); + core29.warning(`Failed to restore: ${error3.message}`); } } } finally { @@ -81304,7 +81304,7 @@ var require_cache4 = __commonJS({ yield utils.unlinkFile(archivePath); } } catch (error3) { - core31.debug(`Failed to delete archive: ${error3}`); + core29.debug(`Failed to delete archive: ${error3}`); } } return void 0; @@ -81313,7 +81313,7 @@ var require_cache4 = __commonJS({ function saveCache5(paths_1, key_1, options_1) { return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - core31.debug(`Cache service version: ${cacheServiceVersion}`); + core29.debug(`Cache service version: ${cacheServiceVersion}`); checkPaths(paths); checkKey(key); switch (cacheServiceVersion) { @@ -81331,26 +81331,26 @@ var require_cache4 = __commonJS({ const compressionMethod = yield utils.getCompressionMethod(); let cacheId = -1; const cachePaths = yield utils.resolvePaths(paths); - core31.debug("Cache Paths:"); - core31.debug(`${JSON.stringify(cachePaths)}`); + core29.debug("Cache Paths:"); + core29.debug(`${JSON.stringify(cachePaths)}`); if (cachePaths.length === 0) { throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`); } const archiveFolder = yield utils.createTempDirectory(); const archivePath = path28.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core31.debug(`Archive Path: ${archivePath}`); + core29.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core31.isDebug()) { + if (core29.isDebug()) { yield (0, tar_1.listTar)(archivePath, compressionMethod); } const fileSizeLimit = 10 * 1024 * 1024 * 1024; const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core31.debug(`File Size: ${archiveFileSize}`); + core29.debug(`File Size: ${archiveFileSize}`); if (archiveFileSize > fileSizeLimit && !(0, config_1.isGhes)()) { throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`); } - core31.debug("Reserving Cache"); + core29.debug("Reserving Cache"); const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { compressionMethod, enableCrossOsArchive, @@ -81363,26 +81363,26 @@ var require_cache4 = __commonJS({ } else { throw new ReserveCacheError2(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message}`); } - core31.debug(`Saving Cache (ID: ${cacheId})`); + core29.debug(`Saving Cache (ID: ${cacheId})`); yield cacheHttpClient.saveCache(cacheId, archivePath, "", options); } catch (error3) { const typedError = error3; if (typedError.name === ValidationError.name) { throw error3; } else if (typedError.name === ReserveCacheError2.name) { - core31.info(`Failed to save: ${typedError.message}`); + core29.info(`Failed to save: ${typedError.message}`); } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core31.error(`Failed to save: ${typedError.message}`); + core29.error(`Failed to save: ${typedError.message}`); } else { - core31.warning(`Failed to save: ${typedError.message}`); + core29.warning(`Failed to save: ${typedError.message}`); } } } finally { try { yield utils.unlinkFile(archivePath); } catch (error3) { - core31.debug(`Failed to delete archive: ${error3}`); + core29.debug(`Failed to delete archive: ${error3}`); } } return cacheId; @@ -81395,23 +81395,23 @@ var require_cache4 = __commonJS({ const twirpClient = cacheTwirpClient.internalCacheTwirpClient(); let cacheId = -1; const cachePaths = yield utils.resolvePaths(paths); - core31.debug("Cache Paths:"); - core31.debug(`${JSON.stringify(cachePaths)}`); + core29.debug("Cache Paths:"); + core29.debug(`${JSON.stringify(cachePaths)}`); if (cachePaths.length === 0) { throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`); } const archiveFolder = yield utils.createTempDirectory(); const archivePath = path28.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core31.debug(`Archive Path: ${archivePath}`); + core29.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core31.isDebug()) { + if (core29.isDebug()) { yield (0, tar_1.listTar)(archivePath, compressionMethod); } const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core31.debug(`File Size: ${archiveFileSize}`); + core29.debug(`File Size: ${archiveFileSize}`); options.archiveSizeBytes = archiveFileSize; - core31.debug("Reserving Cache"); + core29.debug("Reserving Cache"); const version = utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive); const request3 = { key, @@ -81422,16 +81422,16 @@ var require_cache4 = __commonJS({ const response = yield twirpClient.CreateCacheEntry(request3); if (!response.ok) { if (response.message) { - core31.warning(`Cache reservation failed: ${response.message}`); + core29.warning(`Cache reservation failed: ${response.message}`); } throw new Error(response.message || "Response was not ok"); } signedUploadUrl = response.signedUploadUrl; } catch (error3) { - core31.debug(`Failed to reserve cache: ${error3}`); + core29.debug(`Failed to reserve cache: ${error3}`); throw new ReserveCacheError2(`Unable to reserve cache with key ${key}, another job may be creating this cache.`); } - core31.debug(`Attempting to upload cache located at: ${archivePath}`); + core29.debug(`Attempting to upload cache located at: ${archivePath}`); yield cacheHttpClient.saveCache(cacheId, archivePath, signedUploadUrl, options); const finalizeRequest = { key, @@ -81439,7 +81439,7 @@ var require_cache4 = __commonJS({ sizeBytes: `${archiveFileSize}` }; const finalizeResponse = yield twirpClient.FinalizeCacheEntryUpload(finalizeRequest); - core31.debug(`FinalizeCacheEntryUploadResponse: ${finalizeResponse.ok}`); + core29.debug(`FinalizeCacheEntryUploadResponse: ${finalizeResponse.ok}`); if (!finalizeResponse.ok) { if (finalizeResponse.message) { throw new FinalizeCacheError(finalizeResponse.message); @@ -81452,21 +81452,21 @@ var require_cache4 = __commonJS({ if (typedError.name === ValidationError.name) { throw error3; } else if (typedError.name === ReserveCacheError2.name) { - core31.info(`Failed to save: ${typedError.message}`); + core29.info(`Failed to save: ${typedError.message}`); } else if (typedError.name === FinalizeCacheError.name) { - core31.warning(typedError.message); + core29.warning(typedError.message); } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core31.error(`Failed to save: ${typedError.message}`); + core29.error(`Failed to save: ${typedError.message}`); } else { - core31.warning(`Failed to save: ${typedError.message}`); + core29.warning(`Failed to save: ${typedError.message}`); } } } finally { try { yield utils.unlinkFile(archivePath); } catch (error3) { - core31.debug(`Failed to delete archive: ${error3}`); + core29.debug(`Failed to delete archive: ${error3}`); } } return cacheId; @@ -81693,7 +81693,7 @@ var require_retry_helper = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.RetryHelper = void 0; - var core31 = __importStar2(require_core()); + var core29 = __importStar2(require_core()); var RetryHelper = class { constructor(maxAttempts, minSeconds, maxSeconds) { if (maxAttempts < 1) { @@ -81716,10 +81716,10 @@ var require_retry_helper = __commonJS({ if (isRetryable && !isRetryable(err)) { throw err; } - core31.info(err.message); + core29.info(err.message); } const seconds = this.getSleepAmount(); - core31.info(`Waiting ${seconds} seconds before trying again`); + core29.info(`Waiting ${seconds} seconds before trying again`); yield this.sleep(seconds); attempt++; } @@ -81822,7 +81822,7 @@ var require_tool_cache = __commonJS({ exports2.findFromManifest = findFromManifest; exports2.isExplicitVersion = isExplicitVersion; exports2.evaluateVersions = evaluateVersions; - var core31 = __importStar2(require_core()); + var core29 = __importStar2(require_core()); var io9 = __importStar2(require_io()); var crypto3 = __importStar2(require("crypto")); var fs30 = __importStar2(require("fs")); @@ -81851,8 +81851,8 @@ var require_tool_cache = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { dest = dest || path28.join(_getTempDirectory(), crypto3.randomUUID()); yield io9.mkdirP(path28.dirname(dest)); - core31.debug(`Downloading ${url2}`); - core31.debug(`Destination ${dest}`); + core29.debug(`Downloading ${url2}`); + core29.debug(`Destination ${dest}`); const maxAttempts = 3; const minSeconds = _getGlobal("TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS", 10); const maxSeconds = _getGlobal("TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS", 20); @@ -81878,7 +81878,7 @@ var require_tool_cache = __commonJS({ allowRetries: false }); if (auth2) { - core31.debug("set auth"); + core29.debug("set auth"); if (headers === void 0) { headers = {}; } @@ -81887,7 +81887,7 @@ var require_tool_cache = __commonJS({ const response = yield http.get(url2, headers); if (response.message.statusCode !== 200) { const err = new HTTPError2(response.message.statusCode); - core31.debug(`Failed to download from "${url2}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); + core29.debug(`Failed to download from "${url2}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); throw err; } const pipeline = util.promisify(stream2.pipeline); @@ -81896,16 +81896,16 @@ var require_tool_cache = __commonJS({ let succeeded = false; try { yield pipeline(readStream, fs30.createWriteStream(dest)); - core31.debug("download complete"); + core29.debug("download complete"); succeeded = true; return dest; } finally { if (!succeeded) { - core31.debug("download failed"); + core29.debug("download failed"); try { yield io9.rmRF(dest); } catch (err) { - core31.debug(`Failed to delete '${dest}'. ${err.message}`); + core29.debug(`Failed to delete '${dest}'. ${err.message}`); } } } @@ -81920,7 +81920,7 @@ var require_tool_cache = __commonJS({ process.chdir(dest); if (_7zPath) { try { - const logLevel = core31.isDebug() ? "-bb1" : "-bb0"; + const logLevel = core29.isDebug() ? "-bb1" : "-bb0"; const args = [ "x", // eXtract files with full paths @@ -81973,7 +81973,7 @@ var require_tool_cache = __commonJS({ throw new Error("parameter 'file' is required"); } dest = yield _createExtractFolder(dest); - core31.debug("Checking tar --version"); + core29.debug("Checking tar --version"); let versionOutput = ""; yield (0, exec_1.exec)("tar --version", [], { ignoreReturnCode: true, @@ -81983,7 +81983,7 @@ var require_tool_cache = __commonJS({ stderr: (data) => versionOutput += data.toString() } }); - core31.debug(versionOutput.trim()); + core29.debug(versionOutput.trim()); const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); let args; if (flags instanceof Array) { @@ -81991,7 +81991,7 @@ var require_tool_cache = __commonJS({ } else { args = [flags]; } - if (core31.isDebug() && !flags.includes("v")) { + if (core29.isDebug() && !flags.includes("v")) { args.push("-v"); } let destArg = dest; @@ -82022,7 +82022,7 @@ var require_tool_cache = __commonJS({ args = [flags]; } args.push("-x", "-C", dest, "-f", file); - if (core31.isDebug()) { + if (core29.isDebug()) { args.push("-v"); } const xarPath = yield io9.which("xar", true); @@ -82065,7 +82065,7 @@ var require_tool_cache = __commonJS({ "-Command", pwshCommand ]; - core31.debug(`Using pwsh at path: ${pwshPath}`); + core29.debug(`Using pwsh at path: ${pwshPath}`); yield (0, exec_1.exec)(`"${pwshPath}"`, args); } else { const powershellCommand = [ @@ -82085,7 +82085,7 @@ var require_tool_cache = __commonJS({ powershellCommand ]; const powershellPath = yield io9.which("powershell", true); - core31.debug(`Using powershell at path: ${powershellPath}`); + core29.debug(`Using powershell at path: ${powershellPath}`); yield (0, exec_1.exec)(`"${powershellPath}"`, args); } }); @@ -82094,7 +82094,7 @@ var require_tool_cache = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { const unzipPath = yield io9.which("unzip", true); const args = [file]; - if (!core31.isDebug()) { + if (!core29.isDebug()) { args.unshift("-q"); } args.unshift("-o"); @@ -82105,8 +82105,8 @@ var require_tool_cache = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { version = semver11.clean(version) || version; arch2 = arch2 || os7.arch(); - core31.debug(`Caching tool ${tool} ${version} ${arch2}`); - core31.debug(`source dir: ${sourceDir}`); + core29.debug(`Caching tool ${tool} ${version} ${arch2}`); + core29.debug(`source dir: ${sourceDir}`); if (!fs30.statSync(sourceDir).isDirectory()) { throw new Error("sourceDir is not a directory"); } @@ -82123,14 +82123,14 @@ var require_tool_cache = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { version = semver11.clean(version) || version; arch2 = arch2 || os7.arch(); - core31.debug(`Caching tool ${tool} ${version} ${arch2}`); - core31.debug(`source file: ${sourceFile}`); + core29.debug(`Caching tool ${tool} ${version} ${arch2}`); + core29.debug(`source file: ${sourceFile}`); if (!fs30.statSync(sourceFile).isFile()) { throw new Error("sourceFile is not a file"); } const destFolder = yield _createToolPath(tool, version, arch2); const destPath = path28.join(destFolder, targetFile); - core31.debug(`destination file ${destPath}`); + core29.debug(`destination file ${destPath}`); yield io9.cp(sourceFile, destPath); _completeToolPath(tool, version, arch2); return destFolder; @@ -82153,12 +82153,12 @@ var require_tool_cache = __commonJS({ if (versionSpec) { versionSpec = semver11.clean(versionSpec) || ""; const cachePath = path28.join(_getCacheDirectory(), toolName, versionSpec, arch2); - core31.debug(`checking cache: ${cachePath}`); + core29.debug(`checking cache: ${cachePath}`); if (fs30.existsSync(cachePath) && fs30.existsSync(`${cachePath}.complete`)) { - core31.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); + core29.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); toolPath = cachePath; } else { - core31.debug("not found"); + core29.debug("not found"); } } return toolPath; @@ -82187,7 +82187,7 @@ var require_tool_cache = __commonJS({ const http = new httpm.HttpClient("tool-cache"); const headers = {}; if (auth2) { - core31.debug("set auth"); + core29.debug("set auth"); headers.authorization = auth2; } const response = yield http.getJson(treeUrl, headers); @@ -82208,7 +82208,7 @@ var require_tool_cache = __commonJS({ try { releases = JSON.parse(versionsRaw); } catch (_a) { - core31.debug("Invalid json"); + core29.debug("Invalid json"); } } return releases; @@ -82232,7 +82232,7 @@ var require_tool_cache = __commonJS({ function _createToolPath(tool, version, arch2) { return __awaiter2(this, void 0, void 0, function* () { const folderPath = path28.join(_getCacheDirectory(), tool, semver11.clean(version) || version, arch2 || ""); - core31.debug(`destination ${folderPath}`); + core29.debug(`destination ${folderPath}`); const markerPath = `${folderPath}.complete`; yield io9.rmRF(folderPath); yield io9.rmRF(markerPath); @@ -82244,18 +82244,18 @@ var require_tool_cache = __commonJS({ const folderPath = path28.join(_getCacheDirectory(), tool, semver11.clean(version) || version, arch2 || ""); const markerPath = `${folderPath}.complete`; fs30.writeFileSync(markerPath, ""); - core31.debug("finished caching tool"); + core29.debug("finished caching tool"); } function isExplicitVersion(versionSpec) { const c = semver11.clean(versionSpec) || ""; - core31.debug(`isExplicit: ${c}`); + core29.debug(`isExplicit: ${c}`); const valid4 = semver11.valid(c) != null; - core31.debug(`explicit? ${valid4}`); + core29.debug(`explicit? ${valid4}`); return valid4; } function evaluateVersions(versions, versionSpec) { let version = ""; - core31.debug(`evaluating ${versions.length} versions`); + core29.debug(`evaluating ${versions.length} versions`); versions = versions.sort((a, b) => { if (semver11.gt(a, b)) { return 1; @@ -82271,9 +82271,9 @@ var require_tool_cache = __commonJS({ } } if (version) { - core31.debug(`matched: ${version}`); + core29.debug(`matched: ${version}`); } else { - core31.debug("match not found"); + core29.debug("match not found"); } return version; } @@ -87866,14 +87866,14 @@ var require_retention = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getExpiration = void 0; var generated_1 = require_generated(); - var core31 = __importStar2(require_core()); + var core29 = __importStar2(require_core()); function getExpiration(retentionDays) { if (!retentionDays) { return void 0; } const maxRetentionDays = getRetentionDays(); if (maxRetentionDays && maxRetentionDays < retentionDays) { - core31.warning(`Retention days cannot be greater than the maximum allowed retention set within the repository. Using ${maxRetentionDays} instead.`); + core29.warning(`Retention days cannot be greater than the maximum allowed retention set within the repository. Using ${maxRetentionDays} instead.`); retentionDays = maxRetentionDays; } const expirationDate = /* @__PURE__ */ new Date(); @@ -88211,7 +88211,7 @@ var require_util11 = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.maskSecretUrls = exports2.maskSigUrl = exports2.getBackendIdsFromToken = void 0; - var core31 = __importStar2(require_core()); + var core29 = __importStar2(require_core()); var config_1 = require_config2(); var jwt_decode_1 = __importDefault2(require_jwt_decode_cjs()); var core_1 = require_core(); @@ -88238,8 +88238,8 @@ var require_util11 = __commonJS({ workflowRunBackendId: scopeParts[1], workflowJobRunBackendId: scopeParts[2] }; - core31.debug(`Workflow Run Backend ID: ${ids.workflowRunBackendId}`); - core31.debug(`Workflow Job Run Backend ID: ${ids.workflowJobRunBackendId}`); + core29.debug(`Workflow Run Backend ID: ${ids.workflowRunBackendId}`); + core29.debug(`Workflow Job Run Backend ID: ${ids.workflowJobRunBackendId}`); return ids; } throw InvalidJwtError; @@ -88599,7 +88599,7 @@ var require_blob_upload = __commonJS({ exports2.uploadZipToBlobStorage = void 0; var storage_blob_1 = require_commonjs15(); var config_1 = require_config2(); - var core31 = __importStar2(require_core()); + var core29 = __importStar2(require_core()); var crypto3 = __importStar2(require("crypto")); var stream2 = __importStar2(require("stream")); var errors_1 = require_errors3(); @@ -88625,9 +88625,9 @@ var require_blob_upload = __commonJS({ const bufferSize = (0, config_1.getUploadChunkSize)(); const blobClient = new storage_blob_1.BlobClient(authenticatedUploadURL); const blockBlobClient = blobClient.getBlockBlobClient(); - core31.debug(`Uploading artifact zip to blob storage with maxConcurrency: ${maxConcurrency}, bufferSize: ${bufferSize}`); + core29.debug(`Uploading artifact zip to blob storage with maxConcurrency: ${maxConcurrency}, bufferSize: ${bufferSize}`); const uploadCallback = (progress) => { - core31.info(`Uploaded bytes ${progress.loadedBytes}`); + core29.info(`Uploaded bytes ${progress.loadedBytes}`); uploadByteCount = progress.loadedBytes; lastProgressTime = Date.now(); }; @@ -88641,7 +88641,7 @@ var require_blob_upload = __commonJS({ const hashStream = crypto3.createHash("sha256"); zipUploadStream.pipe(uploadStream); zipUploadStream.pipe(hashStream).setEncoding("hex"); - core31.info("Beginning upload of artifact content to blob storage"); + core29.info("Beginning upload of artifact content to blob storage"); try { yield Promise.race([ blockBlobClient.uploadStream(uploadStream, bufferSize, maxConcurrency, options), @@ -88655,12 +88655,12 @@ var require_blob_upload = __commonJS({ } finally { abortController.abort(); } - core31.info("Finished uploading artifact content to blob storage!"); + core29.info("Finished uploading artifact content to blob storage!"); hashStream.end(); sha256Hash = hashStream.read(); - core31.info(`SHA256 digest of uploaded artifact zip is ${sha256Hash}`); + core29.info(`SHA256 digest of uploaded artifact zip is ${sha256Hash}`); if (uploadByteCount === 0) { - core31.warning(`No data was uploaded to blob storage. Reported upload byte count is 0.`); + core29.warning(`No data was uploaded to blob storage. Reported upload byte count is 0.`); } return { uploadSize: uploadByteCount, @@ -114003,7 +114003,7 @@ var require_zip2 = __commonJS({ var stream2 = __importStar2(require("stream")); var promises_1 = require("fs/promises"); var archiver2 = __importStar2(require_archiver()); - var core31 = __importStar2(require_core()); + var core29 = __importStar2(require_core()); var config_1 = require_config2(); exports2.DEFAULT_COMPRESSION_LEVEL = 6; var ZipUploadStream = class extends stream2.Transform { @@ -114020,7 +114020,7 @@ var require_zip2 = __commonJS({ exports2.ZipUploadStream = ZipUploadStream; function createZipUploadStream(uploadSpecification_1) { return __awaiter2(this, arguments, void 0, function* (uploadSpecification, compressionLevel = exports2.DEFAULT_COMPRESSION_LEVEL) { - core31.debug(`Creating Artifact archive with compressionLevel: ${compressionLevel}`); + core29.debug(`Creating Artifact archive with compressionLevel: ${compressionLevel}`); const zip = archiver2.create("zip", { highWaterMark: (0, config_1.getUploadChunkSize)(), zlib: { level: compressionLevel } @@ -114044,8 +114044,8 @@ var require_zip2 = __commonJS({ } const bufferSize = (0, config_1.getUploadChunkSize)(); const zipUploadStream = new ZipUploadStream(bufferSize); - core31.debug(`Zip write high watermark value ${zipUploadStream.writableHighWaterMark}`); - core31.debug(`Zip read high watermark value ${zipUploadStream.readableHighWaterMark}`); + core29.debug(`Zip write high watermark value ${zipUploadStream.writableHighWaterMark}`); + core29.debug(`Zip read high watermark value ${zipUploadStream.readableHighWaterMark}`); zip.pipe(zipUploadStream); zip.finalize(); return zipUploadStream; @@ -114053,24 +114053,24 @@ var require_zip2 = __commonJS({ } exports2.createZipUploadStream = createZipUploadStream; var zipErrorCallback = (error3) => { - core31.error("An error has occurred while creating the zip file for upload"); - core31.info(error3); + core29.error("An error has occurred while creating the zip file for upload"); + core29.info(error3); throw new Error("An error has occurred during zip creation for the artifact"); }; var zipWarningCallback = (error3) => { if (error3.code === "ENOENT") { - core31.warning("ENOENT warning during artifact zip creation. No such file or directory"); - core31.info(error3); + core29.warning("ENOENT warning during artifact zip creation. No such file or directory"); + core29.info(error3); } else { - core31.warning(`A non-blocking warning has occurred during artifact zip creation: ${error3.code}`); - core31.info(error3); + core29.warning(`A non-blocking warning has occurred during artifact zip creation: ${error3.code}`); + core29.info(error3); } }; var zipFinishCallback = () => { - core31.debug("Zip stream for upload has finished."); + core29.debug("Zip stream for upload has finished."); }; var zipEndCallback = () => { - core31.debug("Zip stream for upload has ended."); + core29.debug("Zip stream for upload has ended."); }; } }); @@ -114135,7 +114135,7 @@ var require_upload_artifact = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.uploadArtifact = void 0; - var core31 = __importStar2(require_core()); + var core29 = __importStar2(require_core()); var retention_1 = require_retention(); var path_and_artifact_name_validation_1 = require_path_and_artifact_name_validation(); var artifact_twirp_client_1 = require_artifact_twirp_client2(); @@ -114182,13 +114182,13 @@ var require_upload_artifact = __commonJS({ value: `sha256:${uploadResult.sha256Hash}` }); } - core31.info(`Finalizing artifact upload`); + core29.info(`Finalizing artifact upload`); const finalizeArtifactResp = yield artifactClient.FinalizeArtifact(finalizeArtifactReq); if (!finalizeArtifactResp.ok) { throw new errors_1.InvalidResponseError("FinalizeArtifact: response from backend was not ok"); } const artifactId = BigInt(finalizeArtifactResp.artifactId); - core31.info(`Artifact ${name}.zip successfully finalized. Artifact ID ${artifactId}`); + core29.info(`Artifact ${name}.zip successfully finalized. Artifact ID ${artifactId}`); return { size: uploadResult.uploadSize, digest: uploadResult.sha256Hash, @@ -120912,7 +120912,7 @@ var require_download_artifact = __commonJS({ var crypto3 = __importStar2(require("crypto")); var stream2 = __importStar2(require("stream")); var github5 = __importStar2(require_github2()); - var core31 = __importStar2(require_core()); + var core29 = __importStar2(require_core()); var httpClient = __importStar2(require_lib()); var unzip_stream_1 = __importDefault2(require_unzip()); var user_agent_1 = require_user_agent2(); @@ -120948,7 +120948,7 @@ var require_download_artifact = __commonJS({ return yield streamExtractExternal(url2, directory); } catch (error3) { retryCount++; - core31.debug(`Failed to download artifact after ${retryCount} retries due to ${error3.message}. Retrying in 5 seconds...`); + core29.debug(`Failed to download artifact after ${retryCount} retries due to ${error3.message}. Retrying in 5 seconds...`); yield new Promise((resolve13) => setTimeout(resolve13, 5e3)); } } @@ -120978,7 +120978,7 @@ var require_download_artifact = __commonJS({ extractStream.on("data", () => { timer.refresh(); }).on("error", (error3) => { - core31.debug(`response.message: Artifact download failed: ${error3.message}`); + core29.debug(`response.message: Artifact download failed: ${error3.message}`); clearTimeout(timer); reject(error3); }).pipe(unzip_stream_1.default.Extract({ path: directory })).on("close", () => { @@ -120986,7 +120986,7 @@ var require_download_artifact = __commonJS({ if (hashStream) { hashStream.end(); sha256Digest = hashStream.read(); - core31.info(`SHA256 digest of downloaded artifact is ${sha256Digest}`); + core29.info(`SHA256 digest of downloaded artifact is ${sha256Digest}`); } resolve13({ sha256Digest: `sha256:${sha256Digest}` }); }).on("error", (error3) => { @@ -121001,7 +121001,7 @@ var require_download_artifact = __commonJS({ const downloadPath = yield resolveOrCreateDirectory(options === null || options === void 0 ? void 0 : options.path); const api = github5.getOctokit(token); let digestMismatch = false; - core31.info(`Downloading artifact '${artifactId}' from '${repositoryOwner}/${repositoryName}'`); + core29.info(`Downloading artifact '${artifactId}' from '${repositoryOwner}/${repositoryName}'`); const { headers, status } = yield api.rest.actions.downloadArtifact({ owner: repositoryOwner, repo: repositoryName, @@ -121018,16 +121018,16 @@ var require_download_artifact = __commonJS({ if (!location) { throw new Error(`Unable to redirect to artifact download url`); } - core31.info(`Redirecting to blob download url: ${scrubQueryParameters(location)}`); + core29.info(`Redirecting to blob download url: ${scrubQueryParameters(location)}`); try { - core31.info(`Starting download of artifact to: ${downloadPath}`); + core29.info(`Starting download of artifact to: ${downloadPath}`); const extractResponse = yield streamExtract(location, downloadPath); - core31.info(`Artifact download completed successfully.`); + core29.info(`Artifact download completed successfully.`); if (options === null || options === void 0 ? void 0 : options.expectedHash) { if ((options === null || options === void 0 ? void 0 : options.expectedHash) !== extractResponse.sha256Digest) { digestMismatch = true; - core31.debug(`Computed digest: ${extractResponse.sha256Digest}`); - core31.debug(`Expected digest: ${options.expectedHash}`); + core29.debug(`Computed digest: ${extractResponse.sha256Digest}`); + core29.debug(`Expected digest: ${options.expectedHash}`); } } } catch (error3) { @@ -121054,7 +121054,7 @@ var require_download_artifact = __commonJS({ Are you trying to download from a different run? Try specifying a github-token with \`actions:read\` scope.`); } if (artifacts.length > 1) { - core31.warning("Multiple artifacts found, defaulting to first."); + core29.warning("Multiple artifacts found, defaulting to first."); } const signedReq = { workflowRunBackendId: artifacts[0].workflowRunBackendId, @@ -121062,16 +121062,16 @@ Are you trying to download from a different run? Try specifying a github-token w name: artifacts[0].name }; const { signedUrl } = yield artifactClient.GetSignedArtifactURL(signedReq); - core31.info(`Redirecting to blob download url: ${scrubQueryParameters(signedUrl)}`); + core29.info(`Redirecting to blob download url: ${scrubQueryParameters(signedUrl)}`); try { - core31.info(`Starting download of artifact to: ${downloadPath}`); + core29.info(`Starting download of artifact to: ${downloadPath}`); const extractResponse = yield streamExtract(signedUrl, downloadPath); - core31.info(`Artifact download completed successfully.`); + core29.info(`Artifact download completed successfully.`); if (options === null || options === void 0 ? void 0 : options.expectedHash) { if ((options === null || options === void 0 ? void 0 : options.expectedHash) !== extractResponse.sha256Digest) { digestMismatch = true; - core31.debug(`Computed digest: ${extractResponse.sha256Digest}`); - core31.debug(`Expected digest: ${options.expectedHash}`); + core29.debug(`Computed digest: ${extractResponse.sha256Digest}`); + core29.debug(`Expected digest: ${options.expectedHash}`); } } } catch (error3) { @@ -121084,10 +121084,10 @@ Are you trying to download from a different run? Try specifying a github-token w function resolveOrCreateDirectory() { return __awaiter2(this, arguments, void 0, function* (downloadPath = (0, config_1.getGitHubWorkspaceDir)()) { if (!(yield exists(downloadPath))) { - core31.debug(`Artifact destination folder does not exist, creating: ${downloadPath}`); + core29.debug(`Artifact destination folder does not exist, creating: ${downloadPath}`); yield promises_1.default.mkdir(downloadPath, { recursive: true }); } else { - core31.debug(`Artifact destination folder already exists: ${downloadPath}`); + core29.debug(`Artifact destination folder already exists: ${downloadPath}`); } return downloadPath; }); @@ -121128,7 +121128,7 @@ var require_retry_options = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getRetryOptions = void 0; - var core31 = __importStar2(require_core()); + var core29 = __importStar2(require_core()); var defaultMaxRetryNumber = 5; var defaultExemptStatusCodes = [400, 401, 403, 404, 422]; function getRetryOptions(defaultOptions, retries = defaultMaxRetryNumber, exemptStatusCodes = defaultExemptStatusCodes) { @@ -121143,7 +121143,7 @@ var require_retry_options = __commonJS({ retryOptions.doNotRetry = exemptStatusCodes; } const requestOptions = Object.assign(Object.assign({}, defaultOptions.request), { retries }); - core31.debug(`GitHub client configured with: (retries: ${requestOptions.retries}, retry-exempt-status-code: ${(_a = retryOptions.doNotRetry) !== null && _a !== void 0 ? _a : "octokit default: [400, 401, 403, 404, 422]"})`); + core29.debug(`GitHub client configured with: (retries: ${requestOptions.retries}, retry-exempt-status-code: ${(_a = retryOptions.doNotRetry) !== null && _a !== void 0 ? _a : "octokit default: [400, 401, 403, 404, 422]"})`); return [retryOptions, requestOptions]; } exports2.getRetryOptions = getRetryOptions; @@ -121300,7 +121300,7 @@ var require_get_artifact = __commonJS({ exports2.getArtifactInternal = exports2.getArtifactPublic = void 0; var github_1 = require_github2(); var plugin_retry_1 = require_dist_node12(); - var core31 = __importStar2(require_core()); + var core29 = __importStar2(require_core()); var utils_1 = require_utils9(); var retry_options_1 = require_retry_options(); var plugin_request_log_1 = require_dist_node11(); @@ -121338,7 +121338,7 @@ var require_get_artifact = __commonJS({ let artifact2 = getArtifactResp.data.artifacts[0]; if (getArtifactResp.data.artifacts.length > 1) { artifact2 = getArtifactResp.data.artifacts.sort((a, b) => b.id - a.id)[0]; - core31.debug(`More than one artifact found for a single name, returning newest (id: ${artifact2.id})`); + core29.debug(`More than one artifact found for a single name, returning newest (id: ${artifact2.id})`); } return { artifact: { @@ -121371,7 +121371,7 @@ var require_get_artifact = __commonJS({ let artifact2 = res.artifacts[0]; if (res.artifacts.length > 1) { artifact2 = res.artifacts.sort((a, b) => Number(b.databaseId) - Number(a.databaseId))[0]; - core31.debug(`More than one artifact found for a single name, returning newest (id: ${artifact2.databaseId})`); + core29.debug(`More than one artifact found for a single name, returning newest (id: ${artifact2.databaseId})`); } return { artifact: { @@ -124479,7 +124479,7 @@ var require_core3 = __commonJS({ ExitCode2[ExitCode2["Success"] = 0] = "Success"; ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; })(ExitCode || (exports2.ExitCode = ExitCode = {})); - function exportVariable15(name, val) { + function exportVariable3(name, val) { const convertedVal = (0, utils_1.toCommandValue)(val); process.env[name] = convertedVal; const filePath = process.env["GITHUB_ENV"] || ""; @@ -124488,7 +124488,7 @@ var require_core3 = __commonJS({ } (0, command_1.issueCommand)("set-env", { name }, convertedVal); } - exports2.exportVariable = exportVariable15; + exports2.exportVariable = exportVariable3; function setSecret2(secret) { (0, command_1.issueCommand)("add-mask", {}, secret); } @@ -126109,7 +126109,7 @@ var require_requestUtils2 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.retryHttpClientRequest = exports2.retry = void 0; var utils_1 = require_utils11(); - var core31 = __importStar2(require_core3()); + var core29 = __importStar2(require_core3()); var config_variables_1 = require_config_variables(); function retry2(name, operation, customErrorMessages, maxAttempts) { return __awaiter2(this, void 0, void 0, function* () { @@ -126136,13 +126136,13 @@ var require_requestUtils2 = __commonJS({ errorMessage = error3.message; } if (!isRetryable) { - core31.info(`${name} - Error is not retryable`); + core29.info(`${name} - Error is not retryable`); if (response) { (0, utils_1.displayHttpDiagnostics)(response); } break; } - core31.info(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); + core29.info(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); yield (0, utils_1.sleep)((0, utils_1.getExponentialRetryTimeInMilliseconds)(attempt)); attempt++; } @@ -126226,7 +126226,7 @@ var require_upload_http_client = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.UploadHttpClient = void 0; var fs30 = __importStar2(require("fs")); - var core31 = __importStar2(require_core3()); + var core29 = __importStar2(require_core3()); var tmp = __importStar2(require_tmp_promise()); var stream2 = __importStar2(require("stream")); var utils_1 = require_utils11(); @@ -126291,7 +126291,7 @@ var require_upload_http_client = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { const FILE_CONCURRENCY = (0, config_variables_1.getUploadFileConcurrency)(); const MAX_CHUNK_SIZE = (0, config_variables_1.getUploadChunkSize)(); - core31.debug(`File Concurrency: ${FILE_CONCURRENCY}, and Chunk Size: ${MAX_CHUNK_SIZE}`); + core29.debug(`File Concurrency: ${FILE_CONCURRENCY}, and Chunk Size: ${MAX_CHUNK_SIZE}`); const parameters = []; let continueOnError = true; if (options) { @@ -126328,15 +126328,15 @@ var require_upload_http_client = __commonJS({ } const startTime = perf_hooks_1.performance.now(); const uploadFileResult = yield this.uploadFileAsync(index, currentFileParameters); - if (core31.isDebug()) { - core31.debug(`File: ${++completedFiles}/${filesToUpload.length}. ${currentFileParameters.file} took ${(perf_hooks_1.performance.now() - startTime).toFixed(3)} milliseconds to finish upload`); + if (core29.isDebug()) { + core29.debug(`File: ${++completedFiles}/${filesToUpload.length}. ${currentFileParameters.file} took ${(perf_hooks_1.performance.now() - startTime).toFixed(3)} milliseconds to finish upload`); } uploadFileSize += uploadFileResult.successfulUploadSize; totalFileSize += uploadFileResult.totalSize; if (uploadFileResult.isSuccess === false) { failedItemsToReport.push(currentFileParameters.file); if (!continueOnError) { - core31.error(`aborting artifact upload`); + core29.error(`aborting artifact upload`); abortPendingFileUploads = true; } } @@ -126345,7 +126345,7 @@ var require_upload_http_client = __commonJS({ }))); this.statusReporter.stop(); this.uploadHttpManager.disposeAndReplaceAllClients(); - core31.info(`Total size of all the files uploaded is ${uploadFileSize} bytes`); + core29.info(`Total size of all the files uploaded is ${uploadFileSize} bytes`); return { uploadSize: uploadFileSize, totalSize: totalFileSize, @@ -126371,16 +126371,16 @@ var require_upload_http_client = __commonJS({ let uploadFileSize = 0; let isGzip = true; if (!isFIFO && totalFileSize < 65536) { - core31.debug(`${parameters.file} is less than 64k in size. Creating a gzip file in-memory to potentially reduce the upload size`); + core29.debug(`${parameters.file} is less than 64k in size. Creating a gzip file in-memory to potentially reduce the upload size`); const buffer = yield (0, upload_gzip_1.createGZipFileInBuffer)(parameters.file); let openUploadStream; if (totalFileSize < buffer.byteLength) { - core31.debug(`The gzip file created for ${parameters.file} did not help with reducing the size of the file. The original file will be uploaded as-is`); + core29.debug(`The gzip file created for ${parameters.file} did not help with reducing the size of the file. The original file will be uploaded as-is`); openUploadStream = () => fs30.createReadStream(parameters.file); isGzip = false; uploadFileSize = totalFileSize; } else { - core31.debug(`A gzip file created for ${parameters.file} helped with reducing the size of the original file. The file will be uploaded using gzip.`); + core29.debug(`A gzip file created for ${parameters.file} helped with reducing the size of the original file. The file will be uploaded using gzip.`); openUploadStream = () => { const passThrough = new stream2.PassThrough(); passThrough.end(buffer); @@ -126392,7 +126392,7 @@ var require_upload_http_client = __commonJS({ if (!result) { isUploadSuccessful = false; failedChunkSizes += uploadFileSize; - core31.warning(`Aborting upload for ${parameters.file} due to failure`); + core29.warning(`Aborting upload for ${parameters.file} due to failure`); } return { isSuccess: isUploadSuccessful, @@ -126401,16 +126401,16 @@ var require_upload_http_client = __commonJS({ }; } else { const tempFile = yield tmp.file(); - core31.debug(`${parameters.file} is greater than 64k in size. Creating a gzip file on-disk ${tempFile.path} to potentially reduce the upload size`); + core29.debug(`${parameters.file} is greater than 64k in size. Creating a gzip file on-disk ${tempFile.path} to potentially reduce the upload size`); uploadFileSize = yield (0, upload_gzip_1.createGZipFileOnDisk)(parameters.file, tempFile.path); let uploadFilePath = tempFile.path; if (!isFIFO && totalFileSize < uploadFileSize) { - core31.debug(`The gzip file created for ${parameters.file} did not help with reducing the size of the file. The original file will be uploaded as-is`); + core29.debug(`The gzip file created for ${parameters.file} did not help with reducing the size of the file. The original file will be uploaded as-is`); uploadFileSize = totalFileSize; uploadFilePath = parameters.file; isGzip = false; } else { - core31.debug(`The gzip file created for ${parameters.file} is smaller than the original file. The file will be uploaded using gzip.`); + core29.debug(`The gzip file created for ${parameters.file} is smaller than the original file. The file will be uploaded using gzip.`); } let abortFileUpload = false; while (offset < uploadFileSize) { @@ -126430,7 +126430,7 @@ var require_upload_http_client = __commonJS({ if (!result) { isUploadSuccessful = false; failedChunkSizes += chunkSize; - core31.warning(`Aborting upload for ${parameters.file} due to failure`); + core29.warning(`Aborting upload for ${parameters.file} due to failure`); abortFileUpload = true; } else { if (uploadFileSize > 8388608) { @@ -126438,7 +126438,7 @@ var require_upload_http_client = __commonJS({ } } } - core31.debug(`deleting temporary gzip file ${tempFile.path}`); + core29.debug(`deleting temporary gzip file ${tempFile.path}`); yield tempFile.cleanup(); return { isSuccess: isUploadSuccessful, @@ -126477,7 +126477,7 @@ var require_upload_http_client = __commonJS({ if (response) { (0, utils_1.displayHttpDiagnostics)(response); } - core31.info(`Retry limit has been reached for chunk at offset ${start} to ${resourceUrl}`); + core29.info(`Retry limit has been reached for chunk at offset ${start} to ${resourceUrl}`); return true; } return false; @@ -126485,14 +126485,14 @@ var require_upload_http_client = __commonJS({ const backOff = (retryAfterValue) => __awaiter2(this, void 0, void 0, function* () { this.uploadHttpManager.disposeAndReplaceClient(httpClientIndex); if (retryAfterValue) { - core31.info(`Backoff due to too many requests, retry #${retryCount}. Waiting for ${retryAfterValue} milliseconds before continuing the upload`); + core29.info(`Backoff due to too many requests, retry #${retryCount}. Waiting for ${retryAfterValue} milliseconds before continuing the upload`); yield (0, utils_1.sleep)(retryAfterValue); } else { const backoffTime = (0, utils_1.getExponentialRetryTimeInMilliseconds)(retryCount); - core31.info(`Exponential backoff for retry #${retryCount}. Waiting for ${backoffTime} milliseconds before continuing the upload at offset ${start}`); + core29.info(`Exponential backoff for retry #${retryCount}. Waiting for ${backoffTime} milliseconds before continuing the upload at offset ${start}`); yield (0, utils_1.sleep)(backoffTime); } - core31.info(`Finished backoff for retry #${retryCount}, continuing with upload`); + core29.info(`Finished backoff for retry #${retryCount}, continuing with upload`); return; }); while (retryCount <= retryLimit) { @@ -126500,7 +126500,7 @@ var require_upload_http_client = __commonJS({ try { response = yield uploadChunkRequest(); } catch (error3) { - core31.info(`An error has been caught http-client index ${httpClientIndex}, retrying the upload`); + core29.info(`An error has been caught http-client index ${httpClientIndex}, retrying the upload`); console.log(error3); if (incrementAndCheckRetryLimit()) { return false; @@ -126512,13 +126512,13 @@ var require_upload_http_client = __commonJS({ if ((0, utils_1.isSuccessStatusCode)(response.message.statusCode)) { return true; } else if ((0, utils_1.isRetryableStatusCode)(response.message.statusCode)) { - core31.info(`A ${response.message.statusCode} status code has been received, will attempt to retry the upload`); + core29.info(`A ${response.message.statusCode} status code has been received, will attempt to retry the upload`); if (incrementAndCheckRetryLimit(response)) { return false; } (0, utils_1.isThrottledStatusCode)(response.message.statusCode) ? yield backOff((0, utils_1.tryGetRetryAfterValueTimeInMilliseconds)(response.message.headers)) : yield backOff(); } else { - core31.error(`Unexpected response. Unable to upload chunk to ${resourceUrl}`); + core29.error(`Unexpected response. Unable to upload chunk to ${resourceUrl}`); (0, utils_1.displayHttpDiagnostics)(response); return false; } @@ -126536,7 +126536,7 @@ var require_upload_http_client = __commonJS({ resourceUrl.searchParams.append("artifactName", artifactName); const parameters = { Size: size }; const data = JSON.stringify(parameters, null, 2); - core31.debug(`URL is ${resourceUrl.toString()}`); + core29.debug(`URL is ${resourceUrl.toString()}`); const client = this.uploadHttpManager.getClient(0); const headers = (0, utils_1.getUploadHeaders)("application/json", false); const customErrorMessages = /* @__PURE__ */ new Map([ @@ -126549,7 +126549,7 @@ var require_upload_http_client = __commonJS({ return client.patch(resourceUrl.toString(), data, headers); }), customErrorMessages); yield response.readBody(); - core31.debug(`Artifact ${artifactName} has been successfully uploaded, total size in bytes: ${size}`); + core29.debug(`Artifact ${artifactName} has been successfully uploaded, total size in bytes: ${size}`); }); } }; @@ -126618,7 +126618,7 @@ var require_download_http_client = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.DownloadHttpClient = void 0; var fs30 = __importStar2(require("fs")); - var core31 = __importStar2(require_core3()); + var core29 = __importStar2(require_core3()); var zlib3 = __importStar2(require("zlib")); var utils_1 = require_utils11(); var url_1 = require("url"); @@ -126672,11 +126672,11 @@ var require_download_http_client = __commonJS({ downloadSingleArtifact(downloadItems) { return __awaiter2(this, void 0, void 0, function* () { const DOWNLOAD_CONCURRENCY = (0, config_variables_1.getDownloadFileConcurrency)(); - core31.debug(`Download file concurrency is set to ${DOWNLOAD_CONCURRENCY}`); + core29.debug(`Download file concurrency is set to ${DOWNLOAD_CONCURRENCY}`); const parallelDownloads = [...new Array(DOWNLOAD_CONCURRENCY).keys()]; let currentFile = 0; let downloadedFiles = 0; - core31.info(`Total number of files that will be downloaded: ${downloadItems.length}`); + core29.info(`Total number of files that will be downloaded: ${downloadItems.length}`); this.statusReporter.setTotalNumberOfFilesToProcess(downloadItems.length); this.statusReporter.start(); yield Promise.all(parallelDownloads.map((index) => __awaiter2(this, void 0, void 0, function* () { @@ -126685,8 +126685,8 @@ var require_download_http_client = __commonJS({ currentFile += 1; const startTime = perf_hooks_1.performance.now(); yield this.downloadIndividualFile(index, currentFileToDownload.sourceLocation, currentFileToDownload.targetPath); - if (core31.isDebug()) { - core31.debug(`File: ${++downloadedFiles}/${downloadItems.length}. ${currentFileToDownload.targetPath} took ${(perf_hooks_1.performance.now() - startTime).toFixed(3)} milliseconds to finish downloading`); + if (core29.isDebug()) { + core29.debug(`File: ${++downloadedFiles}/${downloadItems.length}. ${currentFileToDownload.targetPath} took ${(perf_hooks_1.performance.now() - startTime).toFixed(3)} milliseconds to finish downloading`); } this.statusReporter.incrementProcessedCount(); } @@ -126724,19 +126724,19 @@ var require_download_http_client = __commonJS({ } else { this.downloadHttpManager.disposeAndReplaceClient(httpClientIndex); if (retryAfterValue) { - core31.info(`Backoff due to too many requests, retry #${retryCount}. Waiting for ${retryAfterValue} milliseconds before continuing the download`); + core29.info(`Backoff due to too many requests, retry #${retryCount}. Waiting for ${retryAfterValue} milliseconds before continuing the download`); yield (0, utils_1.sleep)(retryAfterValue); } else { const backoffTime = (0, utils_1.getExponentialRetryTimeInMilliseconds)(retryCount); - core31.info(`Exponential backoff for retry #${retryCount}. Waiting for ${backoffTime} milliseconds before continuing the download`); + core29.info(`Exponential backoff for retry #${retryCount}. Waiting for ${backoffTime} milliseconds before continuing the download`); yield (0, utils_1.sleep)(backoffTime); } - core31.info(`Finished backoff for retry #${retryCount}, continuing with download`); + core29.info(`Finished backoff for retry #${retryCount}, continuing with download`); } }); const isAllBytesReceived = (expected, received) => { if (!expected || !received || process.env["ACTIONS_ARTIFACT_SKIP_DOWNLOAD_VALIDATION"]) { - core31.info("Skipping download validation."); + core29.info("Skipping download validation."); return true; } return parseInt(expected) === received; @@ -126757,7 +126757,7 @@ var require_download_http_client = __commonJS({ try { response = yield makeDownloadRequest(); } catch (error3) { - core31.info("An error occurred while attempting to download a file"); + core29.info("An error occurred while attempting to download a file"); console.log(error3); yield backOff(); continue; @@ -126777,7 +126777,7 @@ var require_download_http_client = __commonJS({ } } if (forceRetry || (0, utils_1.isRetryableStatusCode)(response.message.statusCode)) { - core31.info(`A ${response.message.statusCode} response code has been received while attempting to download an artifact`); + core29.info(`A ${response.message.statusCode} response code has been received while attempting to download an artifact`); resetDestinationStream(downloadPath); (0, utils_1.isThrottledStatusCode)(response.message.statusCode) ? yield backOff((0, utils_1.tryGetRetryAfterValueTimeInMilliseconds)(response.message.headers)) : yield backOff(); } else { @@ -126799,29 +126799,29 @@ var require_download_http_client = __commonJS({ if (isGzip) { const gunzip = zlib3.createGunzip(); response.message.on("error", (error3) => { - core31.info(`An error occurred while attempting to read the response stream`); + core29.info(`An error occurred while attempting to read the response stream`); gunzip.close(); destinationStream.close(); reject(error3); }).pipe(gunzip).on("error", (error3) => { - core31.info(`An error occurred while attempting to decompress the response stream`); + core29.info(`An error occurred while attempting to decompress the response stream`); destinationStream.close(); reject(error3); }).pipe(destinationStream).on("close", () => { resolve13(); }).on("error", (error3) => { - core31.info(`An error occurred while writing a downloaded file to ${destinationStream.path}`); + core29.info(`An error occurred while writing a downloaded file to ${destinationStream.path}`); reject(error3); }); } else { response.message.on("error", (error3) => { - core31.info(`An error occurred while attempting to read the response stream`); + core29.info(`An error occurred while attempting to read the response stream`); destinationStream.close(); reject(error3); }).pipe(destinationStream).on("close", () => { resolve13(); }).on("error", (error3) => { - core31.info(`An error occurred while writing a downloaded file to ${destinationStream.path}`); + core29.info(`An error occurred while writing a downloaded file to ${destinationStream.path}`); reject(error3); }); } @@ -126960,7 +126960,7 @@ var require_artifact_client = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.DefaultArtifactClient = void 0; - var core31 = __importStar2(require_core3()); + var core29 = __importStar2(require_core3()); var upload_specification_1 = require_upload_specification(); var upload_http_client_1 = require_upload_http_client(); var utils_1 = require_utils11(); @@ -126981,7 +126981,7 @@ var require_artifact_client = __commonJS({ */ uploadArtifact(name, files, rootDirectory, options) { return __awaiter2(this, void 0, void 0, function* () { - core31.info(`Starting artifact upload + core29.info(`Starting artifact upload For more detailed logs during the artifact upload process, enable step-debugging: https://docs.github.com/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging#enabling-step-debug-logging`); (0, path_and_artifact_name_validation_1.checkArtifactName)(name); const uploadSpecification = (0, upload_specification_1.getUploadSpecification)(name, rootDirectory, files); @@ -126993,24 +126993,24 @@ For more detailed logs during the artifact upload process, enable step-debugging }; const uploadHttpClient = new upload_http_client_1.UploadHttpClient(); if (uploadSpecification.length === 0) { - core31.warning(`No files found that can be uploaded`); + core29.warning(`No files found that can be uploaded`); } else { const response = yield uploadHttpClient.createArtifactInFileContainer(name, options); if (!response.fileContainerResourceUrl) { - core31.debug(response.toString()); + core29.debug(response.toString()); throw new Error("No URL provided by the Artifact Service to upload an artifact to"); } - core31.debug(`Upload Resource URL: ${response.fileContainerResourceUrl}`); - core31.info(`Container for artifact "${name}" successfully created. Starting upload of file(s)`); + core29.debug(`Upload Resource URL: ${response.fileContainerResourceUrl}`); + core29.info(`Container for artifact "${name}" successfully created. Starting upload of file(s)`); const uploadResult = yield uploadHttpClient.uploadArtifactToFileContainer(response.fileContainerResourceUrl, uploadSpecification, options); - core31.info(`File upload process has finished. Finalizing the artifact upload`); + core29.info(`File upload process has finished. Finalizing the artifact upload`); yield uploadHttpClient.patchArtifactSize(uploadResult.totalSize, name); if (uploadResult.failedItems.length > 0) { - core31.info(`Upload finished. There were ${uploadResult.failedItems.length} items that failed to upload`); + core29.info(`Upload finished. There were ${uploadResult.failedItems.length} items that failed to upload`); } else { - core31.info(`Artifact has been finalized. All files have been successfully uploaded!`); + core29.info(`Artifact has been finalized. All files have been successfully uploaded!`); } - core31.info(` + core29.info(` The raw size of all the files that were specified for upload is ${uploadResult.totalSize} bytes The size of all the files that were uploaded is ${uploadResult.uploadSize} bytes. This takes into account any gzip compression used to reduce the upload size, time and storage @@ -127044,10 +127044,10 @@ Note: The size of downloaded zips can differ significantly from the reported siz path28 = (0, path_1.resolve)(path28); const downloadSpecification = (0, download_specification_1.getDownloadSpecification)(name, items.value, path28, (options === null || options === void 0 ? void 0 : options.createArtifactFolder) || false); if (downloadSpecification.filesToDownload.length === 0) { - core31.info(`No downloadable files were found for the artifact: ${artifactToDownload.name}`); + core29.info(`No downloadable files were found for the artifact: ${artifactToDownload.name}`); } else { yield (0, utils_1.createDirectoriesForArtifact)(downloadSpecification.directoryStructure); - core31.info("Directory structure has been set up for the artifact"); + core29.info("Directory structure has been set up for the artifact"); yield (0, utils_1.createEmptyFilesForArtifact)(downloadSpecification.emptyFilesToCreate); yield downloadHttpClient.downloadSingleArtifact(downloadSpecification.filesToDownload); } @@ -127063,7 +127063,7 @@ Note: The size of downloaded zips can differ significantly from the reported siz const response = []; const artifacts = yield downloadHttpClient.listArtifacts(); if (artifacts.count === 0) { - core31.info("Unable to find any artifacts for the associated workflow"); + core29.info("Unable to find any artifacts for the associated workflow"); return response; } if (!path28) { @@ -127075,11 +127075,11 @@ Note: The size of downloaded zips can differ significantly from the reported siz while (downloadedArtifacts < artifacts.count) { const currentArtifactToDownload = artifacts.value[downloadedArtifacts]; downloadedArtifacts += 1; - core31.info(`starting download of artifact ${currentArtifactToDownload.name} : ${downloadedArtifacts}/${artifacts.count}`); + core29.info(`starting download of artifact ${currentArtifactToDownload.name} : ${downloadedArtifacts}/${artifacts.count}`); const items = yield downloadHttpClient.getContainerItems(currentArtifactToDownload.name, currentArtifactToDownload.fileContainerResourceUrl); const downloadSpecification = (0, download_specification_1.getDownloadSpecification)(currentArtifactToDownload.name, items.value, path28, true); if (downloadSpecification.filesToDownload.length === 0) { - core31.info(`No downloadable files were found for any artifact ${currentArtifactToDownload.name}`); + core29.info(`No downloadable files were found for any artifact ${currentArtifactToDownload.name}`); } else { yield (0, utils_1.createDirectoriesForArtifact)(downloadSpecification.directoryStructure); yield (0, utils_1.createEmptyFilesForArtifact)(downloadSpecification.emptyFilesToCreate); @@ -144959,12 +144959,12 @@ module.exports = __toCommonJS(entry_points_exports); var fs22 = __toESM(require("fs")); var import_path4 = __toESM(require("path")); var import_perf_hooks4 = require("perf_hooks"); -var core16 = __toESM(require_core()); +var core14 = __toESM(require_core()); // src/actions-util.ts var fs2 = __toESM(require("fs")); var path2 = __toESM(require("path")); -var core4 = __toESM(require_core()); +var core5 = __toESM(require_core()); var toolrunner = __toESM(require_toolrunner()); var github = __toESM(require_github()); var io2 = __toESM(require_io()); @@ -144974,7 +144974,7 @@ var fs = __toESM(require("fs")); var fsPromises = __toESM(require("fs/promises")); var os = __toESM(require("os")); var path = __toESM(require("path")); -var core3 = __toESM(require_core()); +var core4 = __toESM(require_core()); var io = __toESM(require_io()); // node_modules/get-folder-size/index.js @@ -147626,6 +147626,19 @@ var semver = __toESM(require_semver2()); var maximumVersion = "3.21"; var minimumVersion = "3.16"; +// src/environment.ts +var core3 = __toESM(require_core()); +function isInTestMode() { + return process.env["CODEQL_ACTION_TEST_MODE" /* TEST_MODE */] === "true"; +} +function exportVariable2(name, val) { + if (process.env["NODE_ENV"] === "test") { + process.env[name] = val; + } else { + core3.exportVariable(name, val); + } +} + // src/json/index.ts function parseString(data) { return JSON.parse(data); @@ -147939,7 +147952,7 @@ function checkGitHubVersionInRange(version, logger) { ); } hasBeenWarnedAboutVersion = true; - core3.exportVariable(CODEQL_ACTION_WARNED_ABOUT_VERSION_ENV_VAR, true); + exportVariable2(CODEQL_ACTION_WARNED_ABOUT_VERSION_ENV_VAR, true); } function apiVersionInRange(version, minimumVersion2, maximumVersion2) { if (!semver.satisfies(version, `>=${minimumVersion2}`)) { @@ -147961,11 +147974,11 @@ function assertNever(value) { throw new ExhaustivityCheckingError(value); } function initializeEnvironment(version) { - core3.exportVariable("CODEQL_ACTION_FEATURE_MULTI_LANGUAGE" /* FEATURE_MULTI_LANGUAGE */, "false"); - core3.exportVariable("CODEQL_ACTION_FEATURE_SANDWICH" /* FEATURE_SANDWICH */, "false"); - core3.exportVariable("CODEQL_ACTION_FEATURE_SARIF_COMBINE" /* FEATURE_SARIF_COMBINE */, "true"); - core3.exportVariable("CODEQL_ACTION_FEATURE_WILL_UPLOAD" /* FEATURE_WILL_UPLOAD */, "true"); - core3.exportVariable("CODEQL_ACTION_VERSION" /* VERSION */, version); + exportVariable2("CODEQL_ACTION_FEATURE_MULTI_LANGUAGE" /* FEATURE_MULTI_LANGUAGE */, "false"); + exportVariable2("CODEQL_ACTION_FEATURE_SANDWICH" /* FEATURE_SANDWICH */, "false"); + exportVariable2("CODEQL_ACTION_FEATURE_SARIF_COMBINE" /* FEATURE_SARIF_COMBINE */, "true"); + exportVariable2("CODEQL_ACTION_FEATURE_WILL_UPLOAD" /* FEATURE_WILL_UPLOAD */, "true"); + exportVariable2("CODEQL_ACTION_VERSION" /* VERSION */, version); } function getRequiredEnvParam(paramName) { const value = process.env[paramName]; @@ -148054,9 +148067,6 @@ async function delay(milliseconds, opts) { function isGoodVersion(versionSpec) { return !BROKEN_VERSIONS.includes(versionSpec); } -function isInTestMode() { - return process.env["CODEQL_ACTION_TEST_MODE" /* TEST_MODE */] === "true"; -} function shouldSkipSarifUpload() { return isInTestMode() || process.env["CODEQL_ACTION_SKIP_SARIF_UPLOAD" /* SKIP_SARIF_UPLOAD */] === "true"; } @@ -148122,7 +148132,7 @@ async function waitForResultWithTimeLimit(timeoutMs, promise, onTimeout) { } async function checkForTimeout() { if (hadTimeout === true) { - core3.info( + core4.info( "A timeout occurred, force exiting the process after 30 seconds to prevent hanging." ); await delay(3e4, { allowProcessExit: true }); @@ -148167,7 +148177,7 @@ async function checkDiskUsage(logger) { } else { logger.debug(message); } - core3.exportVariable("CODEQL_ACTION_HAS_WARNED_ABOUT_DISK_SPACE" /* HAS_WARNED_ABOUT_DISK_SPACE */, "true"); + exportVariable2("CODEQL_ACTION_HAS_WARNED_ABOUT_DISK_SPACE" /* HAS_WARNED_ABOUT_DISK_SPACE */, "true"); } return { numAvailableBytes: diskUsage.bavail * blockSizeInBytes, @@ -148187,10 +148197,10 @@ function checkActionVersion(version, githubVersion) { semver.coerce(githubVersion.version) ?? "0.0.0", ">=3.20" )) { - core3.warning( + core4.warning( "CodeQL Action v3 will be deprecated in December 2026. Please update all occurrences of the CodeQL Action in your workflow files to v4. For more information, see https://github.blog/changelog/2025-10-28-upcoming-deprecation-of-codeql-action-v3/" ); - core3.exportVariable("CODEQL_ACTION_DID_LOG_VERSION_DEPRECATION" /* LOG_VERSION_DEPRECATION */, "true"); + exportVariable2("CODEQL_ACTION_DID_LOG_VERSION_DEPRECATION" /* LOG_VERSION_DEPRECATION */, "true"); } } } @@ -148288,14 +148298,14 @@ var Failure = class { // src/actions-util.ts var getRequiredInput = function(name) { - const value = core4.getInput(name); + const value = core5.getInput(name); if (!value) { throw new ConfigurationError(`Input required and not supplied: ${name}`); } return value; }; var getOptionalInput = function(name) { - const value = core4.getInput(name); + const value = core5.getInput(name); return value.length > 0 ? value : void 0; }; function getTemporaryDirectory() { @@ -148336,22 +148346,22 @@ async function printDebugLogs(config) { const databaseDirectory = getCodeQLDatabasePath(config, language); const logsDirectory = path2.join(databaseDirectory, "log"); if (!doesDirectoryExist(logsDirectory)) { - core4.info(`Directory ${logsDirectory} does not exist.`); + core5.info(`Directory ${logsDirectory} does not exist.`); continue; } const walkLogFiles = (dir) => { const entries = fs2.readdirSync(dir, { withFileTypes: true }); if (entries.length === 0) { - core4.info(`No debug logs found at directory ${logsDirectory}.`); + core5.info(`No debug logs found at directory ${logsDirectory}.`); } for (const entry of entries) { if (entry.isFile()) { const absolutePath = path2.resolve(dir, entry.name); - core4.startGroup( + core5.startGroup( `CodeQL Debug Logs - ${language} - ${entry.name} from file at path ${absolutePath}` ); process.stdout.write(fs2.readFileSync(absolutePath)); - core4.endGroup(); + core5.endGroup(); } else if (entry.isDirectory()) { walkLogFiles(path2.resolve(dir, entry.name)); } @@ -148372,7 +148382,7 @@ function getUploadValue(input) { case "never": return "never"; default: - core4.warning( + core5.warning( `Unrecognized 'upload' input to 'analyze' Action: ${input}. Defaulting to 'always'.` ); return "always"; @@ -148439,7 +148449,7 @@ var getFileType = async (filePath) => { }).exec(); return stdout.trim(); } catch (e) { - core4.info( + core5.info( `Could not determine type of ${filePath} from ${stdout}. ${stderr}` ); throw e; @@ -148520,10 +148530,10 @@ var persistInputs = function() { const inputEnvironmentVariables = Object.entries(process.env).filter( ([name]) => name.startsWith("INPUT_") ); - core4.saveState(persistedInputsKey, JSON.stringify(inputEnvironmentVariables)); + core5.saveState(persistedInputsKey, JSON.stringify(inputEnvironmentVariables)); }; var restoreInputs = function() { - const persistedInputs = core4.getState(persistedInputsKey); + const persistedInputs = core5.getState(persistedInputsKey); if (persistedInputs) { for (const [name, value] of JSON.parse(persistedInputs)) { process.env[name] = value; @@ -148587,7 +148597,7 @@ var path5 = __toESM(require("path")); var semver4 = __toESM(require_semver2()); // src/api-client.ts -var core5 = __toESM(require_core()); +var core6 = __toESM(require_core()); var githubUtils = __toESM(require_utils4()); // node_modules/@octokit/plugin-retry/dist-bundle/index.js @@ -148700,10 +148710,10 @@ function createApiClientWithDetails(apiDetails, { allowExternal = false } = {}) baseUrl: apiDetails.apiURL, userAgent: `CodeQL-Action/${getActionVersion()}`, log: { - debug: core5.debug, - info: core5.info, - warn: core5.warning, - error: core5.error + debug: core6.debug, + info: core6.info, + warn: core6.warning, + error: core6.error }, retry: { doNotRetry: DO_NOT_RETRY_STATUSES @@ -148784,7 +148794,7 @@ async function getAnalysisKey() { const workflowPath = await getWorkflowRelativePath(); const jobName = getRequiredEnvParam("GITHUB_JOB"); analysisKey = `${workflowPath}:${jobName}`; - core5.exportVariable("CODEQL_ACTION_ANALYSIS_KEY" /* ANALYSIS_KEY */, analysisKey); + exportVariable2("CODEQL_ACTION_ANALYSIS_KEY" /* ANALYSIS_KEY */, analysisKey); return analysisKey; } async function getAutomationID() { @@ -148882,7 +148892,7 @@ var path4 = __toESM(require("path")); var fs3 = __toESM(require("fs")); var os2 = __toESM(require("os")); var path3 = __toESM(require("path")); -var core6 = __toESM(require_core()); +var core7 = __toESM(require_core()); var toolrunner2 = __toESM(require_toolrunner()); var io3 = __toESM(require_io()); var semver2 = __toESM(require_semver2()); @@ -148913,7 +148923,7 @@ async function getGitVersionOrThrow() { var runGitCommand = async function(workingDirectory, args, customErrorMessage, options) { let stdout = ""; let stderr = ""; - core6.debug(`Running git command: git ${args.join(" ")}`); + core7.debug(`Running git command: git ${args.join(" ")}`); try { await new toolrunner2.ToolRunner(await io3.which("git", true), args, { silent: true, @@ -148934,7 +148944,7 @@ var runGitCommand = async function(workingDirectory, args, customErrorMessage, o if (stderr.includes("not a git repository")) { reason = "The checkout path provided to the action does not appear to be a git repository."; } - core6.info(`git call failed. ${customErrorMessage} Error: ${reason}`); + core7.info(`git call failed. ${customErrorMessage} Error: ${reason}`); throw error3; } }; @@ -149097,7 +149107,7 @@ async function getRef() { ) !== head; if (hasChangedRef) { const newRef = ref.replace(pull_ref_regex, "refs/pull/$1/head"); - core6.debug( + core7.debug( `No longer on merge commit, rewriting ref from ${ref} to ${newRef}.` ); return newRef; @@ -149979,9 +149989,6 @@ var path15 = __toESM(require("path")); var import_perf_hooks3 = require("perf_hooks"); var io5 = __toESM(require_io()); -// src/autobuild.ts -var core12 = __toESM(require_core()); - // src/codeql.ts var fs15 = __toESM(require("fs")); var path14 = __toESM(require("path")); @@ -150240,11 +150247,10 @@ function wrapCliConfigurationError(cliError) { var fs9 = __toESM(require("fs")); var path10 = __toESM(require("path")); var import_perf_hooks = require("perf_hooks"); -var core9 = __toESM(require_core()); // src/caching-utils.ts var crypto2 = __toESM(require("crypto")); -var core7 = __toESM(require_core()); +var core8 = __toESM(require_core()); async function getTotalCacheSize(paths, logger, quiet = false) { const sizes = await Promise.all( paths.map((cacheDir2) => tryGetFolderBytes(cacheDir2, logger, quiet)) @@ -150273,7 +150279,7 @@ function getCachingKind(input) { case "restore": return "restore" /* Restore */; default: - core7.warning( + core8.warning( `Unrecognized 'dependency-caching' input: ${input}. Defaulting to 'none'.` ); return "none" /* None */; @@ -150698,32 +150704,32 @@ var import_fs = require("fs"); var import_path = __toESM(require("path")); // src/logging.ts -var core8 = __toESM(require_core()); +var core9 = __toESM(require_core()); function getActionsLogger() { return { - debug: core8.debug, - info: core8.info, - warning: core8.warning, - error: core8.error, - isDebug: core8.isDebug, - startGroup: core8.startGroup, - endGroup: core8.endGroup + debug: core9.debug, + info: core9.info, + warning: core9.warning, + error: core9.error, + isDebug: core9.isDebug, + startGroup: core9.startGroup, + endGroup: core9.endGroup }; } function withGroup(groupName, f) { - core8.startGroup(groupName); + core9.startGroup(groupName); try { return f(); } finally { - core8.endGroup(); + core9.endGroup(); } } async function withGroupAsync(groupName, f) { - core8.startGroup(groupName); + core9.startGroup(groupName); try { return await f(); } finally { - core8.endGroup(); + core9.endGroup(); } } function formatDuration(durationMs) { @@ -151927,10 +151933,10 @@ async function setCppTrapCachingEnvironmentVariables(config, logger) { ); } else if (config.trapCaches["cpp" /* cpp */]) { logger.info("Enabling TRAP caching for C/C++."); - core9.exportVariable(envVar, "true"); + exportVariable2(envVar, "true"); } else { logger.debug(`Disabling TRAP caching for C/C++.`); - core9.exportVariable(envVar, "false"); + exportVariable2(envVar, "false"); } } } @@ -154251,7 +154257,7 @@ ${output}` Alternatively, if you want to continue using CodeQL CLI version ${result.version}, you can replace 'github/codeql-action/*@v${getActionVersion().split(".")[0]}' by 'github/codeql-action/*@v${getActionVersion()}' in your code scanning workflow to continue using this version of the CodeQL Action.` ); - core11.exportVariable("CODEQL_ACTION_SUPPRESS_DEPRECATED_SOON_WARNING" /* SUPPRESS_DEPRECATED_SOON_WARNING */, "true"); + exportVariable2("CODEQL_ACTION_SUPPRESS_DEPRECATED_SOON_WARNING" /* SUPPRESS_DEPRECATED_SOON_WARNING */, "true"); } return codeql; } @@ -154410,16 +154416,16 @@ async function setupCppAutobuild(codeql, logger) { logger.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.` : ""}` ); - core12.exportVariable(envVar, "false"); + exportVariable2(envVar, "false"); } else { logger.info( `Enabling ${featureName}. This can be disabled by setting the ${envVar} environment variable to 'false'. See ${"https://docs.github.com/en/actions/learn-github-actions/variables#defining-environment-variables-for-a-single-workflow" /* DEFINE_ENV_VARIABLES */} for more information.` ); - core12.exportVariable(envVar, "true"); + exportVariable2(envVar, "true"); } } else { logger.info(`Disabling ${featureName}.`); - core12.exportVariable(envVar, "false"); + exportVariable2(envVar, "false"); } } async function runAutobuild(config, language, logger) { @@ -154434,7 +154440,7 @@ async function runAutobuild(config, language, logger) { await codeQL.runAutobuild(config, language); } if (language === "go" /* go */) { - core12.exportVariable("CODEQL_ACTION_DID_AUTOBUILD_GOLANG" /* DID_AUTOBUILD_GOLANG */, "true"); + exportVariable2("CODEQL_ACTION_DID_AUTOBUILD_GOLANG" /* DID_AUTOBUILD_GOLANG */, "true"); } logger.endGroup(); } @@ -155227,7 +155233,7 @@ async function uploadBundledDatabase(repositoryNwo, language, commitOid, bundled // src/status-report.ts var os5 = __toESM(require("os")); -var core13 = __toESM(require_core()); +var core12 = __toESM(require_core()); function isFirstPartyAnalysis(actionName) { if (actionName !== "upload-sarif" /* UploadSarif */) { return true; @@ -155267,12 +155273,12 @@ function getJobStatusDisplayName(status) { } function setJobStatusIfUnsuccessful(actionStatus) { if (actionStatus === "user-error") { - core13.exportVariable( + exportVariable2( "CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */, process.env["CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */] ?? "JOB_STATUS_CONFIGURATION_ERROR" /* ConfigErrorStatus */ ); } else if (actionStatus === "failure" || actionStatus === "aborted") { - core13.exportVariable( + exportVariable2( "CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */, process.env["CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */] ?? "JOB_STATUS_FAILURE" /* FailureStatus */ ); @@ -155291,14 +155297,14 @@ async function createStatusReportBase(actionName, status, actionStartedAt, confi let workflowStartedAt = process.env["CODEQL_WORKFLOW_STARTED_AT" /* WORKFLOW_STARTED_AT */]; if (workflowStartedAt === void 0) { workflowStartedAt = actionStartedAt.toISOString(); - core13.exportVariable("CODEQL_WORKFLOW_STARTED_AT" /* WORKFLOW_STARTED_AT */, workflowStartedAt); + exportVariable2("CODEQL_WORKFLOW_STARTED_AT" /* WORKFLOW_STARTED_AT */, workflowStartedAt); } const runnerOs = getRequiredEnvParam("RUNNER_OS"); const codeQlCliVersion = getCachedCodeQlVersion(); const actionRef = process.env["GITHUB_ACTION_REF"] || ""; const testingEnvironment = getTestingEnvironment(); if (testingEnvironment) { - core13.exportVariable("CODEQL_ACTION_TESTING_ENVIRONMENT" /* TESTING_ENVIRONMENT */, testingEnvironment); + exportVariable2("CODEQL_ACTION_TESTING_ENVIRONMENT" /* TESTING_ENVIRONMENT */, testingEnvironment); } const isSteadyStateDefaultSetupRun = process.env["CODE_SCANNING_IS_STEADY_STATE_DEFAULT_SETUP"] === "true"; const statusReport = { @@ -155381,9 +155387,9 @@ var INCOMPATIBLE_MSG = "CodeQL Action version is incompatible with the API endpo async function sendStatusReport(statusReport) { setJobStatusIfUnsuccessful(statusReport.status); const statusReportJSON = JSON.stringify(statusReport); - core13.debug(`Sending status report: ${statusReportJSON}`); + core12.debug(`Sending status report: ${statusReportJSON}`); if (isInTestMode()) { - core13.debug("In test mode. Status reports are not uploaded."); + core12.debug("In test mode. Status reports are not uploaded."); return; } const nwo = getRepositoryNwo(); @@ -155403,28 +155409,28 @@ async function sendStatusReport(statusReport) { switch (httpError.status) { case 403: if (getWorkflowEventName() === "push" && process.env["GITHUB_ACTOR"] === "dependabot[bot]") { - core13.warning( + core12.warning( `Workflows triggered by Dependabot on the "push" event run with read-only access. Uploading CodeQL results requires write access. To use CodeQL with Dependabot, please ensure you are using the "pull_request" event for this workflow and avoid triggering on the "push" event for Dependabot branches. See ${"https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#scanning-on-push" /* SCANNING_ON_PUSH */} for more information on how to configure these events.` ); } else { - core13.warning( + core12.warning( `This run of the CodeQL Action does not have permission to access the CodeQL Action API endpoints. This could be because the Action is running on a pull request from a fork. If not, please ensure the workflow has at least the 'security-events: read' permission. Details: ${httpError.message}` ); } return; case 404: - core13.warning(httpError.message); + core12.warning(httpError.message); return; case 422: if (getRequiredEnvParam("GITHUB_SERVER_URL") !== GITHUB_DOTCOM_URL) { - core13.debug(INCOMPATIBLE_MSG); + core12.debug(INCOMPATIBLE_MSG); } else { - core13.debug(OUT_OF_DATE_MSG); + core12.debug(OUT_OF_DATE_MSG); } return; } } - core13.warning( + core12.warning( `An unexpected error occurred when sending a status report: ${getErrorMessage( e )}` @@ -155528,7 +155534,7 @@ var fs21 = __toESM(require("fs")); var path18 = __toESM(require("path")); var url = __toESM(require("url")); var import_zlib = __toESM(require("zlib")); -var core15 = __toESM(require_core()); +var core13 = __toESM(require_core()); var jsonschema2 = __toESM(require_lib2()); // src/fingerprints.ts @@ -156656,7 +156662,6 @@ async function addFingerprints(sarifLog, sourceRoot, logger) { // src/init.ts var fs19 = __toESM(require("fs")); var path17 = __toESM(require("path")); -var core14 = __toESM(require_core()); var toolrunner4 = __toESM(require_toolrunner()); var github2 = __toESM(require_github()); var io6 = __toESM(require_io()); @@ -156886,7 +156891,7 @@ To opt out of this change, switch to an advanced setup workflow and ${envVarOptO To opt out of this change, ${envVarOptOut}`; } logger.warning(message); - core14.exportVariable("CODEQL_ACTION_DID_LOG_FILE_COVERAGE_ON_PRS_DEPRECATION" /* DID_LOG_FILE_COVERAGE_ON_PRS_DEPRECATION */, "true"); + exportVariable2("CODEQL_ACTION_DID_LOG_FILE_COVERAGE_ON_PRS_DEPRECATION" /* DID_LOG_FILE_COVERAGE_ON_PRS_DEPRECATION */, "true"); } // src/sarif/index.ts @@ -157000,7 +157005,7 @@ async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, lo logger.warning( `Uploading multiple SARIF runs with the same category is deprecated ${deprecationWarningMessage}. Please update your workflow to upload a single run per category. ${deprecationMoreInformationMessage}` ); - core15.exportVariable("CODEQL_MERGE_SARIF_DEPRECATION_WARNING", "true"); + exportVariable2("CODEQL_MERGE_SARIF_DEPRECATION_WARNING", "true"); } return combineSarifFiles(sarifFiles, logger); } @@ -157101,13 +157106,13 @@ async function uploadPayload(payload, repositoryNwo, logger, analysis) { if (httpError !== void 0) { switch (httpError.status) { case 403: - core15.warning(httpError.message || GENERIC_403_MSG); + core13.warning(httpError.message || GENERIC_403_MSG); break; case 404: - core15.warning(httpError.message || GENERIC_404_MSG); + core13.warning(httpError.message || GENERIC_404_MSG); break; default: - core15.warning(httpError.message); + core13.warning(httpError.message); break; } } @@ -157541,7 +157546,7 @@ function validateUniqueCategory(sarifLog, sentinelPrefix) { `Aborting upload: only one run of the codeql/analyze or codeql/upload-sarif actions is allowed per job per tool/category. The easiest fix is to specify a unique value for the \`category\` input. If .runs[].automationDetails.id is specified in the sarif file, that will take precedence over your configured \`category\`. Category: (${id ? id : "none"}) Tool: (${tool ? tool : "none"})` ); } - core15.exportVariable(sentinelEnvVar, sentinelEnvVar); + exportVariable2(sentinelEnvVar, sentinelEnvVar); } } function sanitize(str2) { @@ -157760,7 +157765,7 @@ async function run(startedAt) { } const apiDetails = getApiDetails(); const outputDir = getRequiredInput("output"); - core16.exportVariable("CODEQL_ACTION_SARIF_RESULTS_OUTPUT_DIR" /* SARIF_RESULTS_OUTPUT_DIR */, outputDir); + exportVariable2("CODEQL_ACTION_SARIF_RESULTS_OUTPUT_DIR" /* SARIF_RESULTS_OUTPUT_DIR */, outputDir); const threads = getThreadsFlag( getOptionalInput("threads") || process.env["CODEQL_THREADS"], logger @@ -157812,8 +157817,8 @@ async function run(startedAt) { for (const language of config.languages) { dbLocations[language] = getCodeQLDatabasePath(config, language); } - core16.setOutput("db-locations", dbLocations); - core16.setOutput("sarif-output", import_path4.default.resolve(outputDir)); + core14.setOutput("db-locations", dbLocations); + core14.setOutput("sarif-output", import_path4.default.resolve(outputDir)); const uploadKind = getUploadValue( getOptionalInput("upload") ); @@ -157830,13 +157835,13 @@ async function run(startedAt) { getOptionalInput("post-processed-sarif-path") ); if (uploadResults["code-scanning" /* CodeScanning */] !== void 0) { - core16.setOutput( + core14.setOutput( "sarif-id", uploadResults["code-scanning" /* CodeScanning */].sarifID ); } if (uploadResults["code-quality" /* CodeQuality */] !== void 0) { - core16.setOutput( + core14.setOutput( "quality-sarif-id", uploadResults["code-quality" /* CodeQuality */].sarifID ); @@ -157879,15 +157884,15 @@ async function run(startedAt) { ); } if (getOptionalInput("expect-error") === "true") { - core16.setFailed( + core14.setFailed( `expect-error input was set to true but no error was thrown.` ); } - core16.exportVariable("CODEQL_ACTION_ANALYZE_DID_COMPLETE_SUCCESSFULLY" /* ANALYZE_DID_COMPLETE_SUCCESSFULLY */, "true"); + exportVariable2("CODEQL_ACTION_ANALYZE_DID_COMPLETE_SUCCESSFULLY" /* ANALYZE_DID_COMPLETE_SUCCESSFULLY */, "true"); } catch (unwrappedError) { const error3 = wrapError(unwrappedError); if (getOptionalInput("expect-error") !== "true" || hasBadExpectErrorInput()) { - core16.setFailed(error3.message); + core14.setFailed(error3.message); } await sendStatusReport2( startedAt, @@ -157957,7 +157962,7 @@ async function runWrapper() { try { await run(startedAt); } catch (error3) { - core16.setFailed(`analyze action failed: ${getErrorMessage(error3)}`); + core14.setFailed(`analyze action failed: ${getErrorMessage(error3)}`); await sendUnhandledErrorStatusReport( "finish" /* Analyze */, startedAt, @@ -157970,14 +157975,14 @@ async function runWrapper() { // src/analyze-action-post.ts var fs25 = __toESM(require("fs")); -var core18 = __toESM(require_core()); +var core16 = __toESM(require_core()); // src/debug-artifacts.ts var fs24 = __toESM(require("fs")); var path21 = __toESM(require("path")); var artifact = __toESM(require_artifact2()); var artifactLegacy = __toESM(require_artifact_client2()); -var core17 = __toESM(require_core()); +var core15 = __toESM(require_core()); var import_archiver = __toESM(require_archiver()); // src/artifact-scanner.ts @@ -158401,10 +158406,10 @@ function getArtifactSuffix(matrix) { for (const matrixKey of Object.keys(matrixObject).sort()) suffix += `-${matrixObject[matrixKey]}`; } else { - core17.warning("User-specified `matrix` input is not an object."); + core15.warning("User-specified `matrix` input is not an object."); } } catch { - core17.warning( + core15.warning( "Could not parse user-specified `matrix` input into JSON. The debug artifact will not be named with the user's `matrix` input." ); } @@ -158414,7 +158419,7 @@ function getArtifactSuffix(matrix) { async function uploadDebugArtifacts(logger, toUpload, rootDir, artifactName, ghVariant, codeQlVersion) { const uploadSupported = isSafeArtifactUpload(codeQlVersion); if (!uploadSupported) { - core17.info( + 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"; @@ -158427,7 +158432,7 @@ async function uploadArtifacts(logger, toUpload, rootDir, artifactName, ghVarian } if (isInTestMode()) { await scanArtifactsForTokens(toUpload, logger); - core17.exportVariable("CODEQL_ACTION_ARTIFACT_SCAN_FINISHED", "true"); + exportVariable2("CODEQL_ACTION_ARTIFACT_SCAN_FINISHED", "true"); } const suffix = getArtifactSuffix(getOptionalInput("matrix")); const artifactUploader = await getArtifactUploaderClient(logger, ghVariant); @@ -158443,7 +158448,7 @@ async function uploadArtifacts(logger, toUpload, rootDir, artifactName, ghVarian ); return "upload-successful"; } catch (e) { - core17.warning(`Failed to upload debug artifacts: ${e}`); + core15.warning(`Failed to upload debug artifacts: ${e}`); return "upload-failed"; } } @@ -158466,7 +158471,7 @@ async function createPartialDatabaseBundle(config, language) { config.dbLocation, `${config.debugDatabaseName}-${language}-partial.zip` ); - core17.info( + core15.info( `${config.debugDatabaseName}-${language} is not finalized. Uploading partial database bundle at ${databaseBundlePath}...` ); if (fs24.existsSync(databaseBundlePath)) { @@ -158536,14 +158541,14 @@ async function runWrapper2() { } } } catch (error3) { - core18.setFailed( + core16.setFailed( `analyze post-action step failed: ${getErrorMessage(error3)}` ); } } // src/autobuild-action.ts -var core19 = __toESM(require_core()); +var core17 = __toESM(require_core()); async function sendCompletedStatusReport(config, logger, startedAt, allLanguages, failingLanguage, cause) { initializeEnvironment(getActionVersion()); const status = getActionsStatus(cause, failingLanguage); @@ -158610,7 +158615,7 @@ async function run2(startedAt) { await endTracingForCluster(codeql, config, logger); } catch (unwrappedError) { const error3 = wrapError(unwrappedError); - core19.setFailed( + core17.setFailed( `We were unable to automatically build your code. Please replace the call to the autobuild action with your custom build steps. ${error3.message}` ); await sendCompletedStatusReport( @@ -158623,7 +158628,7 @@ async function run2(startedAt) { ); return; } - core19.exportVariable("CODEQL_ACTION_AUTOBUILD_DID_COMPLETE_SUCCESSFULLY" /* AUTOBUILD_DID_COMPLETE_SUCCESSFULLY */, "true"); + exportVariable2("CODEQL_ACTION_AUTOBUILD_DID_COMPLETE_SUCCESSFULLY" /* AUTOBUILD_DID_COMPLETE_SUCCESSFULLY */, "true"); await sendCompletedStatusReport(config, logger, startedAt, languages ?? []); } async function runWrapper3() { @@ -158632,7 +158637,7 @@ async function runWrapper3() { try { await run2(startedAt); } catch (error3) { - core19.setFailed(`autobuild action failed. ${getErrorMessage(error3)}`); + core17.setFailed(`autobuild action failed. ${getErrorMessage(error3)}`); await sendUnhandledErrorStatusReport( "autobuild" /* Autobuild */, startedAt, @@ -158645,7 +158650,7 @@ async function runWrapper3() { // src/init-action.ts var fs27 = __toESM(require("fs")); var path23 = __toESM(require("path")); -var core21 = __toESM(require_core()); +var core19 = __toESM(require_core()); var github3 = __toESM(require_github()); var io7 = __toESM(require_io()); var semver10 = __toESM(require_semver2()); @@ -158654,7 +158659,7 @@ var semver10 = __toESM(require_semver2()); var fs26 = __toESM(require("fs")); var path22 = __toESM(require("path")); var import_zlib2 = __toESM(require("zlib")); -var core20 = __toESM(require_core()); +var core18 = __toESM(require_core()); function toCodedErrors(errors) { return Object.entries(errors).reduce( (acc, [code, message]) => { @@ -158777,7 +158782,7 @@ async function validateWorkflow(codeql, logger) { } catch (e) { return `error: formatWorkflowErrors() failed: ${String(e)}`; } - core20.warning(message); + core18.warning(message); } return formatWorkflowCause(workflowErrors); } @@ -158906,7 +158911,7 @@ function getCheckoutPathInputOrThrow(workflow, jobName, matrixVars) { } async function checkWorkflow(logger, codeql) { if (!isDynamicWorkflow() && process.env["CODEQL_ACTION_SKIP_WORKFLOW_VALIDATION" /* SKIP_WORKFLOW_VALIDATION */] !== "true") { - core20.startGroup("Validating workflow"); + core18.startGroup("Validating workflow"); const validateWorkflowResult = await internal2.validateWorkflow( codeql, logger @@ -158918,7 +158923,7 @@ async function checkWorkflow(logger, codeql) { `Unable to validate code scanning workflow: ${validateWorkflowResult}` ); } - core20.endGroup(); + core18.endGroup(); } } var internal2 = { @@ -159026,8 +159031,8 @@ async function run3(startedAt) { ); const jobRunUuid = v4_default(); logger.info(`Job run UUID is ${jobRunUuid}.`); - core21.exportVariable("JOB_RUN_UUID" /* JOB_RUN_UUID */, jobRunUuid); - core21.exportVariable("CODEQL_ACTION_INIT_HAS_RUN" /* INIT_ACTION_HAS_RUN */, "true"); + exportVariable2("JOB_RUN_UUID" /* JOB_RUN_UUID */, jobRunUuid); + exportVariable2("CODEQL_ACTION_INIT_HAS_RUN" /* INIT_ACTION_HAS_RUN */, "true"); configFile = getOptionalInput("config-file"); sourceRoot = path23.resolve( getRequiredEnvParam("GITHUB_WORKSPACE"), @@ -159084,12 +159089,12 @@ async function run3(startedAt) { ); } if (semver10.lt(actualVer, publicPreview)) { - core21.exportVariable("CODEQL_ENABLE_EXPERIMENTAL_FEATURES" /* EXPERIMENTAL_FEATURES */, "true"); + exportVariable2("CODEQL_ENABLE_EXPERIMENTAL_FEATURES" /* EXPERIMENTAL_FEATURES */, "true"); logger.info("Experimental Rust analysis enabled"); } } analysisKinds = await getAnalysisKinds(logger, features); - const debugMode = getOptionalInput("debug") === "true" || core21.isDebug(); + const debugMode = getOptionalInput("debug") === "true" || core19.isDebug(); const repositoryProperties = repositoryPropertiesResult.orElse({}); const fileCoverageResult = await getFileCoverageInformationEnabled( debugMode, @@ -159160,7 +159165,7 @@ async function run3(startedAt) { await checkInstallPython311(config.languages, codeql); } catch (unwrappedError) { const error3 = wrapError(unwrappedError); - core21.setFailed(error3.message); + core19.setFailed(error3.message); const statusReportBase = await createStatusReportBase( "init" /* Init */, error3 instanceof ConfigurationError ? "user-error" : "aborted", @@ -159215,8 +159220,8 @@ async function run3(startedAt) { } const goFlags = process.env["GOFLAGS"]; if (goFlags) { - core21.exportVariable("GOFLAGS", goFlags); - core21.warning( + exportVariable2("GOFLAGS", goFlags); + core19.warning( "Passing the GOFLAGS env parameter to the init action is deprecated. Please move this to the analyze action." ); } @@ -159235,7 +159240,7 @@ async function run3(startedAt) { "bin" ); fs27.mkdirSync(tempBinPath, { recursive: true }); - core21.addPath(tempBinPath); + core19.addPath(tempBinPath); const goWrapperPath = path23.resolve(tempBinPath, "go"); fs27.writeFileSync( goWrapperPath, @@ -159244,14 +159249,14 @@ async function run3(startedAt) { exec ${goBinaryPath} "$@"` ); fs27.chmodSync(goWrapperPath, "755"); - core21.exportVariable("CODEQL_ACTION_GO_BINARY" /* GO_BINARY_LOCATION */, goWrapperPath); + exportVariable2("CODEQL_ACTION_GO_BINARY" /* GO_BINARY_LOCATION */, goWrapperPath); } catch (e) { logger.warning( `Analyzing Go on Linux, but failed to install wrapper script. Tracing custom builds may fail: ${e}` ); } } else { - core21.exportVariable("CODEQL_ACTION_GO_BINARY" /* GO_BINARY_LOCATION */, goBinaryPath); + exportVariable2("CODEQL_ACTION_GO_BINARY" /* GO_BINARY_LOCATION */, goBinaryPath); } } catch (e) { logger.warning( @@ -159278,20 +159283,20 @@ exec ${goBinaryPath} "$@"` } } } - core21.exportVariable( + exportVariable2( "CODEQL_RAM", process.env["CODEQL_RAM"] || getCodeQLMemoryLimit(getOptionalInput("ram"), logger).toString() ); - core21.exportVariable( + exportVariable2( "CODEQL_THREADS", process.env["CODEQL_THREADS"] || getThreadsFlagValue(getOptionalInput("threads"), logger).toString() ); if (await features.getValue("disable_kotlin_analysis_enabled" /* DisableKotlinAnalysisEnabled */)) { - core21.exportVariable("CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN", "true"); + exportVariable2("CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN", "true"); } const kotlinLimitVar = "CODEQL_EXTRACTOR_KOTLIN_OVERRIDE_MAXIMUM_VERSION_LIMIT"; if (await codeQlVersionAtLeast(codeql, "2.20.3") && !await codeQlVersionAtLeast(codeql, "2.20.4")) { - core21.exportVariable(kotlinLimitVar, "2.1.20"); + exportVariable2(kotlinLimitVar, "2.1.20"); } if (shouldRestoreCache(config.dependencyCachingEnabled)) { const dependencyCachingResult = await downloadDependencyCaches( @@ -159318,10 +159323,7 @@ exec ${goBinaryPath} "$@"` `${"CODEQL_EXTRACTOR_JAVA_OPTION_MINIMIZE_DEPENDENCY_JARS" /* JAVA_EXTRACTOR_MINIMIZE_DEPENDENCY_JARS */} is already set to '${process.env["CODEQL_EXTRACTOR_JAVA_OPTION_MINIMIZE_DEPENDENCY_JARS" /* JAVA_EXTRACTOR_MINIMIZE_DEPENDENCY_JARS */]}', so the Action will not override it.` ); } else if (await codeQlVersionAtLeast(codeql, CODEQL_VERSION_JAR_MINIMIZATION) && config.dependencyCachingEnabled && config.buildMode === "none" /* None */ && config.languages.includes("java" /* java */)) { - core21.exportVariable( - "CODEQL_EXTRACTOR_JAVA_OPTION_MINIMIZE_DEPENDENCY_JARS" /* JAVA_EXTRACTOR_MINIMIZE_DEPENDENCY_JARS */, - "true" - ); + exportVariable2("CODEQL_EXTRACTOR_JAVA_OPTION_MINIMIZE_DEPENDENCY_JARS" /* JAVA_EXTRACTOR_MINIMIZE_DEPENDENCY_JARS */, "true"); } const { registriesAuthTokens, qlconfigFile } = await generateRegistries( getOptionalInput("registries"), @@ -159362,23 +159364,23 @@ exec ${goBinaryPath} "$@"` const tracerConfig = await getCombinedTracerConfig(codeql, config); if (tracerConfig !== void 0) { for (const [key, value] of Object.entries(tracerConfig.env)) { - core21.exportVariable(key, value); + exportVariable2(key, value); } } if (await features.getValue("java_network_debugging" /* JavaNetworkDebugging */)) { const existingJavaToolOptions = getOptionalEnvVar("JAVA_TOOL_OPTIONS" /* JAVA_TOOL_OPTIONS */) || ""; - core21.exportVariable( + exportVariable2( "JAVA_TOOL_OPTIONS" /* JAVA_TOOL_OPTIONS */, `${existingJavaToolOptions} -Djavax.net.debug=all` ); } flushDiagnostics(config); await saveConfig(config, logger); - core21.setOutput("codeql-path", config.codeQLCmd); - core21.setOutput("codeql-version", (await codeql.getVersion()).version); + core19.setOutput("codeql-path", config.codeQLCmd); + core19.setOutput("codeql-version", (await codeql.getVersion()).version); } catch (unwrappedError) { const error3 = wrapError(unwrappedError); - core21.setFailed(error3.message); + core19.setFailed(error3.message); await sendCompletedStatusReport2( startedAt, config, @@ -159446,7 +159448,7 @@ async function runWrapper4() { try { await run3(startedAt); } catch (error3) { - core21.setFailed(`init action failed: ${getErrorMessage(error3)}`); + core19.setFailed(`init action failed: ${getErrorMessage(error3)}`); await sendUnhandledErrorStatusReport( "init" /* Init */, startedAt, @@ -159458,7 +159460,7 @@ async function runWrapper4() { } // src/init-action-post.ts -var core22 = __toESM(require_core()); +var core20 = __toESM(require_core()); // src/init-action-post-helper.ts var fs28 = __toESM(require("fs")); @@ -159806,7 +159808,7 @@ async function run4(startedAt) { } } catch (unwrappedError) { const error3 = wrapError(unwrappedError); - core22.setFailed(error3.message); + core20.setFailed(error3.message); const statusReportBase2 = await createStatusReportBase( "init-post" /* InitPost */, getActionsStatus(error3), @@ -159851,14 +159853,14 @@ function getFinalJobStatus(config) { } let jobStatus; if (process.env["CODEQL_ACTION_ANALYZE_DID_COMPLETE_SUCCESSFULLY" /* ANALYZE_DID_COMPLETE_SUCCESSFULLY */] === "true") { - core22.exportVariable("CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */, "JOB_STATUS_SUCCESS" /* SuccessStatus */); + exportVariable2("CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */, "JOB_STATUS_SUCCESS" /* SuccessStatus */); jobStatus = "JOB_STATUS_SUCCESS" /* SuccessStatus */; } else if (config !== void 0) { jobStatus = "JOB_STATUS_CONFIGURATION_ERROR" /* ConfigErrorStatus */; } else { jobStatus = "JOB_STATUS_UNKNOWN" /* UnknownStatus */; } - core22.exportVariable("CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */, jobStatus); + exportVariable2("CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */, jobStatus); return jobStatus; } function getJobStatusFromEnvironment() { @@ -159877,7 +159879,7 @@ async function runWrapper5() { try { await run4(startedAt); } catch (error3) { - core22.setFailed(`init post action failed: ${wrapError(error3).message}`); + core20.setFailed(`init post action failed: ${wrapError(error3).message}`); await sendUnhandledErrorStatusReport( "init-post" /* InitPost */, startedAt, @@ -159888,7 +159890,7 @@ async function runWrapper5() { } // src/resolve-environment-action.ts -var core23 = __toESM(require_core()); +var core21 = __toESM(require_core()); // src/resolve-environment.ts async function runResolveBuildEnvironment(cmd, logger, workingDir, language) { @@ -159935,16 +159937,16 @@ async function run5(startedAt) { workingDirectory, getRequiredInput("language") ); - core23.setOutput(ENVIRONMENT_OUTPUT_NAME, result); + core21.setOutput(ENVIRONMENT_OUTPUT_NAME, result); } catch (unwrappedError) { const error3 = wrapError(unwrappedError); if (error3 instanceof CliError) { - core23.setOutput(ENVIRONMENT_OUTPUT_NAME, {}); + core21.setOutput(ENVIRONMENT_OUTPUT_NAME, {}); logger.warning( `Failed to resolve a build environment suitable for automatically building your code. ${error3.message}` ); } else { - core23.setFailed( + core21.setFailed( `Failed to resolve a build environment suitable for automatically building your code. ${error3.message}` ); const statusReportBase2 = await createStatusReportBase( @@ -159981,7 +159983,7 @@ async function runWrapper6() { try { await run5(startedAt); } catch (error3) { - core23.setFailed( + core21.setFailed( `${"resolve-environment" /* ResolveEnvironment */} action failed: ${getErrorMessage( error3 )}` @@ -159997,7 +159999,7 @@ async function runWrapper6() { } // src/setup-codeql-action.ts -var core24 = __toESM(require_core()); +var core22 = __toESM(require_core()); async function sendCompletedStatusReport3(startedAt, toolsDownloadStatusReport, toolsFeatureFlagsValid, toolsSource, toolsVersion, logger, error3) { const statusReportBase = await createStatusReportBase( "setup-codeql" /* SetupCodeQL */, @@ -160055,7 +160057,7 @@ async function run6(startedAt) { ); const jobRunUuid = v4_default(); logger.info(`Job run UUID is ${jobRunUuid}.`); - core24.exportVariable("JOB_RUN_UUID" /* JOB_RUN_UUID */, jobRunUuid); + exportVariable2("JOB_RUN_UUID" /* JOB_RUN_UUID */, jobRunUuid); const statusReportBase = await createStatusReportBase( "setup-codeql" /* SetupCodeQL */, "starting", @@ -160088,12 +160090,12 @@ async function run6(startedAt) { toolsDownloadStatusReport = initCodeQLResult.toolsDownloadStatusReport; toolsVersion = initCodeQLResult.toolsVersion; toolsSource = initCodeQLResult.toolsSource; - core24.setOutput("codeql-path", codeql.getPath()); - core24.setOutput("codeql-version", (await codeql.getVersion()).version); - core24.exportVariable("CODEQL_ACTION_SETUP_CODEQL_HAS_RUN" /* SETUP_CODEQL_ACTION_HAS_RUN */, "true"); + core22.setOutput("codeql-path", codeql.getPath()); + core22.setOutput("codeql-version", (await codeql.getVersion()).version); + exportVariable2("CODEQL_ACTION_SETUP_CODEQL_HAS_RUN" /* SETUP_CODEQL_ACTION_HAS_RUN */, "true"); } catch (unwrappedError) { const error3 = wrapError(unwrappedError); - core24.setFailed(error3.message); + core22.setFailed(error3.message); const statusReportBase = await createStatusReportBase( "setup-codeql" /* SetupCodeQL */, error3 instanceof ConfigurationError ? "user-error" : "failure", @@ -160124,7 +160126,7 @@ async function runWrapper7() { try { await run6(startedAt); } catch (error3) { - core24.setFailed(`setup-codeql action failed: ${getErrorMessage(error3)}`); + core22.setFailed(`setup-codeql action failed: ${getErrorMessage(error3)}`); await sendUnhandledErrorStatusReport( "setup-codeql" /* SetupCodeQL */, startedAt, @@ -160138,11 +160140,11 @@ async function runWrapper7() { // src/start-proxy-action.ts var import_child_process2 = require("child_process"); var path27 = __toESM(require("path")); -var core27 = __toESM(require_core()); +var core25 = __toESM(require_core()); // src/start-proxy.ts var path25 = __toESM(require("path")); -var core26 = __toESM(require_core()); +var core24 = __toESM(require_core()); var toolcache4 = __toESM(require_tool_cache()); // src/start-proxy/types.ts @@ -160282,7 +160284,7 @@ function getAddressString(address) { } // src/start-proxy/validation.ts -var core25 = __toESM(require_core()); +var core23 = __toESM(require_core()); function cloneCredential(schema2, obj) { const result = {}; for (const key of Object.keys(schema2)) { @@ -160301,14 +160303,14 @@ function getAuthConfig(config) { } if (isToken(config)) { if (isDefined2(config.token)) { - core25.setSecret(config.token); + core23.setSecret(config.token); } return cloneCredential(tokenSchema, config); } else { let username = void 0; let password = void 0; if ("password" in config && isString(config.password)) { - core25.setSecret(config.password); + core23.setSecret(config.password); password = config.password; } if ("username" in config && isString(config.username)) { @@ -160364,7 +160366,7 @@ function getSafeErrorMessage(error3) { } async function sendFailedStatusReport(logger, startedAt, language, unwrappedError) { const error3 = wrapError(unwrappedError); - core26.setFailed(`start-proxy action failed: ${error3.message}`); + core24.setFailed(`start-proxy action failed: ${error3.message}`); const statusReportMessage = getSafeErrorMessage(error3); const errorStatusReportBase = await createStatusReportBase( "start-proxy" /* StartProxy */, @@ -160943,7 +160945,7 @@ async function run7(startedAt) { persistInputs(); const tempDir = getTemporaryDirectory(); const proxyLogFilePath = path27.resolve(tempDir, "proxy.log"); - core27.saveState("proxy-log-file", proxyLogFilePath); + core25.saveState("proxy-log-file", proxyLogFilePath); const repositoryNwo = getRepositoryNwo(); const gitHubVersion = await getGitHubVersion(); features = initFeatures( @@ -160972,7 +160974,7 @@ async function run7(startedAt) { `Credentials loaded for the following registries: ${credentials.map((c) => credentialToStr(c)).join("\n")}` ); - if (core27.isDebug() || isInTestMode()) { + if (core25.isDebug() || isInTestMode()) { try { await checkProxyEnvironment(logger, language); } catch (err) { @@ -161012,7 +161014,7 @@ async function runWrapper8() { try { await run7(startedAt); } catch (error3) { - core27.setFailed(`start-proxy action failed: ${getErrorMessage(error3)}`); + core25.setFailed(`start-proxy action failed: ${getErrorMessage(error3)}`); await sendUnhandledErrorStatusReport( "start-proxy" /* StartProxy */, startedAt, @@ -161038,7 +161040,7 @@ async function startProxy(binPath, config, logFilePath, logger) { ); subprocess.unref(); if (subprocess.pid) { - core27.saveState("proxy-process-pid", `${subprocess.pid}`); + core25.saveState("proxy-process-pid", `${subprocess.pid}`); } subprocess.on("error", (error3) => { subprocessError = error3; @@ -161057,25 +161059,25 @@ async function startProxy(binPath, config, logFilePath, logger) { throw subprocessError; } logger.info(`Proxy started on ${host}:${port}`); - core27.setOutput("proxy_host", host); - core27.setOutput("proxy_port", port.toString()); - core27.setOutput("proxy_ca_certificate", config.ca.cert); + core25.setOutput("proxy_host", host); + core25.setOutput("proxy_port", port.toString()); + core25.setOutput("proxy_ca_certificate", config.ca.cert); const registry_urls = config.all_credentials.filter((credential) => credential.url !== void 0).map((credential) => ({ type: credential.type, url: credential.url, "replaces-base": credential["replaces-base"] })); - core27.setOutput("proxy_urls", JSON.stringify(registry_urls)); + core25.setOutput("proxy_urls", JSON.stringify(registry_urls)); return { host, port, cert: config.ca.cert, registries: registry_urls }; } // src/start-proxy-action-post.ts -var core28 = __toESM(require_core()); +var core26 = __toESM(require_core()); async function runWrapper9() { const logger = getActionsLogger(); try { restoreInputs(); - const pid = core28.getState("proxy-process-pid"); + const pid = core26.getState("proxy-process-pid"); if (pid) { process.kill(Number(pid)); } @@ -161083,8 +161085,8 @@ async function runWrapper9() { getTemporaryDirectory(), logger ); - if (config?.debugMode || core28.isDebug()) { - const logFilePath = core28.getState("proxy-log-file"); + if (config?.debugMode || core26.isDebug()) { + const logFilePath = core26.getState("proxy-log-file"); logger.info( "Debug mode is on. Uploading proxy log as Actions debugging artifact..." ); @@ -161112,7 +161114,7 @@ async function runWrapper9() { } // src/upload-sarif-action.ts -var core29 = __toESM(require_core()); +var core27 = __toESM(require_core()); async function sendSuccessStatusReport2(startedAt, uploadStats, logger) { const statusReportBase = await createStatusReportBase( "upload-sarif" /* UploadSarif */, @@ -161173,11 +161175,11 @@ async function run8(startedAt) { } const codeScanningResult = uploadResults["code-scanning" /* CodeScanning */]; if (codeScanningResult !== void 0) { - core29.setOutput("sarif-id", codeScanningResult.sarifID); + core27.setOutput("sarif-id", codeScanningResult.sarifID); } - core29.setOutput("sarif-ids", JSON.stringify(uploadResults)); + core27.setOutput("sarif-ids", JSON.stringify(uploadResults)); if (shouldSkipSarifUpload()) { - core29.debug( + core27.debug( "SARIF upload disabled by an environment variable. Waiting for processing is disabled." ); } else if (getRequiredInput("wait-for-processing") === "true") { @@ -161197,7 +161199,7 @@ async function run8(startedAt) { } catch (unwrappedError) { const error3 = isThirdPartyAnalysis("upload-sarif" /* UploadSarif */) && unwrappedError instanceof InvalidSarifUploadError ? new ConfigurationError(unwrappedError.message) : wrapError(unwrappedError); const message = error3.message; - core29.setFailed(message); + core27.setFailed(message); const errorStatusReportBase = await createStatusReportBase( "upload-sarif" /* UploadSarif */, getActionsStatus(error3), @@ -161220,7 +161222,7 @@ async function runWrapper10() { try { await run8(startedAt); } catch (error3) { - core29.setFailed( + core27.setFailed( `codeql/upload-sarif action failed: ${getErrorMessage(error3)}` ); await sendUnhandledErrorStatusReport( @@ -161233,7 +161235,7 @@ async function runWrapper10() { } // src/upload-sarif-action-post.ts -var core30 = __toESM(require_core()); +var core28 = __toESM(require_core()); async function runWrapper11() { try { restoreInputs(); @@ -161242,7 +161244,7 @@ async function runWrapper11() { checkGitHubVersionInRange(gitHubVersion, logger); if (process.env["CODEQL_ACTION_INIT_HAS_RUN" /* INIT_ACTION_HAS_RUN */] !== "true") { if (gitHubVersion.type === void 0) { - core30.warning( + core28.warning( `Did not upload debug artifacts because cannot determine the GitHub variant running.` ); return; @@ -161259,7 +161261,7 @@ async function runWrapper11() { ); } } catch (error3) { - core30.setFailed( + core28.setFailed( `upload-sarif post-action step failed: ${getErrorMessage(error3)}` ); } diff --git a/queries/default-setup-environment-variables.ql b/queries/default-setup-environment-variables.ql index 9f677dfb9b..3032cefe07 100644 --- a/queries/default-setup-environment-variables.ql +++ b/queries/default-setup-environment-variables.ql @@ -23,7 +23,8 @@ predicate isSafeForDefaultSetup(string envVar) { "GITHUB_BASE_REF", "GITHUB_EVENT_NAME", "GITHUB_JOB", "GITHUB_RUN_ATTEMPT", "GITHUB_RUN_ID", "GITHUB_SHA", "GITHUB_REPOSITORY", "GITHUB_SERVER_URL", "GITHUB_TOKEN", "GITHUB_WORKFLOW", "GITHUB_WORKSPACE", "GOFLAGS", "ImageVersion", "JAVA_TOOL_OPTIONS", "RUNNER_ARCH", - "RUNNER_ENVIRONMENT", "RUNNER_NAME", "RUNNER_OS", "RUNNER_TEMP", "RUNNER_TOOL_CACHE" + "RUNNER_ENVIRONMENT", "RUNNER_NAME", "RUNNER_OS", "RUNNER_TEMP", "RUNNER_TOOL_CACHE", + "NODE_ENV" ] } diff --git a/src/analyze-action.ts b/src/analyze-action.ts index cc2777bc5f..44c48d14ad 100644 --- a/src/analyze-action.ts +++ b/src/analyze-action.ts @@ -28,7 +28,7 @@ import { DependencyCacheUploadStatusReport, uploadDependencyCaches, } from "./dependency-caching"; -import { EnvVar } from "./environment"; +import { EnvVar, exportVariable } from "./environment"; import { initFeatures } from "./feature-flags"; import { BuiltInLanguage } from "./languages"; import { getActionsLogger, Logger } from "./logging"; @@ -284,7 +284,7 @@ async function run(startedAt: Date) { const apiDetails = getApiDetails(); const outputDir = actionsUtil.getRequiredInput("output"); - core.exportVariable(EnvVar.SARIF_RESULTS_OUTPUT_DIR, outputDir); + exportVariable(EnvVar.SARIF_RESULTS_OUTPUT_DIR, outputDir); const threads = util.getThreadsFlag( actionsUtil.getOptionalInput("threads") || process.env["CODEQL_THREADS"], logger, @@ -444,7 +444,7 @@ async function run(startedAt: Date) { `expect-error input was set to true but no error was thrown.`, ); } - core.exportVariable(EnvVar.ANALYZE_DID_COMPLETE_SUCCESSFULLY, "true"); + exportVariable(EnvVar.ANALYZE_DID_COMPLETE_SUCCESSFULLY, "true"); } catch (unwrappedError) { const error = util.wrapError(unwrappedError); if ( diff --git a/src/api-client.ts b/src/api-client.ts index 4a061d4828..a70834541a 100644 --- a/src/api-client.ts +++ b/src/api-client.ts @@ -3,7 +3,7 @@ import * as githubUtils from "@actions/github/lib/utils"; import * as retry from "@octokit/plugin-retry"; import { getActionVersion, getRequiredInput } from "./actions-util"; -import { EnvVar } from "./environment"; +import { EnvVar, exportVariable } from "./environment"; import { Logger } from "./logging"; import { getRepositoryNwo, RepositoryNwo } from "./repository"; import { @@ -216,7 +216,7 @@ export async function getAnalysisKey(): Promise { const jobName = getRequiredEnvParam("GITHUB_JOB"); analysisKey = `${workflowPath}:${jobName}`; - core.exportVariable(EnvVar.ANALYSIS_KEY, analysisKey); + exportVariable(EnvVar.ANALYSIS_KEY, analysisKey); return analysisKey; } diff --git a/src/autobuild-action.ts b/src/autobuild-action.ts index dc20211379..ef8ea35eab 100644 --- a/src/autobuild-action.ts +++ b/src/autobuild-action.ts @@ -9,7 +9,7 @@ import { getGitHubVersion } from "./api-client"; import { determineAutobuildLanguages, runAutobuild } from "./autobuild"; import { getCodeQL } from "./codeql"; import { Config, getConfig } from "./config-utils"; -import { EnvVar } from "./environment"; +import { EnvVar, exportVariable } from "./environment"; import { Language } from "./languages"; import { Logger, getActionsLogger } from "./logging"; import { @@ -137,7 +137,7 @@ async function run(startedAt: Date) { return; } - core.exportVariable(EnvVar.AUTOBUILD_DID_COMPLETE_SUCCESSFULLY, "true"); + exportVariable(EnvVar.AUTOBUILD_DID_COMPLETE_SUCCESSFULLY, "true"); await sendCompletedStatusReport(config, logger, startedAt, languages ?? []); } diff --git a/src/autobuild.ts b/src/autobuild.ts index fc4983f4ef..e3974ab7f6 100644 --- a/src/autobuild.ts +++ b/src/autobuild.ts @@ -1,11 +1,9 @@ -import * as core from "@actions/core"; - import { getTemporaryDirectory, getWorkflowEventName } from "./actions-util"; import { getGitHubVersion } from "./api-client"; import { CodeQL, getCodeQL } from "./codeql"; import * as configUtils from "./config-utils"; import { DocUrl } from "./doc-url"; -import { EnvVar } from "./environment"; +import { EnvVar, exportVariable } from "./environment"; import { Feature, featureConfig, initFeatures } from "./feature-flags"; import { BuiltInLanguage, Language } from "./languages"; import { Logger } from "./logging"; @@ -136,16 +134,16 @@ export async function setupCppAutobuild(codeql: CodeQL, logger: Logger) { : "" }`, ); - core.exportVariable(envVar, "false"); + exportVariable(envVar, "false"); } else { logger.info( `Enabling ${featureName}. This can be disabled by setting the ${envVar} environment variable to 'false'. See ${DocUrl.DEFINE_ENV_VARIABLES} for more information.`, ); - core.exportVariable(envVar, "true"); + exportVariable(envVar, "true"); } } else { logger.info(`Disabling ${featureName}.`); - core.exportVariable(envVar, "false"); + exportVariable(envVar, "false"); } } @@ -165,7 +163,7 @@ export async function runAutobuild( await codeQL.runAutobuild(config, language); } if (language === BuiltInLanguage.go) { - core.exportVariable(EnvVar.DID_AUTOBUILD_GOLANG, "true"); + exportVariable(EnvVar.DID_AUTOBUILD_GOLANG, "true"); } logger.endGroup(); } diff --git a/src/codeql.ts b/src/codeql.ts index 19f933c39a..723740c3f9 100644 --- a/src/codeql.ts +++ b/src/codeql.ts @@ -15,7 +15,7 @@ import * as api from "./api-client"; import { CliError, wrapCliConfigurationError } from "./cli-errors"; import { appendExtraQueryExclusions, type Config } from "./config-utils"; import { DocUrl } from "./doc-url"; -import { EnvVar } from "./environment"; +import { EnvVar, exportVariable } from "./environment"; import { CodeQLDefaultVersionInfo, Feature, @@ -1096,7 +1096,7 @@ async function getCodeQLForCmd( }' by 'github/codeql-action/*@v${getActionVersion()}' in your code scanning workflow to ` + "continue using this version of the CodeQL Action.", ); - core.exportVariable(EnvVar.SUPPRESS_DEPRECATED_SOON_WARNING, "true"); + exportVariable(EnvVar.SUPPRESS_DEPRECATED_SOON_WARNING, "true"); } return codeql; } diff --git a/src/config-utils.ts b/src/config-utils.ts index 87329fce2e..573a5debb7 100644 --- a/src/config-utils.ts +++ b/src/config-utils.ts @@ -2,7 +2,6 @@ import * as fs from "fs"; import * as path from "path"; import { performance } from "perf_hooks"; -import * as core from "@actions/core"; import * as yaml from "js-yaml"; import { @@ -32,7 +31,7 @@ import { makeTelemetryDiagnostic, } from "./diagnostics"; import { prepareDiffInformedAnalysis } from "./diff-informed-analysis-utils"; -import { EnvVar } from "./environment"; +import { EnvVar, exportVariable } from "./environment"; import * as errorMessages from "./error-messages"; import { Feature, FeatureEnablement } from "./feature-flags"; import { @@ -1045,10 +1044,10 @@ async function setCppTrapCachingEnvironmentVariables( ); } else if (config.trapCaches[BuiltInLanguage.cpp]) { logger.info("Enabling TRAP caching for C/C++."); - core.exportVariable(envVar, "true"); + exportVariable(envVar, "true"); } else { logger.debug(`Disabling TRAP caching for C/C++.`); - core.exportVariable(envVar, "false"); + exportVariable(envVar, "false"); } } } diff --git a/src/debug-artifacts.ts b/src/debug-artifacts.ts index 016fcdf7c4..d82390896e 100644 --- a/src/debug-artifacts.ts +++ b/src/debug-artifacts.ts @@ -11,7 +11,7 @@ import { dbIsFinalized } from "./analyze"; import { scanArtifactsForTokens } from "./artifact-scanner"; import { type CodeQL } from "./codeql"; import { Config } from "./config-utils"; -import { EnvVar } from "./environment"; +import { EnvVar, exportVariable } from "./environment"; import * as json from "./json"; import { Language } from "./languages"; import { Logger, withGroup } from "./logging"; @@ -330,7 +330,7 @@ export async function uploadArtifacts( // some issues early. if (isInTestMode()) { await scanArtifactsForTokens(toUpload, logger); - core.exportVariable("CODEQL_ACTION_ARTIFACT_SCAN_FINISHED", "true"); + exportVariable("CODEQL_ACTION_ARTIFACT_SCAN_FINISHED", "true"); } const suffix = getArtifactSuffix(getOptionalInput("matrix")); diff --git a/src/environment.ts b/src/environment.ts index ed44ddcff2..c7f8d292e8 100644 --- a/src/environment.ts +++ b/src/environment.ts @@ -1,3 +1,5 @@ +import * as core from "@actions/core"; + /** * Environment variables used by the CodeQL Action. * @@ -154,3 +156,29 @@ export enum EnvVar { /** Used by Code Scanning Risk Assessment to communicate the assessment ID to the CodeQL Action. */ RISK_ASSESSMENT_ID = "CODEQL_ACTION_RISK_ASSESSMENT_ID", } + +/** + * Returns whether we are in test mode. This is used by CodeQL Action PR checks. + * + * In test mode, we skip several uploads (SARIF results, status reports, DBs, ...). + */ +export function isInTestMode(): boolean { + return process.env[EnvVar.TEST_MODE] === "true"; +} + +/** + * Wrapper around `core.exportVariable` which does not call `core.exportVariable` + * when running unit tests. This is important, because otherwise `core.exportVariable` + * sets environment variables for other steps in a workflow when we run unit tests in CI. + */ +export function exportVariable(name: string, val: any): void { + if (process.env["NODE_ENV"] === "test") { + // Setting the environment variable for the current process is OK since we reset + // those at the end of each test. This allows tests to pass that rely on that + // part of the `core.exportVariable` behaviour. + process.env[name] = val; + } else { + // Call `core.exportVariable` whenever we are not in a test environment. + core.exportVariable(name, val); + } +} diff --git a/src/init-action-post.ts b/src/init-action-post.ts index b407cfb99e..1bed084737 100644 --- a/src/init-action-post.ts +++ b/src/init-action-post.ts @@ -20,7 +20,7 @@ import { DependencyCachingUsageReport, getDependencyCacheUsage, } from "./dependency-caching"; -import { EnvVar } from "./environment"; +import { EnvVar, exportVariable } from "./environment"; import { initFeatures } from "./feature-flags"; import * as gitUtils from "./git-utils"; import * as initActionPostHelper from "./init-action-post-helper"; @@ -157,7 +157,7 @@ function getFinalJobStatus(config: Config | undefined): JobStatus { let jobStatus: JobStatus; if (process.env[EnvVar.ANALYZE_DID_COMPLETE_SUCCESSFULLY] === "true") { - core.exportVariable(EnvVar.JOB_STATUS, JobStatus.SuccessStatus); + exportVariable(EnvVar.JOB_STATUS, JobStatus.SuccessStatus); jobStatus = JobStatus.SuccessStatus; } else if (config !== undefined) { // - We have computed a CodeQL config @@ -182,7 +182,7 @@ function getFinalJobStatus(config: Config | undefined): JobStatus { // This shouldn't be necessary, but in the odd case that we run more than one // `init` post step, ensure the job status is consistent between them. - core.exportVariable(EnvVar.JOB_STATUS, jobStatus); + exportVariable(EnvVar.JOB_STATUS, jobStatus); return jobStatus; } diff --git a/src/init-action.ts b/src/init-action.ts index 9d2619b1d1..93680f32f3 100644 --- a/src/init-action.ts +++ b/src/init-action.ts @@ -37,7 +37,7 @@ import { makeDiagnostic, makeTelemetryDiagnostic, } from "./diagnostics"; -import { EnvVar } from "./environment"; +import { EnvVar, exportVariable } from "./environment"; import { Feature, FeatureEnablement, initFeatures } from "./feature-flags"; import { loadPropertiesFromApi, @@ -255,9 +255,9 @@ async function run(startedAt: Date) { // Create a unique identifier for this run. const jobRunUuid = uuidV4(); logger.info(`Job run UUID is ${jobRunUuid}.`); - core.exportVariable(EnvVar.JOB_RUN_UUID, jobRunUuid); + exportVariable(EnvVar.JOB_RUN_UUID, jobRunUuid); - core.exportVariable(EnvVar.INIT_ACTION_HAS_RUN, "true"); + exportVariable(EnvVar.INIT_ACTION_HAS_RUN, "true"); configFile = getOptionalInput("config-file"); @@ -343,7 +343,7 @@ async function run(startedAt: Date) { ); } if (semver.lt(actualVer, publicPreview)) { - core.exportVariable(EnvVar.EXPERIMENTAL_FEATURES, "true"); + exportVariable(EnvVar.EXPERIMENTAL_FEATURES, "true"); logger.info("Experimental Rust analysis enabled"); } } @@ -508,7 +508,7 @@ async function run(startedAt: Date) { // Forward Go flags const goFlags = process.env["GOFLAGS"]; if (goFlags) { - core.exportVariable("GOFLAGS", goFlags); + exportVariable("GOFLAGS", goFlags); core.warning( "Passing the GOFLAGS env parameter to the init action is deprecated. Please move this to the analyze action.", ); @@ -554,7 +554,7 @@ async function run(startedAt: Date) { // Store the original location of our wrapper script somewhere where we can // later retrieve it from and cross-check that it hasn't been changed. - core.exportVariable(EnvVar.GO_BINARY_LOCATION, goWrapperPath); + exportVariable(EnvVar.GO_BINARY_LOCATION, goWrapperPath); } catch (e) { logger.warning( `Analyzing Go on Linux, but failed to install wrapper script. Tracing custom builds may fail: ${e}`, @@ -563,7 +563,7 @@ async function run(startedAt: Date) { } else { // Store the location of the original Go binary, so we can check that no setup tasks were performed after the // `init` Action ran. - core.exportVariable(EnvVar.GO_BINARY_LOCATION, goBinaryPath); + exportVariable(EnvVar.GO_BINARY_LOCATION, goBinaryPath); } } catch (e) { logger.warning( @@ -598,12 +598,12 @@ async function run(startedAt: Date) { // threads it would ask extractors to use. See help text for the "--ram" and "--threads" // options at https://codeql.github.com/docs/codeql-cli/manual/database-trace-command/ // for details. - core.exportVariable( + exportVariable( "CODEQL_RAM", process.env["CODEQL_RAM"] || getCodeQLMemoryLimit(getOptionalInput("ram"), logger).toString(), ); - core.exportVariable( + exportVariable( "CODEQL_THREADS", process.env["CODEQL_THREADS"] || getThreadsFlagValue(getOptionalInput("threads"), logger).toString(), @@ -611,7 +611,7 @@ async function run(startedAt: Date) { // Disable Kotlin extractor if feature flag set if (await features.getValue(Feature.DisableKotlinAnalysisEnabled)) { - core.exportVariable("CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN", "true"); + exportVariable("CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN", "true"); } const kotlinLimitVar = @@ -620,7 +620,7 @@ async function run(startedAt: Date) { (await codeQlVersionAtLeast(codeql, "2.20.3")) && !(await codeQlVersionAtLeast(codeql, "2.20.4")) ) { - core.exportVariable(kotlinLimitVar, "2.1.20"); + exportVariable(kotlinLimitVar, "2.1.20"); } // Restore dependency cache(s), if they exist. @@ -669,10 +669,7 @@ async function run(startedAt: Date) { config.buildMode === BuildMode.None && config.languages.includes(BuiltInLanguage.java) ) { - core.exportVariable( - EnvVar.JAVA_EXTRACTOR_MINIMIZE_DEPENDENCY_JARS, - "true", - ); + exportVariable(EnvVar.JAVA_EXTRACTOR_MINIMIZE_DEPENDENCY_JARS, "true"); } const { registriesAuthTokens, qlconfigFile } = @@ -729,7 +726,7 @@ async function run(startedAt: Date) { const tracerConfig = await getCombinedTracerConfig(codeql, config); if (tracerConfig !== undefined) { for (const [key, value] of Object.entries(tracerConfig.env)) { - core.exportVariable(key, value); + exportVariable(key, value); } } @@ -740,7 +737,7 @@ async function run(startedAt: Date) { getOptionalEnvVar(JavaEnvVars.JAVA_TOOL_OPTIONS) || ""; // Add the network debugging options. - core.exportVariable( + exportVariable( JavaEnvVars.JAVA_TOOL_OPTIONS, `${existingJavaToolOptions} -Djavax.net.debug=all`, ); diff --git a/src/init.test.ts b/src/init.test.ts index 88ad0c9b18..8c764bd162 100644 --- a/src/init.test.ts +++ b/src/init.test.ts @@ -1,13 +1,13 @@ import * as fs from "fs"; import path from "path"; -import * as core from "@actions/core"; import * as github from "@actions/github"; import test, { ExecutionContext } from "ava"; import * as sinon from "sinon"; import * as actionsUtil from "./actions-util"; import { createStubCodeQL } from "./codeql"; +import * as environment from "./environment"; import { Feature } from "./feature-flags"; import { checkPacksForOverlayCompatibility, @@ -545,7 +545,7 @@ test.serial( test.serial( "file coverage deprecation warning for org-owned repo with default setup recommends repo property", (t) => { - const exportVariableStub = sinon.stub(core, "exportVariable"); + const exportVariableStub = sinon.stub(environment, "exportVariable"); sinon.stub(actionsUtil, "isDefaultSetup").returns(true); github.context.payload = { repository: { @@ -572,7 +572,7 @@ test.serial( test.serial( "file coverage deprecation warning for org-owned repo with advanced setup recommends env var and repo property", (t) => { - const exportVariableStub = sinon.stub(core, "exportVariable"); + const exportVariableStub = sinon.stub(environment, "exportVariable"); sinon.stub(actionsUtil, "isDefaultSetup").returns(false); github.context.payload = { repository: { @@ -600,7 +600,7 @@ test.serial( test.serial( "file coverage deprecation warning for user-owned repo with default setup recommends advanced setup", (t) => { - const exportVariableStub = sinon.stub(core, "exportVariable"); + const exportVariableStub = sinon.stub(environment, "exportVariable"); sinon.stub(actionsUtil, "isDefaultSetup").returns(true); github.context.payload = { repository: { @@ -626,7 +626,7 @@ test.serial( test.serial( "file coverage deprecation warning for user-owned repo with advanced setup recommends env var", (t) => { - const exportVariableStub = sinon.stub(core, "exportVariable"); + const exportVariableStub = sinon.stub(environment, "exportVariable"); sinon.stub(actionsUtil, "isDefaultSetup").returns(false); github.context.payload = { repository: { @@ -651,7 +651,7 @@ test.serial( test.serial( "file coverage deprecation warning for unknown owner type with default setup recommends advanced setup", (t) => { - const exportVariableStub = sinon.stub(core, "exportVariable"); + const exportVariableStub = sinon.stub(environment, "exportVariable"); sinon.stub(actionsUtil, "isDefaultSetup").returns(true); github.context.payload = { repository: undefined }; const messages: LoggedMessage[] = []; @@ -672,7 +672,7 @@ test.serial( test.serial( "file coverage deprecation warning for unknown owner type with advanced setup recommends env var", (t) => { - const exportVariableStub = sinon.stub(core, "exportVariable"); + const exportVariableStub = sinon.stub(environment, "exportVariable"); sinon.stub(actionsUtil, "isDefaultSetup").returns(false); github.context.payload = { repository: undefined }; const messages: LoggedMessage[] = []; @@ -694,7 +694,7 @@ test.serial( (t) => { process.env["CODEQL_ACTION_DID_LOG_FILE_COVERAGE_ON_PRS_DEPRECATION"] = "true"; - const exportVariableStub = sinon.stub(core, "exportVariable"); + const exportVariableStub = sinon.stub(environment, "exportVariable"); const messages: LoggedMessage[] = []; logFileCoverageOnPrsDeprecationWarning(getRecordingLogger(messages)); t.is(messages.length, 0); diff --git a/src/init.ts b/src/init.ts index 2533d9a894..1aa0623f34 100644 --- a/src/init.ts +++ b/src/init.ts @@ -1,7 +1,6 @@ import * as fs from "fs"; import * as path from "path"; -import * as core from "@actions/core"; import * as toolrunner from "@actions/exec/lib/toolrunner"; import * as github from "@actions/github"; import * as io from "@actions/io"; @@ -16,7 +15,7 @@ import { import { GitHubApiDetails } from "./api-client"; import { CodeQL, setupCodeQL } from "./codeql"; import * as configUtils from "./config-utils"; -import { EnvVar } from "./environment"; +import { EnvVar, exportVariable } from "./environment"; import { CodeQLDefaultVersionInfo, Feature, @@ -418,5 +417,5 @@ export function logFileCoverageOnPrsDeprecationWarning(logger: Logger): void { } logger.warning(message); - core.exportVariable(EnvVar.DID_LOG_FILE_COVERAGE_ON_PRS_DEPRECATION, "true"); + exportVariable(EnvVar.DID_LOG_FILE_COVERAGE_ON_PRS_DEPRECATION, "true"); } diff --git a/src/overlay/caching.test.ts b/src/overlay/caching.test.ts index daf3483ed5..364eeff9c4 100644 --- a/src/overlay/caching.test.ts +++ b/src/overlay/caching.test.ts @@ -8,6 +8,7 @@ import * as sinon from "sinon"; import * as actionsUtil from "../actions-util"; import * as apiClient from "../api-client"; import type { ResolveDatabaseOutput } from "../codeql"; +import * as environment from "../environment"; import * as gitUtils from "../git-utils"; import { BuiltInLanguage } from "../languages"; import { getRunnerLogger } from "../logging"; @@ -82,7 +83,7 @@ const testDownloadOverlayBaseDatabaseFromCache = makeMacro({ sinon.stub(apiClient, "getAutomationID").resolves("test-automation-id/"); - sinon.stub(utils, "isInTestMode").returns(testCase.isInTestMode); + sinon.stub(environment, "isInTestMode").returns(testCase.isInTestMode); if (testCase.restoreCacheResult instanceof Error) { sinon diff --git a/src/setup-codeql-action.ts b/src/setup-codeql-action.ts index d3e0e7dbcc..d3ebdfaff8 100644 --- a/src/setup-codeql-action.ts +++ b/src/setup-codeql-action.ts @@ -11,7 +11,7 @@ import { AnalysisKind, getAnalysisKinds } from "./analyses"; import { getGitHubVersion } from "./api-client"; import { CodeQL } from "./codeql"; import { getRawLanguagesNoAutodetect } from "./config-utils"; -import { EnvVar } from "./environment"; +import { EnvVar, exportVariable } from "./environment"; import { initFeatures } from "./feature-flags"; import { initCodeQL } from "./init"; import { getActionsLogger, Logger } from "./logging"; @@ -125,7 +125,7 @@ async function run(startedAt: Date): Promise { const jobRunUuid = uuidV4(); logger.info(`Job run UUID is ${jobRunUuid}.`); - core.exportVariable(EnvVar.JOB_RUN_UUID, jobRunUuid); + exportVariable(EnvVar.JOB_RUN_UUID, jobRunUuid); const statusReportBase = await createStatusReportBase( ActionName.SetupCodeQL, @@ -165,7 +165,7 @@ async function run(startedAt: Date): Promise { core.setOutput("codeql-path", codeql.getPath()); core.setOutput("codeql-version", (await codeql.getVersion()).version); - core.exportVariable(EnvVar.SETUP_CODEQL_ACTION_HAS_RUN, "true"); + exportVariable(EnvVar.SETUP_CODEQL_ACTION_HAS_RUN, "true"); } catch (unwrappedError) { const error = wrapError(unwrappedError); core.setFailed(error.message); diff --git a/src/status-report.ts b/src/status-report.ts index b3e3628b36..8fa35b4c5c 100644 --- a/src/status-report.ts +++ b/src/status-report.ts @@ -15,7 +15,7 @@ import { getAnalysisKey, getApiClient } from "./api-client"; import { parseRegistriesWithoutCredentials, type Config } from "./config-utils"; import { DependencyCacheRestoreStatusReport } from "./dependency-caching"; import { DocUrl } from "./doc-url"; -import { EnvVar } from "./environment"; +import { EnvVar, exportVariable } from "./environment"; import { getRef } from "./git-utils"; import { Logger } from "./logging"; import { OverlayBaseDatabaseDownloadStats } from "./overlay/caching"; @@ -216,12 +216,12 @@ export function getJobStatusDisplayName(status: JobStatus): string { */ function setJobStatusIfUnsuccessful(actionStatus: ActionStatus) { if (actionStatus === "user-error") { - core.exportVariable( + exportVariable( EnvVar.JOB_STATUS, process.env[EnvVar.JOB_STATUS] ?? JobStatus.ConfigErrorStatus, ); } else if (actionStatus === "failure" || actionStatus === "aborted") { - core.exportVariable( + exportVariable( EnvVar.JOB_STATUS, process.env[EnvVar.JOB_STATUS] ?? JobStatus.FailureStatus, ); @@ -280,7 +280,7 @@ export async function createStatusReportBase( let workflowStartedAt = process.env[EnvVar.WORKFLOW_STARTED_AT]; if (workflowStartedAt === undefined) { workflowStartedAt = actionStartedAt.toISOString(); - core.exportVariable(EnvVar.WORKFLOW_STARTED_AT, workflowStartedAt); + exportVariable(EnvVar.WORKFLOW_STARTED_AT, workflowStartedAt); } const runnerOs = getRequiredEnvParam("RUNNER_OS"); const codeQlCliVersion = getCachedCodeQlVersion(); @@ -289,7 +289,7 @@ export async function createStatusReportBase( // re-export the testing environment variable so that it is available to subsequent steps, // even if it was only set for this step if (testingEnvironment) { - core.exportVariable(EnvVar.TESTING_ENVIRONMENT, testingEnvironment); + exportVariable(EnvVar.TESTING_ENVIRONMENT, testingEnvironment); } const isSteadyStateDefaultSetupRun = process.env["CODE_SCANNING_IS_STEADY_STATE_DEFAULT_SETUP"] === "true"; diff --git a/src/upload-lib.ts b/src/upload-lib.ts index 83331aeed9..a9ff2fbf64 100644 --- a/src/upload-lib.ts +++ b/src/upload-lib.ts @@ -14,7 +14,7 @@ import { getGitHubVersion, wrapApiConfigurationError } from "./api-client"; import { CodeQL, getCodeQL } from "./codeql"; import { getConfig } from "./config-utils"; import { readDiffRangesJsonFile } from "./diff-informed-analysis-utils"; -import { EnvVar } from "./environment"; +import { EnvVar, exportVariable } from "./environment"; import { FeatureEnablement } from "./feature-flags"; import * as fingerprints from "./fingerprints"; import * as gitUtils from "./git-utils"; @@ -126,7 +126,7 @@ async function combineSarifFilesUsingCLI( logger.warning( `Uploading multiple SARIF runs with the same category is deprecated ${deprecationWarningMessage}. Please update your workflow to upload a single run per category. ${deprecationMoreInformationMessage}`, ); - core.exportVariable("CODEQL_MERGE_SARIF_DEPRECATION_WARNING", "true"); + exportVariable("CODEQL_MERGE_SARIF_DEPRECATION_WARNING", "true"); } // If not, use the naive method of combining the files. @@ -1023,7 +1023,7 @@ export function validateUniqueCategory( `Category: (${id ? id : "none"}) Tool: (${tool ? tool : "none"})`, ); } - core.exportVariable(sentinelEnvVar, sentinelEnvVar); + exportVariable(sentinelEnvVar, sentinelEnvVar); } } diff --git a/src/util.ts b/src/util.ts index e2331461bd..bf7f294324 100644 --- a/src/util.ts +++ b/src/util.ts @@ -13,11 +13,13 @@ import * as apiCompatibility from "./api-compatibility.json"; import type { CodeQL, VersionInfo } from "./codeql"; import type { Pack } from "./config/db-config"; import type { Config } from "./config-utils"; -import { EnvVar } from "./environment"; +import { EnvVar, exportVariable, isInTestMode } from "./environment"; import * as json from "./json"; import { Language } from "./languages"; import { Logger } from "./logging"; +export { isInTestMode } from "./environment"; + /** * The name of the file containing the base database OIDs, as stored in the * root of the database location. @@ -515,7 +517,7 @@ export function checkGitHubVersionInRange( ); } hasBeenWarnedAboutVersion = true; - core.exportVariable(CODEQL_ACTION_WARNED_ABOUT_VERSION_ENV_VAR, true); + exportVariable(CODEQL_ACTION_WARNED_ABOUT_VERSION_ENV_VAR, true); } export enum DisallowedAPIVersionReason { @@ -559,11 +561,11 @@ export function assertNever(value: never): never { * knowing what version of CodeQL we're running. */ export function initializeEnvironment(version: string) { - core.exportVariable(EnvVar.FEATURE_MULTI_LANGUAGE, "false"); - core.exportVariable(EnvVar.FEATURE_SANDWICH, "false"); - core.exportVariable(EnvVar.FEATURE_SARIF_COMBINE, "true"); - core.exportVariable(EnvVar.FEATURE_WILL_UPLOAD, "true"); - core.exportVariable(EnvVar.VERSION, version); + exportVariable(EnvVar.FEATURE_MULTI_LANGUAGE, "false"); + exportVariable(EnvVar.FEATURE_SANDWICH, "false"); + exportVariable(EnvVar.FEATURE_SARIF_COMBINE, "true"); + exportVariable(EnvVar.FEATURE_WILL_UPLOAD, "true"); + exportVariable(EnvVar.VERSION, version); } /** @@ -708,15 +710,6 @@ export function isGoodVersion(versionSpec: string) { return !BROKEN_VERSIONS.includes(versionSpec); } -/** - * Returns whether we are in test mode. This is used by CodeQL Action PR checks. - * - * In test mode, we skip several uploads (SARIF results, status reports, DBs, ...). - */ -export function isInTestMode(): boolean { - return process.env[EnvVar.TEST_MODE] === "true"; -} - /** * Returns whether we specifically want to skip uploading SARIF files. */ @@ -935,7 +928,7 @@ export async function checkDiskUsage( } else { logger.debug(message); } - core.exportVariable(EnvVar.HAS_WARNED_ABOUT_DISK_SPACE, "true"); + exportVariable(EnvVar.HAS_WARNED_ABOUT_DISK_SPACE, "true"); } return { numAvailableBytes: diskUsage.bavail * blockSizeInBytes, @@ -984,7 +977,7 @@ export function checkActionVersion( "https://github.blog/changelog/2025-10-28-upcoming-deprecation-of-codeql-action-v3/", ); // set LOG_VERSION_DEPRECATION env var to prevent the warning from being logged multiple times - core.exportVariable(EnvVar.LOG_VERSION_DEPRECATION, "true"); + exportVariable(EnvVar.LOG_VERSION_DEPRECATION, "true"); } } }