From 68c72e75fd39468dce84b0dfbcbc4f75a7e814e4 Mon Sep 17 00:00:00 2001 From: therealsamyak Date: Thu, 19 Nov 2026 12:21:41 -0800 Subject: [PATCH 1/3] Skip autodetected languages with no source files Language autodetection uses the GitHub languages API. That API reports the languages of the default branch, and GitHub updates the data in the background. After the last file of a language is removed, the API can still report that language. The Action then creates a database for it, and `analyze` fails with exit code 32 because CodeQL sees no source code. When languages are autodetected, check the checkout for files with the extensions that each extractor declares in its `codeql-extractor.yml`. Skip a language if no such file exists, and log the reason. Ignore the JavaScript extractor's `data` file type, because CodeQL does not count `.json` or `.yml` files as JavaScript source. Languages from the `languages` input are not changed. Fixes #4334 --- lib/entry-points.js | 1784 +++++++++++++++------------- src/config-utils.test.ts | 55 + src/config-utils.ts | 36 +- src/languages/source-files.test.ts | 129 ++ src/languages/source-files.ts | 145 +++ 5 files changed, 1298 insertions(+), 851 deletions(-) create mode 100644 src/languages/source-files.test.ts create mode 100644 src/languages/source-files.ts diff --git a/lib/entry-points.js b/lib/entry-points.js index 4c165a4fe2..8d02ec2a44 100644 --- a/lib/entry-points.js +++ b/lib/entry-points.js @@ -213,7 +213,7 @@ var require_file_command = __commonJS({ exports2.issueFileCommand = issueFileCommand; exports2.prepareKeyValueMessage = prepareKeyValueMessage; var crypto3 = __importStar2(require("crypto")); - var fs34 = __importStar2(require("fs")); + var fs35 = __importStar2(require("fs")); var os8 = __importStar2(require("os")); var utils_1 = require_utils(); function issueFileCommand(command, message) { @@ -221,10 +221,10 @@ var require_file_command = __commonJS({ if (!filePath) { throw new Error(`Unable to find environment variable for file command ${command}`); } - if (!fs34.existsSync(filePath)) { + if (!fs35.existsSync(filePath)) { throw new Error(`Missing file at path: ${filePath}`); } - fs34.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os8.EOL}`, { + fs35.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os8.EOL}`, { encoding: "utf8" }); } @@ -1669,14 +1669,14 @@ var require_util = __commonJS({ } const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80; let origin = url2.origin != null ? url2.origin : `${url2.protocol || ""}//${url2.hostname || ""}:${port}`; - let path30 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; + let path31 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; if (origin[origin.length - 1] === "/") { origin = origin.slice(0, origin.length - 1); } - if (path30 && path30[0] !== "/") { - path30 = `/${path30}`; + if (path31 && path31[0] !== "/") { + path31 = `/${path31}`; } - return new URL(`${origin}${path30}`); + return new URL(`${origin}${path31}`); } if (!isHttpOrHttpsPrefixed(url2.origin || url2.protocol)) { throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); @@ -2497,9 +2497,9 @@ var require_diagnostics = __commonJS({ "undici:client:sendHeaders", (evt) => { const { - request: { method, path: path30, origin } + request: { method, path: path31, origin } } = evt; - debugLog("sending request to %s %s%s", method, origin, path30); + debugLog("sending request to %s %s%s", method, origin, path31); } ); } @@ -2517,14 +2517,14 @@ var require_diagnostics = __commonJS({ "undici:request:headers", (evt) => { const { - request: { method, path: path30, origin }, + request: { method, path: path31, origin }, response: { statusCode } } = evt; debugLog( "received response to %s %s%s - HTTP %d", method, origin, - path30, + path31, statusCode ); } @@ -2533,23 +2533,23 @@ var require_diagnostics = __commonJS({ "undici:request:trailers", (evt) => { const { - request: { method, path: path30, origin } + request: { method, path: path31, origin } } = evt; - debugLog("trailers received from %s %s%s", method, origin, path30); + debugLog("trailers received from %s %s%s", method, origin, path31); } ); diagnosticsChannel.subscribe( "undici:request:error", (evt) => { const { - request: { method, path: path30, origin }, + request: { method, path: path31, origin }, error: error3 } = evt; debugLog( "request to %s %s%s errored - %s", method, origin, - path30, + path31, error3.message ); } @@ -2664,7 +2664,7 @@ var require_request = __commonJS({ var kHandler = /* @__PURE__ */ Symbol("handler"); var Request = class { constructor(origin, { - path: path30, + path: path31, method, body, headers, @@ -2681,11 +2681,11 @@ var require_request = __commonJS({ maxRedirections, typeOfService }, handler2) { - if (typeof path30 !== "string") { + if (typeof path31 !== "string") { throw new InvalidArgumentError("path must be a string"); - } else if (path30[0] !== "/" && !(path30.startsWith("http://") || path30.startsWith("https://")) && method !== "CONNECT") { + } else if (path31[0] !== "/" && !(path31.startsWith("http://") || path31.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.test(path30)) { + } else if (invalidPathRegex.test(path31)) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { @@ -2760,7 +2760,7 @@ var require_request = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query ? serializePathWithQuery(path30, query) : path30; + this.path = query ? serializePathWithQuery(path31, query) : path31; this.origin = origin; this.protocol = getProtocolFromUrlString(origin); this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; @@ -7985,7 +7985,7 @@ var require_client_h1 = __commonJS({ return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; } function writeH1(client, request3) { - const { method, path: path30, host, upgrade, blocking, reset } = request3; + const { method, path: path31, host, upgrade, blocking, reset } = request3; let { body, headers, contentLength } = request3; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH"; if (util4.isFormDataLike(body)) { @@ -8063,7 +8063,7 @@ var require_client_h1 = __commonJS({ if (socket.setTypeOfService) { socket.setTypeOfService(request3.typeOfService); } - let header = `${method} ${path30} HTTP/1.1\r + let header = `${method} ${path31} HTTP/1.1\r `; if (typeof host === "string") { header += `host: ${host}\r @@ -8740,7 +8740,7 @@ var require_client_h2 = __commonJS({ const headersTimeout = request3.headersTimeout ?? client[kHeadersTimeout]; const bodyTimeout = request3.bodyTimeout ?? client[kBodyTimeout]; const session = client[kHTTP2Session]; - const { method, path: path30, host, upgrade, expectContinue, signal, protocol, headers: reqHeaders } = request3; + const { method, path: path31, host, upgrade, expectContinue, signal, protocol, headers: reqHeaders } = request3; let { body } = request3; if (upgrade != null && upgrade !== "websocket") { util4.errorRequest(client, request3, new InvalidArgumentError(`Custom upgrade "${upgrade}" not supported over HTTP/2`)); @@ -8809,7 +8809,7 @@ var require_client_h2 = __commonJS({ } headers[HTTP2_HEADER_METHOD] = "CONNECT"; headers[HTTP2_HEADER_PROTOCOL] = "websocket"; - headers[HTTP2_HEADER_PATH] = path30; + headers[HTTP2_HEADER_PATH] = path31; if (protocol === "ws:" || protocol === "wss:") { headers[HTTP2_HEADER_SCHEME] = protocol === "ws:" ? "http" : "https"; } else { @@ -8861,7 +8861,7 @@ var require_client_h2 = __commonJS({ stream2.setTimeout(headersTimeout); return true; } - headers[HTTP2_HEADER_PATH] = path30; + headers[HTTP2_HEADER_PATH] = path31; headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { @@ -11217,10 +11217,10 @@ var require_proxy_agent = __commonJS({ }; const { origin, - path: path30 = "/", + path: path31 = "/", headers = {} } = opts; - opts.path = origin + path30; + opts.path = origin + path31; if (!("host" in headers) && !("Host" in headers)) { const { host } = new URL(origin); headers.host = host; @@ -13380,20 +13380,20 @@ var require_mock_utils = __commonJS({ } return normalizedQp; } - function safeUrl(path30) { - if (typeof path30 !== "string") { - return path30; + function safeUrl(path31) { + if (typeof path31 !== "string") { + return path31; } - const pathSegments = path30.split("?", 3); + const pathSegments = path31.split("?", 3); if (pathSegments.length !== 2) { - return path30; + return path31; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } - function matchKey(mockDispatch2, { path: path30, method, body, headers }) { - const pathMatch = matchValue(mockDispatch2.path, path30); + function matchKey(mockDispatch2, { path: path31, method, body, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path31); const methodMatch = matchValue(mockDispatch2.method, method); const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true; const headersMatch = matchHeaders(mockDispatch2, headers); @@ -13418,8 +13418,8 @@ var require_mock_utils = __commonJS({ const basePath = key.query ? serializePathWithQuery(key.path, key.query) : key.path; const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath; const resolvedPathWithoutTrailingSlash = removeTrailingSlash(resolvedPath); - let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path30, ignoreTrailingSlash }) => { - return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(path30)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path30), resolvedPath); + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path31, ignoreTrailingSlash }) => { + return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(path31)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path31), resolvedPath); }); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); @@ -13458,19 +13458,19 @@ var require_mock_utils = __commonJS({ mockDispatches.splice(index2, 1); } } - function removeTrailingSlash(path30) { - while (path30.endsWith("/")) { - path30 = path30.slice(0, -1); + function removeTrailingSlash(path31) { + while (path31.endsWith("/")) { + path31 = path31.slice(0, -1); } - if (path30.length === 0) { - path30 = "/"; + if (path31.length === 0) { + path31 = "/"; } - return path30; + return path31; } function buildKey(opts) { - const { path: path30, method, body, headers, query } = opts; + const { path: path31, method, body, headers, query } = opts; return { - path: path30, + path: path31, method, body, headers, @@ -14160,10 +14160,10 @@ var require_pending_interceptors_formatter = __commonJS({ } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( - ({ method, path: path30, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + ({ method, path: path31, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, - Path: path30, + Path: path31, "Status code": statusCode, Persistent: persist ? PERSISTENT : NOT_PERSISTENT, Invocations: timesInvoked, @@ -14245,9 +14245,9 @@ var require_mock_agent = __commonJS({ const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters]; const dispatchOpts = { ...opts }; if (acceptNonStandardSearchParameters && dispatchOpts.path) { - const [path30, searchParams] = dispatchOpts.path.split("?"); + const [path31, searchParams] = dispatchOpts.path.split("?"); const normalizedSearchParams = normalizeSearchParams(searchParams, acceptNonStandardSearchParameters); - dispatchOpts.path = `${path30}?${normalizedSearchParams}`; + dispatchOpts.path = `${path31}?${normalizedSearchParams}`; } return this[kAgent].dispatch(dispatchOpts, handler2); } @@ -14648,12 +14648,12 @@ var require_snapshot_recorder = __commonJS({ * @return {Promise} - Resolves when snapshots are loaded */ async loadSnapshots(filePath) { - const path30 = filePath || this.#snapshotPath; - if (!path30) { + const path31 = filePath || this.#snapshotPath; + if (!path31) { throw new InvalidArgumentError("Snapshot path is required"); } try { - const data = await readFile(resolve15(path30), "utf8"); + const data = await readFile(resolve15(path31), "utf8"); const parsed = JSON.parse(data); if (Array.isArray(parsed)) { this.#snapshots.clear(); @@ -14667,7 +14667,7 @@ var require_snapshot_recorder = __commonJS({ if (error3.code === "ENOENT") { this.#snapshots.clear(); } else { - throw new UndiciError(`Failed to load snapshots from ${path30}`, { cause: error3 }); + throw new UndiciError(`Failed to load snapshots from ${path31}`, { cause: error3 }); } } } @@ -14678,11 +14678,11 @@ var require_snapshot_recorder = __commonJS({ * @returns {Promise} - Resolves when snapshots are saved */ async saveSnapshots(filePath) { - const path30 = filePath || this.#snapshotPath; - if (!path30) { + const path31 = filePath || this.#snapshotPath; + if (!path31) { throw new InvalidArgumentError("Snapshot path is required"); } - const resolvedPath = resolve15(path30); + const resolvedPath = resolve15(path31); await mkdir(dirname6(resolvedPath), { recursive: true }); const data = Array.from(this.#snapshots.entries()).map(([hash2, snapshot]) => ({ hash: hash2, @@ -15319,15 +15319,15 @@ var require_redirect_handler = __commonJS({ } this.history[kRedirectCacheControl].push(headers["cache-control"]); const { origin, pathname, search } = util4.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); - const path30 = search ? `${pathname}${search}` : pathname; - const redirectUrlString = `${origin}${path30}`; + const path31 = search ? `${pathname}${search}` : pathname; + const redirectUrlString = `${origin}${path31}`; for (const historyUrl of this.history) { if (historyUrl.toString() === redirectUrlString) { throw new InvalidArgumentError(`Redirect loop detected. Cannot redirect to ${origin}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`); } } this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path30; + this.opts.path = path31; this.opts.origin = origin; this.opts.query = null; } @@ -17095,10 +17095,10 @@ var require_cache_handler = __commonJS({ } return locationUrl.pathname + locationUrl.search; } - function deleteCachedUri(store, cacheKey3, path30) { + function deleteCachedUri(store, cacheKey3, path31) { deleteCachedValue(store, { ...cacheKey3, - path: path30 + path: path31 }); for (let i = 0; i < util4.safeHTTPMethods.length; i++) { const method = util4.safeHTTPMethods[i]; @@ -17106,7 +17106,7 @@ var require_cache_handler = __commonJS({ deleteCachedValue(store, { ...cacheKey3, method, - path: path30 + path: path31 }); } } @@ -17117,9 +17117,9 @@ var require_cache_handler = __commonJS({ } const values = Array.isArray(headerValue) ? headerValue : [headerValue]; for (let i = 0; i < values.length; i++) { - const path30 = getSameOriginPath(cacheKey3, values[i]); - if (path30 !== void 0) { - deleteCachedUri(store, cacheKey3, path30); + const path31 = getSameOriginPath(cacheKey3, values[i]); + if (path31 !== void 0) { + deleteCachedUri(store, cacheKey3, path31); } } } @@ -22330,11 +22330,11 @@ var require_fetch = __commonJS({ function dispatch({ body }) { const url2 = requestCurrentURL(request3); const agent = fetchParams.controller.dispatcher; - const path30 = url2.pathname + url2.search; + const path31 = url2.pathname + url2.search; const hasTrailingQuestionMark = url2.search.length === 0 && url2.href[url2.href.length - url2.hash.length - 1] === "?"; return new Promise((resolve15, reject) => agent.dispatch( { - path: hasTrailingQuestionMark ? `${path30}?` : path30, + path: hasTrailingQuestionMark ? `${path31}?` : path31, origin: url2.origin, method: request3.method, body: agent.isMockActive ? request3.body && (request3.body.source || request3.body.stream) : body, @@ -23281,9 +23281,9 @@ var require_util4 = __commonJS({ } } } - function validateCookiePath(path30) { - for (let i = 0; i < path30.length; ++i) { - const code = path30.charCodeAt(i); + function validateCookiePath(path31) { + for (let i = 0; i < path31.length; ++i) { + const code = path31.charCodeAt(i); if (code < 32 || // exclude CTLs (0-31) code > 126 || // exclude DEL and non-ascii code === 59) { @@ -26719,11 +26719,11 @@ var require_undici = __commonJS({ if (typeof opts.path !== "string") { throw new InvalidArgumentError("invalid opts.path"); } - let path30 = opts.path; + let path31 = opts.path; if (!opts.path.startsWith("/")) { - path30 = `/${path30}`; + path31 = `/${path31}`; } - url2 = new URL(util4.parseOrigin(url2).origin + path30); + url2 = new URL(util4.parseOrigin(url2).origin + path31); } else { if (!opts) { opts = typeof url2 === "object" ? url2 : {}; @@ -28064,7 +28064,7 @@ var require_path_utils = __commonJS({ exports2.toPosixPath = toPosixPath; exports2.toWin32Path = toWin32Path; exports2.toPlatformPath = toPlatformPath; - var path30 = __importStar2(require("path")); + var path31 = __importStar2(require("path")); function toPosixPath(pth) { return pth.replace(/[\\]/g, "/"); } @@ -28072,7 +28072,7 @@ var require_path_utils = __commonJS({ return pth.replace(/[/]/g, "\\"); } function toPlatformPath(pth) { - return pth.replace(/[/\\]/g, path30.sep); + return pth.replace(/[/\\]/g, path31.sep); } } }); @@ -28154,13 +28154,13 @@ var require_io_util = __commonJS({ exports2.isRooted = isRooted; exports2.tryGetExecutablePath = tryGetExecutablePath; exports2.getCmdPath = getCmdPath; - var fs34 = __importStar2(require("fs")); - var path30 = __importStar2(require("path")); - _a6 = fs34.promises, exports2.chmod = _a6.chmod, exports2.copyFile = _a6.copyFile, exports2.lstat = _a6.lstat, exports2.mkdir = _a6.mkdir, exports2.open = _a6.open, exports2.readdir = _a6.readdir, exports2.rename = _a6.rename, exports2.rm = _a6.rm, exports2.rmdir = _a6.rmdir, exports2.stat = _a6.stat, exports2.symlink = _a6.symlink, exports2.unlink = _a6.unlink; + var fs35 = __importStar2(require("fs")); + var path31 = __importStar2(require("path")); + _a6 = fs35.promises, exports2.chmod = _a6.chmod, exports2.copyFile = _a6.copyFile, exports2.lstat = _a6.lstat, exports2.mkdir = _a6.mkdir, exports2.open = _a6.open, exports2.readdir = _a6.readdir, exports2.rename = _a6.rename, exports2.rm = _a6.rm, exports2.rmdir = _a6.rmdir, exports2.stat = _a6.stat, exports2.symlink = _a6.symlink, exports2.unlink = _a6.unlink; exports2.IS_WINDOWS = process.platform === "win32"; function readlink(fsPath) { return __awaiter2(this, void 0, void 0, function* () { - const result = yield fs34.promises.readlink(fsPath); + const result = yield fs35.promises.readlink(fsPath); if (exports2.IS_WINDOWS && !result.endsWith("\\")) { return `${result}\\`; } @@ -28168,7 +28168,7 @@ var require_io_util = __commonJS({ }); } exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs34.constants.O_RDONLY; + exports2.READONLY = fs35.constants.O_RDONLY; function exists(fsPath) { return __awaiter2(this, void 0, void 0, function* () { try { @@ -28210,7 +28210,7 @@ var require_io_util = __commonJS({ } if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { - const upperExt = path30.extname(filePath).toUpperCase(); + const upperExt = path31.extname(filePath).toUpperCase(); if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { return filePath; } @@ -28234,11 +28234,11 @@ var require_io_util = __commonJS({ if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { try { - const directory = path30.dirname(filePath); - const upperName = path30.basename(filePath).toUpperCase(); + const directory = path31.dirname(filePath); + const upperName = path31.basename(filePath).toUpperCase(); for (const actualName of yield (0, exports2.readdir)(directory)) { if (upperName === actualName.toUpperCase()) { - filePath = path30.join(directory, actualName); + filePath = path31.join(directory, actualName); break; } } @@ -28350,7 +28350,7 @@ var require_io = __commonJS({ exports2.which = which10; exports2.findInPath = findInPath; var assert_1 = require("assert"); - var path30 = __importStar2(require("path")); + var path31 = __importStar2(require("path")); var ioUtil = __importStar2(require_io_util()); function cp(source_1, dest_1) { return __awaiter2(this, arguments, void 0, function* (source, dest, options = {}) { @@ -28359,7 +28359,7 @@ var require_io = __commonJS({ if (destStat && destStat.isFile() && !force) { return; } - const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path30.join(dest, path30.basename(source)) : dest; + const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path31.join(dest, path31.basename(source)) : dest; if (!(yield ioUtil.exists(source))) { throw new Error(`no such file or directory: ${source}`); } @@ -28371,7 +28371,7 @@ var require_io = __commonJS({ yield cpDirRecursive(source, newDest, 0, force); } } else { - if (path30.relative(source, newDest) === "") { + if (path31.relative(source, newDest) === "") { throw new Error(`'${newDest}' and '${source}' are the same file`); } yield copyFile2(source, newDest, force); @@ -28383,7 +28383,7 @@ var require_io = __commonJS({ if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { - dest = path30.join(dest, path30.basename(source)); + dest = path31.join(dest, path31.basename(source)); destExists = yield ioUtil.exists(dest); } if (destExists) { @@ -28394,7 +28394,7 @@ var require_io = __commonJS({ } } } - yield mkdirP(path30.dirname(dest)); + yield mkdirP(path31.dirname(dest)); yield ioUtil.rename(source, dest); }); } @@ -28453,7 +28453,7 @@ var require_io = __commonJS({ } const extensions = []; if (ioUtil.IS_WINDOWS && process.env["PATHEXT"]) { - for (const extension of process.env["PATHEXT"].split(path30.delimiter)) { + for (const extension of process.env["PATHEXT"].split(path31.delimiter)) { if (extension) { extensions.push(extension); } @@ -28466,12 +28466,12 @@ var require_io = __commonJS({ } return []; } - if (tool.includes(path30.sep)) { + if (tool.includes(path31.sep)) { return []; } const directories = []; if (process.env.PATH) { - for (const p of process.env.PATH.split(path30.delimiter)) { + for (const p of process.env.PATH.split(path31.delimiter)) { if (p) { directories.push(p); } @@ -28479,7 +28479,7 @@ var require_io = __commonJS({ } const matches = []; for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path30.join(directory, tool), extensions); + const filePath = yield ioUtil.tryGetExecutablePath(path31.join(directory, tool), extensions); if (filePath) { matches.push(filePath); } @@ -28609,7 +28609,7 @@ var require_toolrunner = __commonJS({ var os8 = __importStar2(require("os")); var events = __importStar2(require("events")); var child = __importStar2(require("child_process")); - var path30 = __importStar2(require("path")); + var path31 = __importStar2(require("path")); var io10 = __importStar2(require_io()); var ioUtil = __importStar2(require_io_util()); var timers_1 = require("timers"); @@ -28824,7 +28824,7 @@ var require_toolrunner = __commonJS({ exec() { return __awaiter2(this, void 0, void 0, function* () { if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { - this.toolPath = path30.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + this.toolPath = path31.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } this.toolPath = yield io10.which(this.toolPath, true); return new Promise((resolve15, reject) => __awaiter2(this, void 0, void 0, function* () { @@ -29377,7 +29377,7 @@ var require_core = __commonJS({ var file_command_1 = require_file_command(); var utils_1 = require_utils(); var os8 = __importStar2(require("os")); - var path30 = __importStar2(require("path")); + var path31 = __importStar2(require("path")); var oidc_utils_1 = require_oidc_utils(); var ExitCode; (function(ExitCode2) { @@ -29403,7 +29403,7 @@ var require_core = __commonJS({ } else { (0, command_1.issueCommand)("add-path", {}, inputPath); } - process.env["PATH"] = `${inputPath}${path30.delimiter}${process.env["PATH"]}`; + process.env["PATH"] = `${inputPath}${path31.delimiter}${process.env["PATH"]}`; } function getInput2(name, options) { const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; @@ -29540,8 +29540,8 @@ var require_context = __commonJS({ if ((0, fs_1.existsSync)(process.env.GITHUB_EVENT_PATH)) { this.payload = JSON.parse((0, fs_1.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: "utf8" })); } else { - const path30 = process.env.GITHUB_EVENT_PATH; - process.stdout.write(`GITHUB_EVENT_PATH ${path30} does not exist${os_1.EOL}`); + const path31 = process.env.GITHUB_EVENT_PATH; + process.stdout.write(`GITHUB_EVENT_PATH ${path31} does not exist${os_1.EOL}`); } } this.eventName = process.env.GITHUB_EVENT_NAME; @@ -37729,14 +37729,14 @@ var require_light = __commonJS({ var require_helpers = __commonJS({ "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { "use strict"; - var ValidationError = exports2.ValidationError = function ValidationError2(message, instance8, schema, path30, name, argument) { - if (Array.isArray(path30)) { - this.path = path30; - this.property = path30.reduce(function(sum, item) { + var ValidationError = exports2.ValidationError = function ValidationError2(message, instance8, schema, path31, name, argument) { + if (Array.isArray(path31)) { + this.path = path31; + this.property = path31.reduce(function(sum, item) { return sum + makeSuffix(item); }, "instance"); - } else if (path30 !== void 0) { - this.property = path30; + } else if (path31 !== void 0) { + this.property = path31; } if (message) { this.message = message; @@ -37829,16 +37829,16 @@ var require_helpers = __commonJS({ name: { value: "SchemaError", enumerable: false } } ); - var SchemaContext = exports2.SchemaContext = function SchemaContext2(schema, options, path30, base, schemas) { + var SchemaContext = exports2.SchemaContext = function SchemaContext2(schema, options, path31, base, schemas) { this.schema = schema; this.options = options; - if (Array.isArray(path30)) { - this.path = path30; - this.propertyPath = path30.reduce(function(sum, item) { + if (Array.isArray(path31)) { + this.path = path31; + this.propertyPath = path31.reduce(function(sum, item) { return sum + makeSuffix(item); }, "instance"); } else { - this.propertyPath = path30; + this.propertyPath = path31; } this.base = base; this.schemas = schemas; @@ -37847,10 +37847,10 @@ var require_helpers = __commonJS({ return (() => resolveUrl(this.base, target))(); }; SchemaContext.prototype.makeChild = function makeChild(schema, propertyName) { - var path30 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); + var path31 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); var id = schema.$id || schema.id; let base = (() => resolveUrl(this.base, id || ""))(); - var ctx = new SchemaContext(schema, this.options, path30, base, Object.create(this.schemas)); + var ctx = new SchemaContext(schema, this.options, path31, base, Object.create(this.schemas)); if (id && !ctx.schemas[base]) { ctx.schemas[base] = schema; } @@ -39311,7 +39311,7 @@ var require_internal_path_helper = __commonJS({ exports2.hasRoot = hasRoot; exports2.normalizeSeparators = normalizeSeparators; exports2.safeTrimTrailingSeparator = safeTrimTrailingSeparator; - var path30 = __importStar2(require("path")); + var path31 = __importStar2(require("path")); var assert_1 = __importDefault2(require("assert")); var IS_WINDOWS = process.platform === "win32"; function dirname6(p) { @@ -39319,7 +39319,7 @@ var require_internal_path_helper = __commonJS({ if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { return p; } - let result = path30.dirname(p); + let result = path31.dirname(p); if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { result = safeTrimTrailingSeparator(result); } @@ -39356,7 +39356,7 @@ var require_internal_path_helper = __commonJS({ (0, assert_1.default)(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { } else { - root += path30.sep; + root += path31.sep; } return root + itemPath; } @@ -39390,10 +39390,10 @@ var require_internal_path_helper = __commonJS({ return ""; } p = normalizeSeparators(p); - if (!p.endsWith(path30.sep)) { + if (!p.endsWith(path31.sep)) { return p; } - if (p === path30.sep) { + if (p === path31.sep) { return p; } if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { @@ -39852,7 +39852,7 @@ var require_minimatch = __commonJS({ "node_modules/minimatch/minimatch.js"(exports2, module2) { module2.exports = minimatch2; minimatch2.Minimatch = Minimatch2; - var path30 = (function() { + var path31 = (function() { try { return require("path"); } catch (e) { @@ -39860,7 +39860,7 @@ var require_minimatch = __commonJS({ })() || { sep: "/" }; - minimatch2.sep = path30.sep; + minimatch2.sep = path31.sep; var GLOBSTAR2 = minimatch2.GLOBSTAR = Minimatch2.GLOBSTAR = {}; var expand3 = require_brace_expansion(); var plTypes = { @@ -39949,8 +39949,8 @@ var require_minimatch = __commonJS({ assertValidPattern2(pattern); if (!options) options = {}; pattern = pattern.trim(); - if (!options.allowWindowsEscape && path30.sep !== "/") { - pattern = pattern.split(path30.sep).join("/"); + if (!options.allowWindowsEscape && path31.sep !== "/") { + pattern = pattern.split(path31.sep).join("/"); } this.options = options; this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200; @@ -40321,8 +40321,8 @@ var require_minimatch = __commonJS({ if (this.empty) return f === ""; if (f === "/" && partial) return true; var options = this.options; - if (path30.sep !== "/") { - f = f.split(path30.sep).join("/"); + if (path31.sep !== "/") { + f = f.split(path31.sep).join("/"); } f = f.split(slashSplit); this.debug(this.pattern, "split", f); @@ -40565,7 +40565,7 @@ var require_internal_path = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Path = void 0; - var path30 = __importStar2(require("path")); + var path31 = __importStar2(require("path")); var pathHelper = __importStar2(require_internal_path_helper()); var assert_1 = __importDefault2(require("assert")); var IS_WINDOWS = process.platform === "win32"; @@ -40580,12 +40580,12 @@ var require_internal_path = __commonJS({ (0, assert_1.default)(itemPath, `Parameter 'itemPath' must not be empty`); itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); if (!pathHelper.hasRoot(itemPath)) { - this.segments = itemPath.split(path30.sep); + this.segments = itemPath.split(path31.sep); } else { let remaining = itemPath; let dir = pathHelper.dirname(remaining); while (dir !== remaining) { - const basename2 = path30.basename(remaining); + const basename2 = path31.basename(remaining); this.segments.unshift(basename2); remaining = dir; dir = pathHelper.dirname(remaining); @@ -40603,7 +40603,7 @@ var require_internal_path = __commonJS({ (0, assert_1.default)(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`); this.segments.push(segment); } else { - (0, assert_1.default)(!segment.includes(path30.sep), `Parameter 'itemPath' contains unexpected path separators`); + (0, assert_1.default)(!segment.includes(path31.sep), `Parameter 'itemPath' contains unexpected path separators`); this.segments.push(segment); } } @@ -40614,12 +40614,12 @@ var require_internal_path = __commonJS({ */ toString() { let result = this.segments[0]; - let skipSlash = result.endsWith(path30.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); + let skipSlash = result.endsWith(path31.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); for (let i = 1; i < this.segments.length; i++) { if (skipSlash) { skipSlash = false; } else { - result += path30.sep; + result += path31.sep; } result += this.segments[i]; } @@ -40677,7 +40677,7 @@ var require_internal_pattern = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Pattern = void 0; var os8 = __importStar2(require("os")); - var path30 = __importStar2(require("path")); + var path31 = __importStar2(require("path")); var pathHelper = __importStar2(require_internal_path_helper()); var assert_1 = __importDefault2(require("assert")); var minimatch_1 = require_minimatch(); @@ -40706,7 +40706,7 @@ var require_internal_pattern = __commonJS({ } pattern = _Pattern.fixupPattern(pattern, homedir2); this.segments = new internal_path_1.Path(pattern).segments; - this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path30.sep); + this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path31.sep); pattern = pathHelper.safeTrimTrailingSeparator(pattern); let foundGlob = false; const searchSegments = this.segments.map((x) => _Pattern.getLiteral(x)).filter((x) => !foundGlob && !(foundGlob = x === "")); @@ -40730,8 +40730,8 @@ var require_internal_pattern = __commonJS({ match(itemPath) { if (this.segments[this.segments.length - 1] === "**") { itemPath = pathHelper.normalizeSeparators(itemPath); - if (!itemPath.endsWith(path30.sep) && this.isImplicitPattern === false) { - itemPath = `${itemPath}${path30.sep}`; + if (!itemPath.endsWith(path31.sep) && this.isImplicitPattern === false) { + itemPath = `${itemPath}${path31.sep}`; } } else { itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); @@ -40766,9 +40766,9 @@ var require_internal_pattern = __commonJS({ (0, assert_1.default)(literalSegments.every((x, i) => (x !== "." || i === 0) && x !== ".."), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`); (0, assert_1.default)(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`); pattern = pathHelper.normalizeSeparators(pattern); - if (pattern === "." || pattern.startsWith(`.${path30.sep}`)) { + if (pattern === "." || pattern.startsWith(`.${path31.sep}`)) { pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); - } else if (pattern === "~" || pattern.startsWith(`~${path30.sep}`)) { + } else if (pattern === "~" || pattern.startsWith(`~${path31.sep}`)) { homedir2 = homedir2 || os8.homedir(); (0, assert_1.default)(homedir2, "Unable to determine HOME directory"); (0, assert_1.default)(pathHelper.hasAbsoluteRoot(homedir2), `Expected HOME directory to be a rooted path. Actual '${homedir2}'`); @@ -40852,8 +40852,8 @@ var require_internal_search_state = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.SearchState = void 0; var SearchState = class { - constructor(path30, level) { - this.path = path30; + constructor(path31, level) { + this.path = path31; this.level = level; } }; @@ -40995,9 +40995,9 @@ var require_internal_globber = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.DefaultGlobber = void 0; var core29 = __importStar2(require_core()); - var fs34 = __importStar2(require("fs")); + var fs35 = __importStar2(require("fs")); var globOptionsHelper = __importStar2(require_internal_glob_options_helper()); - var path30 = __importStar2(require("path")); + var path31 = __importStar2(require("path")); var patternHelper = __importStar2(require_internal_pattern_helper()); var internal_match_kind_1 = require_internal_match_kind(); var internal_pattern_1 = require_internal_pattern(); @@ -41049,7 +41049,7 @@ var require_internal_globber = __commonJS({ for (const searchPath of patternHelper.getSearchPaths(patterns)) { core29.debug(`Search path '${searchPath}'`); try { - yield __await2(fs34.promises.lstat(searchPath)); + yield __await2(fs35.promises.lstat(searchPath)); } catch (err) { if (err.code === "ENOENT") { continue; @@ -41073,7 +41073,7 @@ var require_internal_globber = __commonJS({ if (!stats) { continue; } - if (options.excludeHiddenFiles && path30.basename(item.path).match(/^\./)) { + if (options.excludeHiddenFiles && path31.basename(item.path).match(/^\./)) { continue; } if (stats.isDirectory()) { @@ -41083,7 +41083,7 @@ var require_internal_globber = __commonJS({ continue; } const childLevel = item.level + 1; - const childItems = (yield __await2(fs34.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path30.join(item.path, x), childLevel)); + const childItems = (yield __await2(fs35.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path31.join(item.path, x), childLevel)); stack.push(...childItems.reverse()); } else if (match2 & internal_match_kind_1.MatchKind.File) { yield yield __await2(item.path); @@ -41118,7 +41118,7 @@ var require_internal_globber = __commonJS({ let stats; if (options.followSymbolicLinks) { try { - stats = yield fs34.promises.stat(item.path); + stats = yield fs35.promises.stat(item.path); } catch (err) { if (err.code === "ENOENT") { if (options.omitBrokenSymbolicLinks) { @@ -41130,10 +41130,10 @@ var require_internal_globber = __commonJS({ throw err; } } else { - stats = yield fs34.promises.lstat(item.path); + stats = yield fs35.promises.lstat(item.path); } if (stats.isDirectory() && options.followSymbolicLinks) { - const realPath = yield fs34.promises.realpath(item.path); + const realPath = yield fs35.promises.realpath(item.path); while (traversalChain.length >= item.level) { traversalChain.pop(); } @@ -41242,10 +41242,10 @@ var require_internal_hash_files = __commonJS({ exports2.hashFiles = hashFiles2; var crypto3 = __importStar2(require("crypto")); var core29 = __importStar2(require_core()); - var fs34 = __importStar2(require("fs")); + var fs35 = __importStar2(require("fs")); var stream2 = __importStar2(require("stream")); var util4 = __importStar2(require("util")); - var path30 = __importStar2(require("path")); + var path31 = __importStar2(require("path")); function hashFiles2(globber_1, currentWorkspace_1) { return __awaiter2(this, arguments, void 0, function* (globber, currentWorkspace, verbose = false) { var _a6, e_1, _b2, _c2; @@ -41261,17 +41261,17 @@ var require_internal_hash_files = __commonJS({ _e2 = false; const file = _c2; writeDelegate(file); - if (!file.startsWith(`${githubWorkspace}${path30.sep}`)) { + if (!file.startsWith(`${githubWorkspace}${path31.sep}`)) { writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); continue; } - if (fs34.statSync(file).isDirectory()) { + if (fs35.statSync(file).isDirectory()) { writeDelegate(`Skip directory '${file}'.`); continue; } const hash2 = crypto3.createHash("sha256"); const pipeline2 = util4.promisify(stream2.pipeline); - yield pipeline2(fs34.createReadStream(file), hash2); + yield pipeline2(fs35.createReadStream(file), hash2); result.write(hash2.digest()); count++; if (!hasMatch) { @@ -42647,8 +42647,8 @@ var require_cacheUtils = __commonJS({ var glob2 = __importStar2(require_glob()); var io10 = __importStar2(require_io()); var crypto3 = __importStar2(require("crypto")); - var fs34 = __importStar2(require("fs")); - var path30 = __importStar2(require("path")); + var fs35 = __importStar2(require("fs")); + var path31 = __importStar2(require("path")); var semver13 = __importStar2(require_semver3()); var util4 = __importStar2(require("util")); var constants_1 = require_constants7(); @@ -42668,15 +42668,15 @@ var require_cacheUtils = __commonJS({ baseLocation = "/home"; } } - tempDirectory = path30.join(baseLocation, "actions", "temp"); + tempDirectory = path31.join(baseLocation, "actions", "temp"); } - const dest = path30.join(tempDirectory, crypto3.randomUUID()); + const dest = path31.join(tempDirectory, crypto3.randomUUID()); yield io10.mkdirP(dest); return dest; }); } function getArchiveFileSizeInBytes(filePath) { - return fs34.statSync(filePath).size; + return fs35.statSync(filePath).size; } function resolvePaths(patterns) { return __awaiter2(this, void 0, void 0, function* () { @@ -42692,7 +42692,7 @@ var require_cacheUtils = __commonJS({ _c2 = _g2.value; _e2 = false; const file = _c2; - const relativeFile = path30.relative(workspace, file).replace(new RegExp(`\\${path30.sep}`, "g"), "/"); + const relativeFile = path31.relative(workspace, file).replace(new RegExp(`\\${path31.sep}`, "g"), "/"); core29.debug(`Matched: ${relativeFile}`); if (relativeFile === "") { paths.push("."); @@ -42714,7 +42714,7 @@ var require_cacheUtils = __commonJS({ } function unlinkFile(filePath) { return __awaiter2(this, void 0, void 0, function* () { - return util4.promisify(fs34.unlink)(filePath); + return util4.promisify(fs35.unlink)(filePath); }); } function getVersion(app_1) { @@ -42756,7 +42756,7 @@ var require_cacheUtils = __commonJS({ } function getGnuTarPathOnWindows() { return __awaiter2(this, void 0, void 0, function* () { - if (fs34.existsSync(constants_1.GnuTarPathOnWindows)) { + if (fs35.existsSync(constants_1.GnuTarPathOnWindows)) { return constants_1.GnuTarPathOnWindows; } const versionOutput = yield getVersion("tar"); @@ -48460,8 +48460,8 @@ var require_getClient = __commonJS({ const noDefaultAcceptHeader = clientOptions.internal?.noDefaultAcceptHeader ?? false; const { allowInsecureConnection, httpClient } = clientOptions; const endpointUrl = clientOptions.endpoint ?? endpoint2; - const client = (path30, ...args) => { - const getUrl = (requestOptions) => (0, import_urlHelpers.buildRequestUrl)(endpointUrl, path30, args, { allowInsecureConnection, ...requestOptions }); + const client = (path31, ...args) => { + const getUrl = (requestOptions) => (0, import_urlHelpers.buildRequestUrl)(endpointUrl, path31, args, { allowInsecureConnection, ...requestOptions }); return { get: (requestOptions = {}) => { return buildOperation( @@ -50046,13 +50046,13 @@ function __disposeResources(env) { } return next(); } -function __rewriteRelativeImportExtension(path30, preserveJsx) { - if (typeof path30 === "string" && /^\.\.?\//.test(path30)) { - return path30.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext2, cm) { +function __rewriteRelativeImportExtension(path31, preserveJsx) { + if (typeof path31 === "string" && /^\.\.?\//.test(path31)) { + return path31.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext2, cm) { return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext2 || !cm) ? m : d + ext2 + "." + cm.toLowerCase() + "js"; }); } - return path30; + return path31; } var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default; var init_tslib_es6 = __esm({ @@ -53690,15 +53690,15 @@ var require_urlHelpers2 = __commonJS({ let isAbsolutePath = false; let requestUrl = replaceAll(baseUri, urlReplacements); if (operationSpec.path) { - let path30 = replaceAll(operationSpec.path, urlReplacements); - if (operationSpec.path === "/{nextLink}" && path30.startsWith("/")) { - path30 = path30.substring(1); + let path31 = replaceAll(operationSpec.path, urlReplacements); + if (operationSpec.path === "/{nextLink}" && path31.startsWith("/")) { + path31 = path31.substring(1); } - if (isAbsoluteUrl(path30)) { - requestUrl = path30; + if (isAbsoluteUrl(path31)) { + requestUrl = path31; isAbsolutePath = true; } else { - requestUrl = appendPath(requestUrl, path30); + requestUrl = appendPath(requestUrl, path31); } } const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject); @@ -53744,9 +53744,9 @@ var require_urlHelpers2 = __commonJS({ } const searchStart = pathToAppend.indexOf("?"); if (searchStart !== -1) { - const path30 = pathToAppend.substring(0, searchStart); + const path31 = pathToAppend.substring(0, searchStart); const search = pathToAppend.substring(searchStart + 1); - newPath = newPath + path30; + newPath = newPath + path31; if (search) { parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search; } @@ -57415,11 +57415,11 @@ var require_crc64 = __commonJS({ throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)"); } var scriptDirectory = ""; - function locateFile(path30) { + function locateFile(path31) { if (Module["locateFile"]) { - return Module["locateFile"](path30, scriptDirectory); + return Module["locateFile"](path31, scriptDirectory); } - return scriptDirectory + path30; + return scriptDirectory + path31; } var read_, readAsync, readBinary, setWindowTitle; function logExceptionOnExit(e) { @@ -60901,10 +60901,10 @@ var require_utils_common = __commonJS({ var import_constants5 = require_constants10(); function escapeURLPath(url2) { const urlParsed = new URL(url2); - let path30 = urlParsed.pathname; - path30 = path30 || "/"; - path30 = escape3(path30); - urlParsed.pathname = path30; + let path31 = urlParsed.pathname; + path31 = path31 || "/"; + path31 = escape3(path31); + urlParsed.pathname = path31; return urlParsed.toString(); } function getProxyUriFromDevConnString(connectionString) { @@ -60991,9 +60991,9 @@ var require_utils_common = __commonJS({ } function appendToURLPath(url2, name) { const urlParsed = new URL(url2); - let path30 = urlParsed.pathname; - path30 = path30 ? path30.endsWith("/") ? `${path30}${name}` : `${path30}/${name}` : name; - urlParsed.pathname = path30; + let path31 = urlParsed.pathname; + path31 = path31 ? path31.endsWith("/") ? `${path31}${name}` : `${path31}/${name}` : name; + urlParsed.pathname = path31; return urlParsed.toString(); } function setURLParameter(url2, name, value) { @@ -61786,9 +61786,9 @@ var require_StorageSharedKeyCredentialPolicy = __commonJS({ * @param request - */ getCanonicalizedResourceString(request3) { - const path30 = (0, import_utils_common.getURLPath)(request3.url) || "/"; + const path31 = (0, import_utils_common.getURLPath)(request3.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path30}`; + canonicalizedResourceString += `/${this.factory.accountName}${path31}`; const queries = (0, import_utils_common.getURLQueries)(request3.url); const lowercaseQueries = {}; if (queries) { @@ -62579,9 +62579,9 @@ var require_StorageSharedKeyCredentialPolicyV2 = __commonJS({ return canonicalizedHeadersStringToSign; } function getCanonicalizedResourceString(request3) { - const path30 = (0, import_utils_common.getURLPath)(request3.url) || "/"; + const path31 = (0, import_utils_common.getURLPath)(request3.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${options.accountName}${path30}`; + canonicalizedResourceString += `/${options.accountName}${path31}`; const queries = (0, import_utils_common.getURLQueries)(request3.url); const lowercaseQueries = {}; if (queries) { @@ -78322,10 +78322,10 @@ var require_utils_common2 = __commonJS({ ]; function escapeURLPath(url2) { const urlParsed = new URL(url2); - let path30 = urlParsed.pathname; - path30 = path30 || "/"; - path30 = escape3(path30); - urlParsed.pathname = path30; + let path31 = urlParsed.pathname; + path31 = path31 || "/"; + path31 = escape3(path31); + urlParsed.pathname = path31; return urlParsed.toString(); } function getProxyUriFromDevConnString(connectionString) { @@ -78412,9 +78412,9 @@ var require_utils_common2 = __commonJS({ } function appendToURLPath(url2, name) { const urlParsed = new URL(url2); - let path30 = urlParsed.pathname; - path30 = path30 ? path30.endsWith("/") ? `${path30}${name}` : `${path30}/${name}` : name; - urlParsed.pathname = path30; + let path31 = urlParsed.pathname; + path31 = path31 ? path31.endsWith("/") ? `${path31}${name}` : `${path31}/${name}` : name; + urlParsed.pathname = path31; return urlParsed.toString(); } function setURLParameter(url2, name, value) { @@ -103835,8 +103835,8 @@ var require_BlobBatch = __commonJS({ if (this.operationCount >= import_constants5.BATCH_MAX_REQUEST) { throw new RangeError(`Cannot exceed ${import_constants5.BATCH_MAX_REQUEST} sub requests in a single batch`); } - const path30 = (0, import_utils_common.getURLPath)(subRequest.url); - if (!path30 || path30 === "") { + const path31 = (0, import_utils_common.getURLPath)(subRequest.url); + if (!path31 || path31 === "") { throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`); } } @@ -103933,8 +103933,8 @@ var require_BlobBatchClient = __commonJS({ pipeline2 = (0, import_Pipeline.newPipeline)(credentialOrPipeline, options); } const storageClientContext = new import_StorageContextClient.StorageContextClient(url2, (0, import_Pipeline.getCoreClientOptions)(pipeline2)); - const path30 = (0, import_utils_common.getURLPath)(url2); - if (path30 && path30 !== "/") { + const path31 = (0, import_utils_common.getURLPath)(url2); + if (path31 && path31 !== "/") { this.serviceOrContainerContext = storageClientContext.container; } else { this.serviceOrContainerContext = storageClientContext.service; @@ -107769,7 +107769,7 @@ var require_downloadUtils = __commonJS({ var http_client_1 = require_lib(); var storage_blob_1 = require_commonjs15(); var buffer = __importStar2(require("buffer")); - var fs34 = __importStar2(require("fs")); + var fs35 = __importStar2(require("fs")); var stream2 = __importStar2(require("stream")); var util4 = __importStar2(require("util")); var utils = __importStar2(require_cacheUtils()); @@ -107880,7 +107880,7 @@ var require_downloadUtils = __commonJS({ exports2.DownloadProgress = DownloadProgress; function downloadCacheHttpClient(archiveLocation, archivePath) { return __awaiter2(this, void 0, void 0, function* () { - const writeStream = fs34.createWriteStream(archivePath); + const writeStream = fs35.createWriteStream(archivePath); const httpClient = new http_client_1.HttpClient("actions/cache"); const downloadResponse = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCache", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.get(archiveLocation); @@ -107905,7 +107905,7 @@ var require_downloadUtils = __commonJS({ function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options) { return __awaiter2(this, void 0, void 0, function* () { var _a6; - const archiveDescriptor = yield fs34.promises.open(archivePath, "w"); + const archiveDescriptor = yield fs35.promises.open(archivePath, "w"); const httpClient = new http_client_1.HttpClient("actions/cache", void 0, { socketTimeout: options.timeoutInMs, keepAlive: true @@ -108021,7 +108021,7 @@ var require_downloadUtils = __commonJS({ } else { const maxSegmentSize = Math.min(134217728, buffer.constants.MAX_LENGTH); const downloadProgress = new DownloadProgress(contentLength); - const fd = fs34.openSync(archivePath, "w"); + const fd = fs35.openSync(archivePath, "w"); try { downloadProgress.startDisplayTimer(); const controller = new abort_controller_1.AbortController(); @@ -108039,12 +108039,12 @@ var require_downloadUtils = __commonJS({ controller.abort(); throw new Error("Aborting cache download as the download time exceeded the timeout."); } else if (Buffer.isBuffer(result)) { - fs34.writeFileSync(fd, result); + fs35.writeFileSync(fd, result); } } } finally { downloadProgress.stopDisplayTimer(); - fs34.closeSync(fd); + fs35.closeSync(fd); } } }); @@ -108383,7 +108383,7 @@ var require_cacheHttpClient = __commonJS({ var core29 = __importStar2(require_core()); var http_client_1 = require_lib(); var auth_1 = require_auth(); - var fs34 = __importStar2(require("fs")); + var fs35 = __importStar2(require("fs")); var url_1 = require("url"); var utils = __importStar2(require_cacheUtils()); var uploadUtils_1 = require_uploadUtils(); @@ -108524,7 +108524,7 @@ Other caches with similar key:`); return __awaiter2(this, void 0, void 0, function* () { const fileSize = utils.getArchiveFileSizeInBytes(archivePath); const resourceUrl = getCacheApiUrl(`caches/${cacheId.toString()}`); - const fd = fs34.openSync(archivePath, "r"); + const fd = fs35.openSync(archivePath, "r"); const uploadOptions = (0, options_1.getUploadOptions)(options); const concurrency = utils.assertDefined("uploadConcurrency", uploadOptions.uploadConcurrency); const maxChunkSize = utils.assertDefined("uploadChunkSize", uploadOptions.uploadChunkSize); @@ -108538,7 +108538,7 @@ Other caches with similar key:`); const start = offset; const end = offset + chunkSize - 1; offset += maxChunkSize; - yield uploadChunk(httpClient, resourceUrl, () => fs34.createReadStream(archivePath, { + yield uploadChunk(httpClient, resourceUrl, () => fs35.createReadStream(archivePath, { fd, start, end, @@ -108549,7 +108549,7 @@ Other caches with similar key:`); } }))); } finally { - fs34.closeSync(fd); + fs35.closeSync(fd); } return; }); @@ -113815,7 +113815,7 @@ var require_tar = __commonJS({ var exec_1 = require_exec(); var io10 = __importStar2(require_io()); var fs_1 = require("fs"); - var path30 = __importStar2(require("path")); + var path31 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); var constants_1 = require_constants7(); var IS_WINDOWS = process.platform === "win32"; @@ -113861,13 +113861,13 @@ var require_tar = __commonJS({ const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD && compressionMethod !== constants_1.CompressionMethod.Gzip && IS_WINDOWS; switch (type) { case "create": - args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path30.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path30.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path30.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); + args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path31.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path31.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path31.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); break; case "extract": - args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path30.sep}`, "g"), "/"), "-P", "-C", BSD_TAR_ZSTD ? quoteAbsolutePath(workingDirectory) : workingDirectory.replace(new RegExp(`\\${path30.sep}`, "g"), "/")); + args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path31.sep}`, "g"), "/"), "-P", "-C", BSD_TAR_ZSTD ? quoteAbsolutePath(workingDirectory) : workingDirectory.replace(new RegExp(`\\${path31.sep}`, "g"), "/")); break; case "list": - args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path30.sep}`, "g"), "/"), "-P"); + args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path31.sep}`, "g"), "/"), "-P"); break; } if (tarPath.type === constants_1.ArchiveToolType.GNU) { @@ -113906,7 +113906,7 @@ var require_tar = __commonJS({ return (_a6 = process.env["GITHUB_WORKSPACE"]) !== null && _a6 !== void 0 ? _a6 : process.cwd(); } function quoteAbsolutePath(filePath) { - return `"${path30.resolve(filePath).replace(new RegExp(`\\${path30.sep}`, "g"), "/")}"`; + return `"${path31.resolve(filePath).replace(new RegExp(`\\${path31.sep}`, "g"), "/")}"`; } function getDecompressionProgram(tarPath, compressionMethod, archivePath) { return __awaiter2(this, void 0, void 0, function* () { @@ -113936,7 +113936,7 @@ var require_tar = __commonJS({ case constants_1.CompressionMethod.Zstd: return BSD_TAR_ZSTD ? [ "zstd -T0 --long=30 --force -o", - cacheFileName.replace(new RegExp(`\\${path30.sep}`, "g"), "/"), + cacheFileName.replace(new RegExp(`\\${path31.sep}`, "g"), "/"), constants_1.TarFilename ] : [ "--use-compress-program", @@ -113945,7 +113945,7 @@ var require_tar = __commonJS({ case constants_1.CompressionMethod.ZstdWithoutLong: return BSD_TAR_ZSTD ? [ "zstd -T0 --force -o", - cacheFileName.replace(new RegExp(`\\${path30.sep}`, "g"), "/"), + cacheFileName.replace(new RegExp(`\\${path31.sep}`, "g"), "/"), constants_1.TarFilename ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -T0"' : "zstdmt"]; default: @@ -113998,7 +113998,7 @@ var require_tar = __commonJS({ } function createTar(archiveFolder, sourceDirectories, compressionMethod) { return __awaiter2(this, void 0, void 0, function* () { - (0, fs_1.writeFileSync)(path30.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); + (0, fs_1.writeFileSync)(path31.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); const { commands } = yield getCommands(compressionMethod, "create"); yield execCommands(commands, archiveFolder); }); @@ -114080,7 +114080,7 @@ var require_cache6 = __commonJS({ exports2.restoreCache = restoreCache5; exports2.saveCache = saveCache5; var core29 = __importStar2(require_core()); - var path30 = __importStar2(require("path")); + var path31 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); var cacheHttpClient = __importStar2(require_cacheHttpClient()); var cacheTwirpClient = __importStar2(require_cacheTwirpClient()); @@ -114210,7 +114210,7 @@ var require_cache6 = __commonJS({ core29.info("Lookup only - skipping download"); return cacheEntry.cacheKey; } - archivePath = path30.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + archivePath = path31.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); core29.debug(`Archive Path: ${archivePath}`); yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); if (core29.isDebug()) { @@ -114289,7 +114289,7 @@ var require_cache6 = __commonJS({ core29.info("Lookup only - skipping download"); return response.matchedKey; } - archivePath = path30.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + archivePath = path31.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); core29.debug(`Archive path: ${archivePath}`); core29.debug(`Starting download of archive to: ${archivePath}`); yield cacheHttpClient.downloadCache(response.signedDownloadUrl, archivePath, options); @@ -114357,7 +114357,7 @@ var require_cache6 = __commonJS({ 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 = path30.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + const archivePath = path31.join(archiveFolder, utils.getCacheFileName(compressionMethod)); core29.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); @@ -114428,7 +114428,7 @@ var require_cache6 = __commonJS({ 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 = path30.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + const archivePath = path31.join(archiveFolder, utils.getCacheFileName(compressionMethod)); core29.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); @@ -114584,7 +114584,7 @@ var require_manifest = __commonJS({ var core_1 = require_core(); var os8 = require("os"); var cp = require("child_process"); - var fs34 = require("fs"); + var fs35 = require("fs"); function _findMatch(versionSpec, stable, candidates, archFilter) { return __awaiter2(this, void 0, void 0, function* () { const platFilter = os8.platform(); @@ -114646,10 +114646,10 @@ var require_manifest = __commonJS({ const lsbReleaseFile = "/etc/lsb-release"; const osReleaseFile = "/etc/os-release"; let contents = ""; - if (fs34.existsSync(lsbReleaseFile)) { - contents = fs34.readFileSync(lsbReleaseFile).toString(); - } else if (fs34.existsSync(osReleaseFile)) { - contents = fs34.readFileSync(osReleaseFile).toString(); + if (fs35.existsSync(lsbReleaseFile)) { + contents = fs35.readFileSync(lsbReleaseFile).toString(); + } else if (fs35.existsSync(osReleaseFile)) { + contents = fs35.readFileSync(osReleaseFile).toString(); } return contents; } @@ -114858,10 +114858,10 @@ var require_tool_cache = __commonJS({ var core29 = __importStar2(require_core()); var io10 = __importStar2(require_io()); var crypto3 = __importStar2(require("crypto")); - var fs34 = __importStar2(require("fs")); + var fs35 = __importStar2(require("fs")); var mm = __importStar2(require_manifest()); var os8 = __importStar2(require("os")); - var path30 = __importStar2(require("path")); + var path31 = __importStar2(require("path")); var httpm = __importStar2(require_lib()); var semver13 = __importStar2(require_semver2()); var stream2 = __importStar2(require("stream")); @@ -114882,8 +114882,8 @@ var require_tool_cache = __commonJS({ var userAgent2 = "actions/tool-cache"; function downloadTool3(url2, dest, auth2, headers) { return __awaiter2(this, void 0, void 0, function* () { - dest = dest || path30.join(_getTempDirectory(), crypto3.randomUUID()); - yield io10.mkdirP(path30.dirname(dest)); + dest = dest || path31.join(_getTempDirectory(), crypto3.randomUUID()); + yield io10.mkdirP(path31.dirname(dest)); core29.debug(`Downloading ${url2}`); core29.debug(`Destination ${dest}`); const maxAttempts = 3; @@ -114904,7 +114904,7 @@ var require_tool_cache = __commonJS({ } function downloadToolAttempt(url2, dest, auth2, headers) { return __awaiter2(this, void 0, void 0, function* () { - if (fs34.existsSync(dest)) { + if (fs35.existsSync(dest)) { throw new Error(`Destination file path ${dest} already exists`); } const http = new httpm.HttpClient(userAgent2, [], { @@ -114928,7 +114928,7 @@ var require_tool_cache = __commonJS({ const readStream = responseMessageFactory(); let succeeded = false; try { - yield pipeline2(readStream, fs34.createWriteStream(dest)); + yield pipeline2(readStream, fs35.createWriteStream(dest)); core29.debug("download complete"); succeeded = true; return dest; @@ -114973,7 +114973,7 @@ var require_tool_cache = __commonJS({ process.chdir(originalCwd); } } else { - const escapedScript = path30.join(__dirname, "..", "scripts", "Invoke-7zdec.ps1").replace(/'/g, "''").replace(/"|\n|\r/g, ""); + const escapedScript = path31.join(__dirname, "..", "scripts", "Invoke-7zdec.ps1").replace(/'/g, "''").replace(/"|\n|\r/g, ""); const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ""); const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, ""); const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`; @@ -115140,12 +115140,12 @@ var require_tool_cache = __commonJS({ arch2 = arch2 || os8.arch(); core29.debug(`Caching tool ${tool} ${version} ${arch2}`); core29.debug(`source dir: ${sourceDir}`); - if (!fs34.statSync(sourceDir).isDirectory()) { + if (!fs35.statSync(sourceDir).isDirectory()) { throw new Error("sourceDir is not a directory"); } const destPath = yield _createToolPath(tool, version, arch2); - for (const itemName of fs34.readdirSync(sourceDir)) { - const s = path30.join(sourceDir, itemName); + for (const itemName of fs35.readdirSync(sourceDir)) { + const s = path31.join(sourceDir, itemName); yield io10.cp(s, destPath, { recursive: true }); } _completeToolPath(tool, version, arch2); @@ -115158,11 +115158,11 @@ var require_tool_cache = __commonJS({ arch2 = arch2 || os8.arch(); core29.debug(`Caching tool ${tool} ${version} ${arch2}`); core29.debug(`source file: ${sourceFile}`); - if (!fs34.statSync(sourceFile).isFile()) { + if (!fs35.statSync(sourceFile).isFile()) { throw new Error("sourceFile is not a file"); } const destFolder = yield _createToolPath(tool, version, arch2); - const destPath = path30.join(destFolder, targetFile); + const destPath = path31.join(destFolder, targetFile); core29.debug(`destination file ${destPath}`); yield io10.cp(sourceFile, destPath); _completeToolPath(tool, version, arch2); @@ -115185,9 +115185,9 @@ var require_tool_cache = __commonJS({ let toolPath = ""; if (versionSpec) { versionSpec = semver13.clean(versionSpec) || ""; - const cachePath = path30.join(_getCacheDirectory(), toolName, versionSpec, arch2); + const cachePath = path31.join(_getCacheDirectory(), toolName, versionSpec, arch2); core29.debug(`checking cache: ${cachePath}`); - if (fs34.existsSync(cachePath) && fs34.existsSync(`${cachePath}.complete`)) { + if (fs35.existsSync(cachePath) && fs35.existsSync(`${cachePath}.complete`)) { core29.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); toolPath = cachePath; } else { @@ -115199,13 +115199,13 @@ var require_tool_cache = __commonJS({ function findAllVersions2(toolName, arch2) { const versions = []; arch2 = arch2 || os8.arch(); - const toolPath = path30.join(_getCacheDirectory(), toolName); - if (fs34.existsSync(toolPath)) { - const children = fs34.readdirSync(toolPath); + const toolPath = path31.join(_getCacheDirectory(), toolName); + if (fs35.existsSync(toolPath)) { + const children = fs35.readdirSync(toolPath); for (const child of children) { if (isExplicitVersion(child)) { - const fullPath = path30.join(toolPath, child, arch2 || ""); - if (fs34.existsSync(fullPath) && fs34.existsSync(`${fullPath}.complete`)) { + const fullPath = path31.join(toolPath, child, arch2 || ""); + if (fs35.existsSync(fullPath) && fs35.existsSync(`${fullPath}.complete`)) { versions.push(child); } } @@ -115256,7 +115256,7 @@ var require_tool_cache = __commonJS({ function _createExtractFolder(dest) { return __awaiter2(this, void 0, void 0, function* () { if (!dest) { - dest = path30.join(_getTempDirectory(), crypto3.randomUUID()); + dest = path31.join(_getTempDirectory(), crypto3.randomUUID()); } yield io10.mkdirP(dest); return dest; @@ -115264,7 +115264,7 @@ var require_tool_cache = __commonJS({ } function _createToolPath(tool, version, arch2) { return __awaiter2(this, void 0, void 0, function* () { - const folderPath = path30.join(_getCacheDirectory(), tool, semver13.clean(version) || version, arch2 || ""); + const folderPath = path31.join(_getCacheDirectory(), tool, semver13.clean(version) || version, arch2 || ""); core29.debug(`destination ${folderPath}`); const markerPath = `${folderPath}.complete`; yield io10.rmRF(folderPath); @@ -115274,9 +115274,9 @@ var require_tool_cache = __commonJS({ }); } function _completeToolPath(tool, version, arch2) { - const folderPath = path30.join(_getCacheDirectory(), tool, semver13.clean(version) || version, arch2 || ""); + const folderPath = path31.join(_getCacheDirectory(), tool, semver13.clean(version) || version, arch2 || ""); const markerPath = `${folderPath}.complete`; - fs34.writeFileSync(markerPath, ""); + fs35.writeFileSync(markerPath, ""); core29.debug("finished caching tool"); } function isExplicitVersion(versionSpec) { @@ -120935,13 +120935,13 @@ These characters are not allowed in the artifact name due to limitations with ce (0, core_1.info)(`Artifact name is valid!`); } exports2.validateArtifactName = validateArtifactName; - function validateFilePath(path30) { - if (!path30) { + function validateFilePath(path31) { + if (!path31) { throw new Error(`Provided file path input during validation is empty`); } for (const [invalidCharacterKey, errorMessageForCharacter] of invalidArtifactFilePathCharacters) { - if (path30.includes(invalidCharacterKey)) { - throw new Error(`The path for one of the files in artifact is not valid: ${path30}. Contains the following character: ${errorMessageForCharacter} + if (path31.includes(invalidCharacterKey)) { + throw new Error(`The path for one of the files in artifact is not valid: ${path31}. Contains the following character: ${errorMessageForCharacter} Invalid characters include: ${Array.from(invalidArtifactFilePathCharacters.values()).toString()} @@ -121486,15 +121486,15 @@ var require_upload_zip_specification = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getUploadZipSpecification = exports2.validateRootDirectory = void 0; - var fs34 = __importStar2(require("fs")); + var fs35 = __importStar2(require("fs")); var core_1 = require_core(); var path_1 = require("path"); var path_and_artifact_name_validation_1 = require_path_and_artifact_name_validation(); function validateRootDirectory(rootDirectory) { - if (!fs34.existsSync(rootDirectory)) { + if (!fs35.existsSync(rootDirectory)) { throw new Error(`The provided rootDirectory ${rootDirectory} does not exist`); } - if (!fs34.statSync(rootDirectory).isDirectory()) { + if (!fs35.statSync(rootDirectory).isDirectory()) { throw new Error(`The provided rootDirectory ${rootDirectory} is not a valid directory`); } (0, core_1.info)(`Root directory input is valid!`); @@ -121505,7 +121505,7 @@ var require_upload_zip_specification = __commonJS({ rootDirectory = (0, path_1.normalize)(rootDirectory); rootDirectory = (0, path_1.resolve)(rootDirectory); for (let file of filesToZip) { - const stats = fs34.lstatSync(file, { throwIfNoEntry: false }); + const stats = fs35.lstatSync(file, { throwIfNoEntry: false }); if (!stats) { throw new Error(`File ${file} does not exist`); } @@ -121934,8 +121934,8 @@ var require_minimatch2 = __commonJS({ return new Minimatch2(pattern, options).match(p); }; module2.exports = minimatch2; - var path30 = require_path(); - minimatch2.sep = path30.sep; + var path31 = require_path(); + minimatch2.sep = path31.sep; var GLOBSTAR2 = /* @__PURE__ */ Symbol("globstar **"); minimatch2.GLOBSTAR = GLOBSTAR2; var expand3 = require_brace_expansion2(); @@ -122541,8 +122541,8 @@ var require_minimatch2 = __commonJS({ if (this.empty) return f === ""; if (f === "/" && partial) return true; const options = this.options; - if (path30.sep !== "/") { - f = f.split(path30.sep).join("/"); + if (path31.sep !== "/") { + f = f.split(path31.sep).join("/"); } f = f.split(slashSplit); this.debug(this.pattern, "split", f); @@ -122580,13 +122580,13 @@ var require_minimatch2 = __commonJS({ var require_readdir_glob = __commonJS({ "node_modules/@actions/artifact/node_modules/readdir-glob/index.js"(exports2, module2) { module2.exports = readdirGlob2; - var fs34 = require("fs"); + var fs35 = require("fs"); var { EventEmitter: EventEmitter2 } = require("events"); var { Minimatch: Minimatch2 } = require_minimatch2(); var { resolve: resolve15 } = require("path"); function readdir3(dir, strict) { return new Promise((resolve16, reject) => { - fs34.readdir(dir, { withFileTypes: true }, (err, files) => { + fs35.readdir(dir, { withFileTypes: true }, (err, files) => { if (err) { switch (err.code) { case "ENOTDIR": @@ -122619,7 +122619,7 @@ var require_readdir_glob = __commonJS({ } function stat2(file, followSymlinks) { return new Promise((resolve16, reject) => { - const statFunc = followSymlinks ? fs34.stat : fs34.lstat; + const statFunc = followSymlinks ? fs35.stat : fs35.lstat; statFunc(file, (err, stats) => { if (err) { switch (err.code) { @@ -122640,8 +122640,8 @@ var require_readdir_glob = __commonJS({ }); }); } - async function* exploreWalkAsync2(dir, path30, followSymlinks, useStat, shouldSkip, strict) { - let files = await readdir3(path30 + dir, strict); + async function* exploreWalkAsync2(dir, path31, followSymlinks, useStat, shouldSkip, strict) { + let files = await readdir3(path31 + dir, strict); for (const file of files) { let name = file.name; if (name === void 0) { @@ -122650,7 +122650,7 @@ var require_readdir_glob = __commonJS({ } const filename = dir + "/" + name; const relative3 = filename.slice(1); - const absolute = path30 + "/" + relative3; + const absolute = path31 + "/" + relative3; let stats = null; if (useStat || followSymlinks) { stats = await stat2(absolute, followSymlinks); @@ -122664,15 +122664,15 @@ var require_readdir_glob = __commonJS({ if (stats.isDirectory()) { if (!shouldSkip(relative3)) { yield { relative: relative3, absolute, stats }; - yield* exploreWalkAsync2(filename, path30, followSymlinks, useStat, shouldSkip, false); + yield* exploreWalkAsync2(filename, path31, followSymlinks, useStat, shouldSkip, false); } } else { yield { relative: relative3, absolute, stats }; } } } - async function* explore2(path30, followSymlinks, useStat, shouldSkip) { - yield* exploreWalkAsync2("", path30, followSymlinks, useStat, shouldSkip, true); + async function* explore2(path31, followSymlinks, useStat, shouldSkip) { + yield* exploreWalkAsync2("", path31, followSymlinks, useStat, shouldSkip, true); } function readOptions2(options) { return { @@ -124684,54 +124684,54 @@ var require_polyfills = __commonJS({ } var chdir; module2.exports = patch; - function patch(fs34) { + function patch(fs35) { if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { - patchLchmod(fs34); - } - if (!fs34.lutimes) { - patchLutimes(fs34); - } - fs34.chown = chownFix(fs34.chown); - fs34.fchown = chownFix(fs34.fchown); - fs34.lchown = chownFix(fs34.lchown); - fs34.chmod = chmodFix(fs34.chmod); - fs34.fchmod = chmodFix(fs34.fchmod); - fs34.lchmod = chmodFix(fs34.lchmod); - fs34.chownSync = chownFixSync(fs34.chownSync); - fs34.fchownSync = chownFixSync(fs34.fchownSync); - fs34.lchownSync = chownFixSync(fs34.lchownSync); - fs34.chmodSync = chmodFixSync(fs34.chmodSync); - fs34.fchmodSync = chmodFixSync(fs34.fchmodSync); - fs34.lchmodSync = chmodFixSync(fs34.lchmodSync); - fs34.stat = statFix(fs34.stat); - fs34.fstat = statFix(fs34.fstat); - fs34.lstat = statFix(fs34.lstat); - fs34.statSync = statFixSync(fs34.statSync); - fs34.fstatSync = statFixSync(fs34.fstatSync); - fs34.lstatSync = statFixSync(fs34.lstatSync); - if (fs34.chmod && !fs34.lchmod) { - fs34.lchmod = function(path30, mode, cb) { + patchLchmod(fs35); + } + if (!fs35.lutimes) { + patchLutimes(fs35); + } + fs35.chown = chownFix(fs35.chown); + fs35.fchown = chownFix(fs35.fchown); + fs35.lchown = chownFix(fs35.lchown); + fs35.chmod = chmodFix(fs35.chmod); + fs35.fchmod = chmodFix(fs35.fchmod); + fs35.lchmod = chmodFix(fs35.lchmod); + fs35.chownSync = chownFixSync(fs35.chownSync); + fs35.fchownSync = chownFixSync(fs35.fchownSync); + fs35.lchownSync = chownFixSync(fs35.lchownSync); + fs35.chmodSync = chmodFixSync(fs35.chmodSync); + fs35.fchmodSync = chmodFixSync(fs35.fchmodSync); + fs35.lchmodSync = chmodFixSync(fs35.lchmodSync); + fs35.stat = statFix(fs35.stat); + fs35.fstat = statFix(fs35.fstat); + fs35.lstat = statFix(fs35.lstat); + fs35.statSync = statFixSync(fs35.statSync); + fs35.fstatSync = statFixSync(fs35.fstatSync); + fs35.lstatSync = statFixSync(fs35.lstatSync); + if (fs35.chmod && !fs35.lchmod) { + fs35.lchmod = function(path31, mode, cb) { if (cb) process.nextTick(cb); }; - fs34.lchmodSync = function() { + fs35.lchmodSync = function() { }; } - if (fs34.chown && !fs34.lchown) { - fs34.lchown = function(path30, uid, gid, cb) { + if (fs35.chown && !fs35.lchown) { + fs35.lchown = function(path31, uid, gid, cb) { if (cb) process.nextTick(cb); }; - fs34.lchownSync = function() { + fs35.lchownSync = function() { }; } if (platform2 === "win32") { - fs34.rename = typeof fs34.rename !== "function" ? fs34.rename : (function(fs$rename) { + fs35.rename = typeof fs35.rename !== "function" ? fs35.rename : (function(fs$rename) { function rename(from, to, cb) { var start = Date.now(); var backoff = 0; fs$rename(from, to, function CB(er) { if (er && (er.code === "EACCES" || er.code === "EPERM") && Date.now() - start < 6e4) { setTimeout(function() { - fs34.stat(to, function(stater, st) { + fs35.stat(to, function(stater, st) { if (stater && stater.code === "ENOENT") fs$rename(from, to, CB); else @@ -124747,9 +124747,9 @@ var require_polyfills = __commonJS({ } if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename); return rename; - })(fs34.rename); + })(fs35.rename); } - fs34.read = typeof fs34.read !== "function" ? fs34.read : (function(fs$read) { + fs35.read = typeof fs35.read !== "function" ? fs35.read : (function(fs$read) { function read(fd, buffer, offset, length, position, callback_) { var callback; if (callback_ && typeof callback_ === "function") { @@ -124757,22 +124757,22 @@ var require_polyfills = __commonJS({ callback = function(er, _2, __) { if (er && er.code === "EAGAIN" && eagCounter < 10) { eagCounter++; - return fs$read.call(fs34, fd, buffer, offset, length, position, callback); + return fs$read.call(fs35, fd, buffer, offset, length, position, callback); } callback_.apply(this, arguments); }; } - return fs$read.call(fs34, fd, buffer, offset, length, position, callback); + return fs$read.call(fs35, fd, buffer, offset, length, position, callback); } if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read); return read; - })(fs34.read); - fs34.readSync = typeof fs34.readSync !== "function" ? fs34.readSync : /* @__PURE__ */ (function(fs$readSync) { + })(fs35.read); + fs35.readSync = typeof fs35.readSync !== "function" ? fs35.readSync : /* @__PURE__ */ (function(fs$readSync) { return function(fd, buffer, offset, length, position) { var eagCounter = 0; while (true) { try { - return fs$readSync.call(fs34, fd, buffer, offset, length, position); + return fs$readSync.call(fs35, fd, buffer, offset, length, position); } catch (er) { if (er.code === "EAGAIN" && eagCounter < 10) { eagCounter++; @@ -124782,11 +124782,11 @@ var require_polyfills = __commonJS({ } } }; - })(fs34.readSync); - function patchLchmod(fs35) { - fs35.lchmod = function(path30, mode, callback) { - fs35.open( - path30, + })(fs35.readSync); + function patchLchmod(fs36) { + fs36.lchmod = function(path31, mode, callback) { + fs36.open( + path31, constants.O_WRONLY | constants.O_SYMLINK, mode, function(err, fd) { @@ -124794,80 +124794,80 @@ var require_polyfills = __commonJS({ if (callback) callback(err); return; } - fs35.fchmod(fd, mode, function(err2) { - fs35.close(fd, function(err22) { + fs36.fchmod(fd, mode, function(err2) { + fs36.close(fd, function(err22) { if (callback) callback(err2 || err22); }); }); } ); }; - fs35.lchmodSync = function(path30, mode) { - var fd = fs35.openSync(path30, constants.O_WRONLY | constants.O_SYMLINK, mode); + fs36.lchmodSync = function(path31, mode) { + var fd = fs36.openSync(path31, constants.O_WRONLY | constants.O_SYMLINK, mode); var threw = true; var ret; try { - ret = fs35.fchmodSync(fd, mode); + ret = fs36.fchmodSync(fd, mode); threw = false; } finally { if (threw) { try { - fs35.closeSync(fd); + fs36.closeSync(fd); } catch (er) { } } else { - fs35.closeSync(fd); + fs36.closeSync(fd); } } return ret; }; } - function patchLutimes(fs35) { - if (constants.hasOwnProperty("O_SYMLINK") && fs35.futimes) { - fs35.lutimes = function(path30, at, mt, cb) { - fs35.open(path30, constants.O_SYMLINK, function(er, fd) { + function patchLutimes(fs36) { + if (constants.hasOwnProperty("O_SYMLINK") && fs36.futimes) { + fs36.lutimes = function(path31, at, mt, cb) { + fs36.open(path31, constants.O_SYMLINK, function(er, fd) { if (er) { if (cb) cb(er); return; } - fs35.futimes(fd, at, mt, function(er2) { - fs35.close(fd, function(er22) { + fs36.futimes(fd, at, mt, function(er2) { + fs36.close(fd, function(er22) { if (cb) cb(er2 || er22); }); }); }); }; - fs35.lutimesSync = function(path30, at, mt) { - var fd = fs35.openSync(path30, constants.O_SYMLINK); + fs36.lutimesSync = function(path31, at, mt) { + var fd = fs36.openSync(path31, constants.O_SYMLINK); var ret; var threw = true; try { - ret = fs35.futimesSync(fd, at, mt); + ret = fs36.futimesSync(fd, at, mt); threw = false; } finally { if (threw) { try { - fs35.closeSync(fd); + fs36.closeSync(fd); } catch (er) { } } else { - fs35.closeSync(fd); + fs36.closeSync(fd); } } return ret; }; - } else if (fs35.futimes) { - fs35.lutimes = function(_a6, _b2, _c2, cb) { + } else if (fs36.futimes) { + fs36.lutimes = function(_a6, _b2, _c2, cb) { if (cb) process.nextTick(cb); }; - fs35.lutimesSync = function() { + fs36.lutimesSync = function() { }; } } function chmodFix(orig) { if (!orig) return orig; return function(target, mode, cb) { - return orig.call(fs34, target, mode, function(er) { + return orig.call(fs35, target, mode, function(er) { if (chownErOk(er)) er = null; if (cb) cb.apply(this, arguments); }); @@ -124877,7 +124877,7 @@ var require_polyfills = __commonJS({ if (!orig) return orig; return function(target, mode) { try { - return orig.call(fs34, target, mode); + return orig.call(fs35, target, mode); } catch (er) { if (!chownErOk(er)) throw er; } @@ -124886,7 +124886,7 @@ var require_polyfills = __commonJS({ function chownFix(orig) { if (!orig) return orig; return function(target, uid, gid, cb) { - return orig.call(fs34, target, uid, gid, function(er) { + return orig.call(fs35, target, uid, gid, function(er) { if (chownErOk(er)) er = null; if (cb) cb.apply(this, arguments); }); @@ -124896,7 +124896,7 @@ var require_polyfills = __commonJS({ if (!orig) return orig; return function(target, uid, gid) { try { - return orig.call(fs34, target, uid, gid); + return orig.call(fs35, target, uid, gid); } catch (er) { if (!chownErOk(er)) throw er; } @@ -124916,13 +124916,13 @@ var require_polyfills = __commonJS({ } if (cb) cb.apply(this, arguments); } - return options ? orig.call(fs34, target, options, callback) : orig.call(fs34, target, callback); + return options ? orig.call(fs35, target, options, callback) : orig.call(fs35, target, callback); }; } function statFixSync(orig) { if (!orig) return orig; return function(target, options) { - var stats = options ? orig.call(fs34, target, options) : orig.call(fs34, target); + var stats = options ? orig.call(fs35, target, options) : orig.call(fs35, target); if (stats) { if (stats.uid < 0) stats.uid += 4294967296; if (stats.gid < 0) stats.gid += 4294967296; @@ -124951,16 +124951,16 @@ var require_legacy_streams = __commonJS({ "node_modules/graceful-fs/legacy-streams.js"(exports2, module2) { var Stream = require("stream").Stream; module2.exports = legacy; - function legacy(fs34) { + function legacy(fs35) { return { ReadStream, WriteStream }; - function ReadStream(path30, options) { - if (!(this instanceof ReadStream)) return new ReadStream(path30, options); + function ReadStream(path31, options) { + if (!(this instanceof ReadStream)) return new ReadStream(path31, options); Stream.call(this); var self2 = this; - this.path = path30; + this.path = path31; this.fd = null; this.readable = true; this.paused = false; @@ -124994,7 +124994,7 @@ var require_legacy_streams = __commonJS({ }); return; } - fs34.open(this.path, this.flags, this.mode, function(err, fd) { + fs35.open(this.path, this.flags, this.mode, function(err, fd) { if (err) { self2.emit("error", err); self2.readable = false; @@ -125005,10 +125005,10 @@ var require_legacy_streams = __commonJS({ self2._read(); }); } - function WriteStream(path30, options) { - if (!(this instanceof WriteStream)) return new WriteStream(path30, options); + function WriteStream(path31, options) { + if (!(this instanceof WriteStream)) return new WriteStream(path31, options); Stream.call(this); - this.path = path30; + this.path = path31; this.fd = null; this.writable = true; this.flags = "w"; @@ -125033,7 +125033,7 @@ var require_legacy_streams = __commonJS({ this.busy = false; this._queue = []; if (this.fd === null) { - this._open = fs34.open; + this._open = fs35.open; this._queue.push([this._open, this.path, this.flags, this.mode, void 0]); this.flush(); } @@ -125068,7 +125068,7 @@ var require_clone = __commonJS({ // node_modules/graceful-fs/graceful-fs.js var require_graceful_fs = __commonJS({ "node_modules/graceful-fs/graceful-fs.js"(exports2, module2) { - var fs34 = require("fs"); + var fs35 = require("fs"); var polyfills = require_polyfills(); var legacy = require_legacy_streams(); var clone = require_clone(); @@ -125100,12 +125100,12 @@ var require_graceful_fs = __commonJS({ m = "GFS4: " + m.split(/\n/).join("\nGFS4: "); console.error(m); }; - if (!fs34[gracefulQueue]) { + if (!fs35[gracefulQueue]) { queue2 = global[gracefulQueue] || []; - publishQueue(fs34, queue2); - fs34.close = (function(fs$close) { + publishQueue(fs35, queue2); + fs35.close = (function(fs$close) { function close(fd, cb) { - return fs$close.call(fs34, fd, function(err) { + return fs$close.call(fs35, fd, function(err) { if (!err) { resetQueue(); } @@ -125117,48 +125117,48 @@ var require_graceful_fs = __commonJS({ value: fs$close }); return close; - })(fs34.close); - fs34.closeSync = (function(fs$closeSync) { + })(fs35.close); + fs35.closeSync = (function(fs$closeSync) { function closeSync(fd) { - fs$closeSync.apply(fs34, arguments); + fs$closeSync.apply(fs35, arguments); resetQueue(); } Object.defineProperty(closeSync, previousSymbol, { value: fs$closeSync }); return closeSync; - })(fs34.closeSync); + })(fs35.closeSync); if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) { process.on("exit", function() { - debug6(fs34[gracefulQueue]); - require("assert").equal(fs34[gracefulQueue].length, 0); + debug6(fs35[gracefulQueue]); + require("assert").equal(fs35[gracefulQueue].length, 0); }); } } var queue2; if (!global[gracefulQueue]) { - publishQueue(global, fs34[gracefulQueue]); - } - module2.exports = patch(clone(fs34)); - if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs34.__patched) { - module2.exports = patch(fs34); - fs34.__patched = true; - } - function patch(fs35) { - polyfills(fs35); - fs35.gracefulify = patch; - fs35.createReadStream = createReadStream4; - fs35.createWriteStream = createWriteStream3; - var fs$readFile = fs35.readFile; - fs35.readFile = readFile; - function readFile(path30, options, cb) { + publishQueue(global, fs35[gracefulQueue]); + } + module2.exports = patch(clone(fs35)); + if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs35.__patched) { + module2.exports = patch(fs35); + fs35.__patched = true; + } + function patch(fs36) { + polyfills(fs36); + fs36.gracefulify = patch; + fs36.createReadStream = createReadStream4; + fs36.createWriteStream = createWriteStream3; + var fs$readFile = fs36.readFile; + fs36.readFile = readFile; + function readFile(path31, options, cb) { if (typeof options === "function") cb = options, options = null; - return go$readFile(path30, options, cb); - function go$readFile(path31, options2, cb2, startTime) { - return fs$readFile(path31, options2, function(err) { + return go$readFile(path31, options, cb); + function go$readFile(path32, options2, cb2, startTime) { + return fs$readFile(path32, options2, function(err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$readFile, [path31, options2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$readFile, [path32, options2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -125166,16 +125166,16 @@ var require_graceful_fs = __commonJS({ }); } } - var fs$writeFile = fs35.writeFile; - fs35.writeFile = writeFile; - function writeFile(path30, data, options, cb) { + var fs$writeFile = fs36.writeFile; + fs36.writeFile = writeFile; + function writeFile(path31, data, options, cb) { if (typeof options === "function") cb = options, options = null; - return go$writeFile(path30, data, options, cb); - function go$writeFile(path31, data2, options2, cb2, startTime) { - return fs$writeFile(path31, data2, options2, function(err) { + return go$writeFile(path31, data, options, cb); + function go$writeFile(path32, data2, options2, cb2, startTime) { + return fs$writeFile(path32, data2, options2, function(err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$writeFile, [path31, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$writeFile, [path32, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -125183,17 +125183,17 @@ var require_graceful_fs = __commonJS({ }); } } - var fs$appendFile = fs35.appendFile; + var fs$appendFile = fs36.appendFile; if (fs$appendFile) - fs35.appendFile = appendFile; - function appendFile(path30, data, options, cb) { + fs36.appendFile = appendFile; + function appendFile(path31, data, options, cb) { if (typeof options === "function") cb = options, options = null; - return go$appendFile(path30, data, options, cb); - function go$appendFile(path31, data2, options2, cb2, startTime) { - return fs$appendFile(path31, data2, options2, function(err) { + return go$appendFile(path31, data, options, cb); + function go$appendFile(path32, data2, options2, cb2, startTime) { + return fs$appendFile(path32, data2, options2, function(err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$appendFile, [path31, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$appendFile, [path32, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -125201,9 +125201,9 @@ var require_graceful_fs = __commonJS({ }); } } - var fs$copyFile = fs35.copyFile; + var fs$copyFile = fs36.copyFile; if (fs$copyFile) - fs35.copyFile = copyFile2; + fs36.copyFile = copyFile2; function copyFile2(src, dest, flags, cb) { if (typeof flags === "function") { cb = flags; @@ -125221,34 +125221,34 @@ var require_graceful_fs = __commonJS({ }); } } - var fs$readdir = fs35.readdir; - fs35.readdir = readdir3; + var fs$readdir = fs36.readdir; + fs36.readdir = readdir3; var noReaddirOptionVersions = /^v[0-5]\./; - function readdir3(path30, options, cb) { + function readdir3(path31, options, cb) { if (typeof options === "function") cb = options, options = null; - var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path31, options2, cb2, startTime) { - return fs$readdir(path31, fs$readdirCallback( - path31, + var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path32, options2, cb2, startTime) { + return fs$readdir(path32, fs$readdirCallback( + path32, options2, cb2, startTime )); - } : function go$readdir2(path31, options2, cb2, startTime) { - return fs$readdir(path31, options2, fs$readdirCallback( - path31, + } : function go$readdir2(path32, options2, cb2, startTime) { + return fs$readdir(path32, options2, fs$readdirCallback( + path32, options2, cb2, startTime )); }; - return go$readdir(path30, options, cb); - function fs$readdirCallback(path31, options2, cb2, startTime) { + return go$readdir(path31, options, cb); + function fs$readdirCallback(path32, options2, cb2, startTime) { return function(err, files) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([ go$readdir, - [path31, options2, cb2], + [path32, options2, cb2], err, startTime || Date.now(), Date.now() @@ -125263,21 +125263,21 @@ var require_graceful_fs = __commonJS({ } } if (process.version.substr(0, 4) === "v0.8") { - var legStreams = legacy(fs35); + var legStreams = legacy(fs36); ReadStream = legStreams.ReadStream; WriteStream = legStreams.WriteStream; } - var fs$ReadStream = fs35.ReadStream; + var fs$ReadStream = fs36.ReadStream; if (fs$ReadStream) { ReadStream.prototype = Object.create(fs$ReadStream.prototype); ReadStream.prototype.open = ReadStream$open; } - var fs$WriteStream = fs35.WriteStream; + var fs$WriteStream = fs36.WriteStream; if (fs$WriteStream) { WriteStream.prototype = Object.create(fs$WriteStream.prototype); WriteStream.prototype.open = WriteStream$open; } - Object.defineProperty(fs35, "ReadStream", { + Object.defineProperty(fs36, "ReadStream", { get: function() { return ReadStream; }, @@ -125287,7 +125287,7 @@ var require_graceful_fs = __commonJS({ enumerable: true, configurable: true }); - Object.defineProperty(fs35, "WriteStream", { + Object.defineProperty(fs36, "WriteStream", { get: function() { return WriteStream; }, @@ -125298,7 +125298,7 @@ var require_graceful_fs = __commonJS({ configurable: true }); var FileReadStream = ReadStream; - Object.defineProperty(fs35, "FileReadStream", { + Object.defineProperty(fs36, "FileReadStream", { get: function() { return FileReadStream; }, @@ -125309,7 +125309,7 @@ var require_graceful_fs = __commonJS({ configurable: true }); var FileWriteStream = WriteStream; - Object.defineProperty(fs35, "FileWriteStream", { + Object.defineProperty(fs36, "FileWriteStream", { get: function() { return FileWriteStream; }, @@ -125319,7 +125319,7 @@ var require_graceful_fs = __commonJS({ enumerable: true, configurable: true }); - function ReadStream(path30, options) { + function ReadStream(path31, options) { if (this instanceof ReadStream) return fs$ReadStream.apply(this, arguments), this; else @@ -125339,7 +125339,7 @@ var require_graceful_fs = __commonJS({ } }); } - function WriteStream(path30, options) { + function WriteStream(path31, options) { if (this instanceof WriteStream) return fs$WriteStream.apply(this, arguments), this; else @@ -125357,22 +125357,22 @@ var require_graceful_fs = __commonJS({ } }); } - function createReadStream4(path30, options) { - return new fs35.ReadStream(path30, options); + function createReadStream4(path31, options) { + return new fs36.ReadStream(path31, options); } - function createWriteStream3(path30, options) { - return new fs35.WriteStream(path30, options); + function createWriteStream3(path31, options) { + return new fs36.WriteStream(path31, options); } - var fs$open = fs35.open; - fs35.open = open; - function open(path30, flags, mode, cb) { + var fs$open = fs36.open; + fs36.open = open; + function open(path31, flags, mode, cb) { if (typeof mode === "function") cb = mode, mode = null; - return go$open(path30, flags, mode, cb); - function go$open(path31, flags2, mode2, cb2, startTime) { - return fs$open(path31, flags2, mode2, function(err, fd) { + return go$open(path31, flags, mode, cb); + function go$open(path32, flags2, mode2, cb2, startTime) { + return fs$open(path32, flags2, mode2, function(err, fd) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$open, [path31, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$open, [path32, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -125380,20 +125380,20 @@ var require_graceful_fs = __commonJS({ }); } } - return fs35; + return fs36; } function enqueue(elem) { debug6("ENQUEUE", elem[0].name, elem[1]); - fs34[gracefulQueue].push(elem); + fs35[gracefulQueue].push(elem); retry2(); } var retryTimer; function resetQueue() { var now = Date.now(); - for (var i = 0; i < fs34[gracefulQueue].length; ++i) { - if (fs34[gracefulQueue][i].length > 2) { - fs34[gracefulQueue][i][3] = now; - fs34[gracefulQueue][i][4] = now; + for (var i = 0; i < fs35[gracefulQueue].length; ++i) { + if (fs35[gracefulQueue][i].length > 2) { + fs35[gracefulQueue][i][3] = now; + fs35[gracefulQueue][i][4] = now; } } retry2(); @@ -125401,9 +125401,9 @@ var require_graceful_fs = __commonJS({ function retry2() { clearTimeout(retryTimer); retryTimer = void 0; - if (fs34[gracefulQueue].length === 0) + if (fs35[gracefulQueue].length === 0) return; - var elem = fs34[gracefulQueue].shift(); + var elem = fs35[gracefulQueue].shift(); var fn = elem[0]; var args = elem[1]; var err = elem[2]; @@ -125425,7 +125425,7 @@ var require_graceful_fs = __commonJS({ debug6("RETRY", fn.name, args); fn.apply(null, args.concat([startTime])); } else { - fs34[gracefulQueue].push(elem); + fs35[gracefulQueue].push(elem); } } if (retryTimer === void 0) { @@ -125729,7 +125729,7 @@ var require_BufferList = __commonJS({ this.head = this.tail = null; this.length = 0; }; - BufferList.prototype.join = function join21(s) { + BufferList.prototype.join = function join22(s) { if (this.length === 0) return ""; var p = this.head; var ret = "" + p.data; @@ -127477,22 +127477,22 @@ var require_lazystream = __commonJS({ // node_modules/normalize-path/index.js var require_normalize_path = __commonJS({ "node_modules/normalize-path/index.js"(exports2, module2) { - module2.exports = function(path30, stripTrailing) { - if (typeof path30 !== "string") { + module2.exports = function(path31, stripTrailing) { + if (typeof path31 !== "string") { throw new TypeError("expected path to be a string"); } - if (path30 === "\\" || path30 === "/") return "/"; - var len = path30.length; - if (len <= 1) return path30; + if (path31 === "\\" || path31 === "/") return "/"; + var len = path31.length; + if (len <= 1) return path31; var prefix = ""; - if (len > 4 && path30[3] === "\\") { - var ch = path30[2]; - if ((ch === "?" || ch === ".") && path30.slice(0, 2) === "\\\\") { - path30 = path30.slice(2); + if (len > 4 && path31[3] === "\\") { + var ch = path31[2]; + if ((ch === "?" || ch === ".") && path31.slice(0, 2) === "\\\\") { + path31 = path31.slice(2); prefix = "//"; } } - var segs = path30.split(/[/\\]+/); + var segs = path31.split(/[/\\]+/); if (stripTrailing !== false && segs[segs.length - 1] === "") { segs.pop(); } @@ -135515,7 +135515,7 @@ var require_index_min = __commonJS({ Object.defineProperty(T, "__esModule", { value: true }); T.EXPANSION_MAX_REWRITES = T.EXPANSION_MAX_DEPTH = T.EXPANSION_MAX_LENGTH = T.EXPANSION_MAX = void 0; T.expand = Mi; - var cs = ls(), us = "\0SLASH" + Math.random() + "\0", fs34 = "\0OPEN" + Math.random() + "\0", ve = "\0CLOSE" + Math.random() + "\0", ds = "\0COMMA" + Math.random() + "\0", ps = "\0PERIOD" + Math.random() + "\0", mi = new RegExp(us, "g"), gi = new RegExp(fs34, "g"), wi = new RegExp(ve, "g"), bi = new RegExp(ds, "g"), yi = new RegExp(ps, "g"), Si = /\\\\/g, vi = /\\{/g, _i = /\\}/g, Ei = /\\,/g, Oi = /\\\./g; + var cs = ls(), us = "\0SLASH" + Math.random() + "\0", fs35 = "\0OPEN" + Math.random() + "\0", ve = "\0CLOSE" + Math.random() + "\0", ds = "\0COMMA" + Math.random() + "\0", ps = "\0PERIOD" + Math.random() + "\0", mi = new RegExp(us, "g"), gi = new RegExp(fs35, "g"), wi = new RegExp(ve, "g"), bi = new RegExp(ds, "g"), yi = new RegExp(ps, "g"), Si = /\\\\/g, vi = /\\{/g, _i = /\\}/g, Ei = /\\,/g, Oi = /\\\./g; T.EXPANSION_MAX = 1e5; T.EXPANSION_MAX_LENGTH = 4e6; T.EXPANSION_MAX_DEPTH = 1e3; @@ -135524,7 +135524,7 @@ var require_index_min = __commonJS({ return isNaN(n) ? n.charCodeAt(0) : parseInt(n, 10); } function Ci(n) { - return n.replace(Si, us).replace(vi, fs34).replace(_i, ve).replace(Ei, ds).replace(Oi, ps); + return n.replace(Si, us).replace(vi, fs35).replace(_i, ve).replace(Ei, ds).replace(Oi, ps); } function Ai(n) { return n.replace(mi, "\\").replace(gi, "{").replace(wi, "}").replace(bi, ",").replace(yi, "."); @@ -138988,8 +138988,8 @@ var require_index_min = __commonJS({ // node_modules/archiver-utils/file.js var require_file2 = __commonJS({ "node_modules/archiver-utils/file.js"(exports2, module2) { - var fs34 = require_graceful_fs(); - var path30 = require("path"); + var fs35 = require_graceful_fs(); + var path31 = require("path"); var flatten = require_flatten(); var difference = require_difference(); var union = require_union(); @@ -139014,8 +139014,8 @@ var require_file2 = __commonJS({ return result; }; file.exists = function() { - var filepath = path30.join.apply(path30, arguments); - return fs34.existsSync(filepath); + var filepath = path31.join.apply(path31, arguments); + return fs35.existsSync(filepath); }; file.expand = function(...args) { var options = isPlainObject4(args[0]) ? args.shift() : {}; @@ -139028,12 +139028,12 @@ var require_file2 = __commonJS({ }); if (options.filter) { matches = matches.filter(function(filepath) { - filepath = path30.join(options.cwd || "", filepath); + filepath = path31.join(options.cwd || "", filepath); try { if (typeof options.filter === "function") { return options.filter(filepath); } else { - return fs34.statSync(filepath)[options.filter](); + return fs35.statSync(filepath)[options.filter](); } } catch (e) { return false; @@ -139045,7 +139045,7 @@ var require_file2 = __commonJS({ file.expandMapping = function(patterns, destBase, options) { options = Object.assign({ rename: function(destBase2, destPath) { - return path30.join(destBase2 || "", destPath); + return path31.join(destBase2 || "", destPath); } }, options); var files = []; @@ -139053,14 +139053,14 @@ var require_file2 = __commonJS({ file.expand(options, patterns).forEach(function(src) { var destPath = src; if (options.flatten) { - destPath = path30.basename(destPath); + destPath = path31.basename(destPath); } if (options.ext) { destPath = destPath.replace(/(\.[^\/]*)?$/, options.ext); } var dest = options.rename(destBase, destPath, options); if (options.cwd) { - src = path30.join(options.cwd, src); + src = path31.join(options.cwd, src); } dest = dest.replace(pathSeparatorRe, "/"); src = src.replace(pathSeparatorRe, "/"); @@ -139141,8 +139141,8 @@ var require_file2 = __commonJS({ // node_modules/archiver-utils/index.js var require_archiver_utils = __commonJS({ "node_modules/archiver-utils/index.js"(exports2, module2) { - var fs34 = require_graceful_fs(); - var path30 = require("path"); + var fs35 = require_graceful_fs(); + var path31 = require("path"); var isStream2 = require_is_stream(); var lazystream = require_lazystream(); var normalizePath4 = require_normalize_path(); @@ -139190,7 +139190,7 @@ var require_archiver_utils = __commonJS({ }; utils.lazyReadStream = function(filepath) { return new lazystream.Readable(function() { - return fs34.createReadStream(filepath); + return fs35.createReadStream(filepath); }); }; utils.normalizeInputSource = function(source) { @@ -139218,7 +139218,7 @@ var require_archiver_utils = __commonJS({ callback = base; base = dirpath; } - fs34.readdir(dirpath, function(err, list) { + fs35.readdir(dirpath, function(err, list) { var i = 0; var file; var filepath; @@ -139230,11 +139230,11 @@ var require_archiver_utils = __commonJS({ if (!file) { return callback(null, results); } - filepath = path30.join(dirpath, file); - fs34.stat(filepath, function(err2, stats) { + filepath = path31.join(dirpath, file); + fs35.stat(filepath, function(err2, stats) { results.push({ path: filepath, - relative: path30.relative(base, filepath).replace(/\\/g, "/"), + relative: path31.relative(base, filepath).replace(/\\/g, "/"), stats }); if (stats && stats.isDirectory()) { @@ -139293,10 +139293,10 @@ var require_error3 = __commonJS({ // node_modules/@actions/artifact/node_modules/archiver/lib/core.js var require_core2 = __commonJS({ "node_modules/@actions/artifact/node_modules/archiver/lib/core.js"(exports2, module2) { - var fs34 = require("fs"); + var fs35 = require("fs"); var glob2 = require_readdir_glob(); var async = require_async(); - var path30 = require("path"); + var path31 = require("path"); var util4 = require_archiver_utils(); var inherits = require("util").inherits; var ArchiverError2 = require_error3(); @@ -139357,7 +139357,7 @@ var require_core2 = __commonJS({ data.sourcePath = filepath; task.data = data; this._entriesCount++; - if (data.stats && data.stats instanceof fs34.Stats) { + if (data.stats && data.stats instanceof fs35.Stats) { task = this._updateQueueTaskWithStats(task, data.stats); if (task) { if (data.stats.size) { @@ -139528,7 +139528,7 @@ var require_core2 = __commonJS({ callback(); return; } - fs34.lstat(task.filepath, function(err, stats) { + fs35.lstat(task.filepath, function(err, stats) { if (this._state.aborted) { setImmediate(callback); return; @@ -139571,10 +139571,10 @@ var require_core2 = __commonJS({ task.data.sourceType = "buffer"; task.source = Buffer.concat([]); } else if (stats.isSymbolicLink() && this._moduleSupports("symlink")) { - var linkPath = fs34.readlinkSync(task.filepath); - var dirName = path30.dirname(task.filepath); + var linkPath = fs35.readlinkSync(task.filepath); + var dirName = path31.dirname(task.filepath); task.data.type = "symlink"; - task.data.linkname = path30.relative(dirName, path30.resolve(dirName, linkPath)); + task.data.linkname = path31.relative(dirName, path31.resolve(dirName, linkPath)); task.data.sourceType = "buffer"; task.source = Buffer.concat([]); } else { @@ -144024,8 +144024,8 @@ var require_context2 = __commonJS({ if ((0, fs_1.existsSync)(process.env.GITHUB_EVENT_PATH)) { this.payload = JSON.parse((0, fs_1.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: "utf8" })); } else { - const path30 = process.env.GITHUB_EVENT_PATH; - process.stdout.write(`GITHUB_EVENT_PATH ${path30} does not exist${os_1.EOL}`); + const path31 = process.env.GITHUB_EVENT_PATH; + process.stdout.write(`GITHUB_EVENT_PATH ${path31} does not exist${os_1.EOL}`); } } this.eventName = process.env.GITHUB_EVENT_NAME; @@ -148921,7 +148921,7 @@ var require_traverse = __commonJS({ })(this.value); }; function walk(root, cb, immutable) { - var path30 = []; + var path31 = []; var parents = []; var alive = true; return (function walker(node_) { @@ -148930,11 +148930,11 @@ var require_traverse = __commonJS({ var state = { node, node_, - path: [].concat(path30), + path: [].concat(path31), parent: parents.slice(-1)[0], - key: path30.slice(-1)[0], - isRoot: path30.length === 0, - level: path30.length, + key: path31.slice(-1)[0], + isRoot: path31.length === 0, + level: path31.length, circular: null, update: function(x) { if (!state.isRoot) { @@ -148989,7 +148989,7 @@ var require_traverse = __commonJS({ parents.push(state); var keys = Object.keys(state.node); keys.forEach(function(key, i2) { - path30.push(key); + path31.push(key); if (modifiers.pre) modifiers.pre.call(state, state.node[key], key); var child = walker(state.node[key]); if (immutable && Object.hasOwnProperty.call(state.node, key)) { @@ -148998,7 +148998,7 @@ var require_traverse = __commonJS({ child.isLast = i2 == keys.length - 1; child.isFirst = i2 == 0; if (modifiers.post) modifiers.post.call(state, child); - path30.pop(); + path31.pop(); }); parents.pop(); } @@ -150019,11 +150019,11 @@ var require_unzip_stream = __commonJS({ return requiredLength; case states.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX: var isUtf8 = (this.parsedEntity.flags & 2048) !== 0; - var path30 = this._decodeString(chunk.slice(0, this.parsedEntity.fileNameLength), isUtf8); + var path31 = this._decodeString(chunk.slice(0, this.parsedEntity.fileNameLength), isUtf8); var extraDataBuffer = chunk.slice(this.parsedEntity.fileNameLength, this.parsedEntity.fileNameLength + this.parsedEntity.extraFieldLength); var extra = this._readExtraFields(extraDataBuffer); if (extra && extra.parsed && extra.parsed.path && !isUtf8) { - path30 = extra.parsed.path; + path31 = extra.parsed.path; } this.parsedEntity.extra = extra.parsed; var isUnix = (this.parsedEntity.versionMadeBy & 65280) >> 8 === 3; @@ -150035,7 +150035,7 @@ var require_unzip_stream = __commonJS({ } if (this.options.debug) { const debugObj = Object.assign({}, this.parsedEntity, { - path: path30, + path: path31, flags: "0x" + this.parsedEntity.flags.toString(16), unixAttrs: unixAttrs && "0" + unixAttrs.toString(8), isSymlink, @@ -150472,8 +150472,8 @@ var require_parser_stream = __commonJS({ // node_modules/mkdirp/index.js var require_mkdirp = __commonJS({ "node_modules/mkdirp/index.js"(exports2, module2) { - var path30 = require("path"); - var fs34 = require("fs"); + var path31 = require("path"); + var fs35 = require("fs"); var _0777 = parseInt("0777", 8); module2.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; function mkdirP(p, opts, f, made) { @@ -150484,7 +150484,7 @@ var require_mkdirp = __commonJS({ opts = { mode: opts }; } var mode = opts.mode; - var xfs = opts.fs || fs34; + var xfs = opts.fs || fs35; if (mode === void 0) { mode = _0777; } @@ -150492,7 +150492,7 @@ var require_mkdirp = __commonJS({ var cb = f || /* istanbul ignore next */ function() { }; - p = path30.resolve(p); + p = path31.resolve(p); xfs.mkdir(p, mode, function(er) { if (!er) { made = made || p; @@ -150500,8 +150500,8 @@ var require_mkdirp = __commonJS({ } switch (er.code) { case "ENOENT": - if (path30.dirname(p) === p) return cb(er); - mkdirP(path30.dirname(p), opts, function(er2, made2) { + if (path31.dirname(p) === p) return cb(er); + mkdirP(path31.dirname(p), opts, function(er2, made2) { if (er2) cb(er2, made2); else mkdirP(p, opts, cb, made2); }); @@ -150523,19 +150523,19 @@ var require_mkdirp = __commonJS({ opts = { mode: opts }; } var mode = opts.mode; - var xfs = opts.fs || fs34; + var xfs = opts.fs || fs35; if (mode === void 0) { mode = _0777; } if (!made) made = null; - p = path30.resolve(p); + p = path31.resolve(p); try { xfs.mkdirSync(p, mode); made = made || p; } catch (err0) { switch (err0.code) { case "ENOENT": - made = sync(path30.dirname(p), opts, made); + made = sync(path31.dirname(p), opts, made); sync(p, opts, made); break; // In the case of any other error, just see if there's a dir @@ -150560,8 +150560,8 @@ var require_mkdirp = __commonJS({ // node_modules/unzip-stream/lib/extract.js var require_extract2 = __commonJS({ "node_modules/unzip-stream/lib/extract.js"(exports2, module2) { - var fs34 = require("fs"); - var path30 = require("path"); + var fs35 = require("fs"); + var path31 = require("path"); var util4 = require("util"); var mkdirp = require_mkdirp(); var Transform5 = require("stream").Transform; @@ -150603,11 +150603,11 @@ var require_extract2 = __commonJS({ }; Extract.prototype._processEntry = function(entry) { var self2 = this; - var destPath = path30.join(this.opts.path, entry.path); - var directory = entry.isDirectory ? destPath : path30.dirname(destPath); + var destPath = path31.join(this.opts.path, entry.path); + var directory = entry.isDirectory ? destPath : path31.dirname(destPath); this.unfinishedEntries++; var writeFileFn = function() { - var pipedStream = fs34.createWriteStream(destPath); + var pipedStream = fs35.createWriteStream(destPath); pipedStream.on("close", function() { self2.unfinishedEntries--; self2._notifyAwaiter(); @@ -150731,10 +150731,10 @@ var require_download_artifact = __commonJS({ parsed.search = ""; return parsed.toString(); }; - function exists(path30) { + function exists(path31) { return __awaiter2(this, void 0, void 0, function* () { try { - yield promises_1.default.access(path30); + yield promises_1.default.access(path31); return true; } catch (error3) { if (error3.code === "ENOENT") { @@ -150966,12 +150966,12 @@ var require_dist_node11 = __commonJS({ octokit.log.debug("request", options); const start = Date.now(); const requestOptions = octokit.request.endpoint.parse(options); - const path30 = requestOptions.url.replace(options.baseUrl, ""); + const path31 = requestOptions.url.replace(options.baseUrl, ""); return request3(options).then((response) => { - octokit.log.info(`${requestOptions.method} ${path30} - ${response.status} in ${Date.now() - start}ms`); + octokit.log.info(`${requestOptions.method} ${path31} - ${response.status} in ${Date.now() - start}ms`); return response; }).catch((error3) => { - octokit.log.info(`${requestOptions.method} ${path30} - ${error3.status} in ${Date.now() - start}ms`); + octokit.log.info(`${requestOptions.method} ${path31} - ${error3.status} in ${Date.now() - start}ms`); throw error3; }); }); @@ -151805,7 +151805,7 @@ var require_file_command2 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0; var crypto3 = __importStar2(require("crypto")); - var fs34 = __importStar2(require("fs")); + var fs35 = __importStar2(require("fs")); var os8 = __importStar2(require("os")); var utils_1 = require_utils11(); function issueFileCommand(command, message) { @@ -151813,10 +151813,10 @@ var require_file_command2 = __commonJS({ if (!filePath) { throw new Error(`Unable to find environment variable for file command ${command}`); } - if (!fs34.existsSync(filePath)) { + if (!fs35.existsSync(filePath)) { throw new Error(`Missing file at path: ${filePath}`); } - fs34.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os8.EOL}`, { + fs35.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os8.EOL}`, { encoding: "utf8" }); } @@ -153066,7 +153066,7 @@ var require_path_utils2 = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; - var path30 = __importStar2(require("path")); + var path31 = __importStar2(require("path")); function toPosixPath(pth) { return pth.replace(/[\\]/g, "/"); } @@ -153076,7 +153076,7 @@ var require_path_utils2 = __commonJS({ } exports2.toWin32Path = toWin32Path; function toPlatformPath(pth) { - return pth.replace(/[/\\]/g, path30.sep); + return pth.replace(/[/\\]/g, path31.sep); } exports2.toPlatformPath = toPlatformPath; } @@ -153139,12 +153139,12 @@ var require_io_util2 = __commonJS({ var _a6; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getCmdPath = exports2.tryGetExecutablePath = exports2.isRooted = exports2.isDirectory = exports2.exists = exports2.READONLY = exports2.UV_FS_O_EXLOCK = exports2.IS_WINDOWS = exports2.unlink = exports2.symlink = exports2.stat = exports2.rmdir = exports2.rm = exports2.rename = exports2.readlink = exports2.readdir = exports2.open = exports2.mkdir = exports2.lstat = exports2.copyFile = exports2.chmod = void 0; - var fs34 = __importStar2(require("fs")); - var path30 = __importStar2(require("path")); - _a6 = fs34.promises, exports2.chmod = _a6.chmod, exports2.copyFile = _a6.copyFile, exports2.lstat = _a6.lstat, exports2.mkdir = _a6.mkdir, exports2.open = _a6.open, exports2.readdir = _a6.readdir, exports2.readlink = _a6.readlink, exports2.rename = _a6.rename, exports2.rm = _a6.rm, exports2.rmdir = _a6.rmdir, exports2.stat = _a6.stat, exports2.symlink = _a6.symlink, exports2.unlink = _a6.unlink; + var fs35 = __importStar2(require("fs")); + var path31 = __importStar2(require("path")); + _a6 = fs35.promises, exports2.chmod = _a6.chmod, exports2.copyFile = _a6.copyFile, exports2.lstat = _a6.lstat, exports2.mkdir = _a6.mkdir, exports2.open = _a6.open, exports2.readdir = _a6.readdir, exports2.readlink = _a6.readlink, exports2.rename = _a6.rename, exports2.rm = _a6.rm, exports2.rmdir = _a6.rmdir, exports2.stat = _a6.stat, exports2.symlink = _a6.symlink, exports2.unlink = _a6.unlink; exports2.IS_WINDOWS = process.platform === "win32"; exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs34.constants.O_RDONLY; + exports2.READONLY = fs35.constants.O_RDONLY; function exists(fsPath) { return __awaiter2(this, void 0, void 0, function* () { try { @@ -153189,7 +153189,7 @@ var require_io_util2 = __commonJS({ } if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { - const upperExt = path30.extname(filePath).toUpperCase(); + const upperExt = path31.extname(filePath).toUpperCase(); if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { return filePath; } @@ -153213,11 +153213,11 @@ var require_io_util2 = __commonJS({ if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { try { - const directory = path30.dirname(filePath); - const upperName = path30.basename(filePath).toUpperCase(); + const directory = path31.dirname(filePath); + const upperName = path31.basename(filePath).toUpperCase(); for (const actualName of yield exports2.readdir(directory)) { if (upperName === actualName.toUpperCase()) { - filePath = path30.join(directory, actualName); + filePath = path31.join(directory, actualName); break; } } @@ -153312,7 +153312,7 @@ var require_io2 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.findInPath = exports2.which = exports2.mkdirP = exports2.rmRF = exports2.mv = exports2.cp = void 0; var assert_1 = require("assert"); - var path30 = __importStar2(require("path")); + var path31 = __importStar2(require("path")); var ioUtil = __importStar2(require_io_util2()); function cp(source, dest, options = {}) { return __awaiter2(this, void 0, void 0, function* () { @@ -153321,7 +153321,7 @@ var require_io2 = __commonJS({ if (destStat && destStat.isFile() && !force) { return; } - const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path30.join(dest, path30.basename(source)) : dest; + const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path31.join(dest, path31.basename(source)) : dest; if (!(yield ioUtil.exists(source))) { throw new Error(`no such file or directory: ${source}`); } @@ -153333,7 +153333,7 @@ var require_io2 = __commonJS({ yield cpDirRecursive(source, newDest, 0, force); } } else { - if (path30.relative(source, newDest) === "") { + if (path31.relative(source, newDest) === "") { throw new Error(`'${newDest}' and '${source}' are the same file`); } yield copyFile2(source, newDest, force); @@ -153346,7 +153346,7 @@ var require_io2 = __commonJS({ if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { - dest = path30.join(dest, path30.basename(source)); + dest = path31.join(dest, path31.basename(source)); destExists = yield ioUtil.exists(dest); } if (destExists) { @@ -153357,7 +153357,7 @@ var require_io2 = __commonJS({ } } } - yield mkdirP(path30.dirname(dest)); + yield mkdirP(path31.dirname(dest)); yield ioUtil.rename(source, dest); }); } @@ -153420,7 +153420,7 @@ var require_io2 = __commonJS({ } const extensions = []; if (ioUtil.IS_WINDOWS && process.env["PATHEXT"]) { - for (const extension of process.env["PATHEXT"].split(path30.delimiter)) { + for (const extension of process.env["PATHEXT"].split(path31.delimiter)) { if (extension) { extensions.push(extension); } @@ -153433,12 +153433,12 @@ var require_io2 = __commonJS({ } return []; } - if (tool.includes(path30.sep)) { + if (tool.includes(path31.sep)) { return []; } const directories = []; if (process.env.PATH) { - for (const p of process.env.PATH.split(path30.delimiter)) { + for (const p of process.env.PATH.split(path31.delimiter)) { if (p) { directories.push(p); } @@ -153446,7 +153446,7 @@ var require_io2 = __commonJS({ } const matches = []; for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path30.join(directory, tool), extensions); + const filePath = yield ioUtil.tryGetExecutablePath(path31.join(directory, tool), extensions); if (filePath) { matches.push(filePath); } @@ -153562,7 +153562,7 @@ var require_toolrunner2 = __commonJS({ var os8 = __importStar2(require("os")); var events = __importStar2(require("events")); var child = __importStar2(require("child_process")); - var path30 = __importStar2(require("path")); + var path31 = __importStar2(require("path")); var io10 = __importStar2(require_io2()); var ioUtil = __importStar2(require_io_util2()); var timers_1 = require("timers"); @@ -153777,7 +153777,7 @@ var require_toolrunner2 = __commonJS({ exec() { return __awaiter2(this, void 0, void 0, function* () { if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { - this.toolPath = path30.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + this.toolPath = path31.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } this.toolPath = yield io10.which(this.toolPath, true); return new Promise((resolve15, reject) => __awaiter2(this, void 0, void 0, function* () { @@ -154277,7 +154277,7 @@ var require_core3 = __commonJS({ var file_command_1 = require_file_command2(); var utils_1 = require_utils11(); var os8 = __importStar2(require("os")); - var path30 = __importStar2(require("path")); + var path31 = __importStar2(require("path")); var oidc_utils_1 = require_oidc_utils2(); var ExitCode; (function(ExitCode2) { @@ -154305,7 +154305,7 @@ var require_core3 = __commonJS({ } else { (0, command_1.issueCommand)("add-path", {}, inputPath); } - process.env["PATH"] = `${inputPath}${path30.delimiter}${process.env["PATH"]}`; + process.env["PATH"] = `${inputPath}${path31.delimiter}${process.env["PATH"]}`; } exports2.addPath = addPath2; function getInput2(name, options) { @@ -154481,13 +154481,13 @@ These characters are not allowed in the artifact name due to limitations with ce (0, core_1.info)(`Artifact name is valid!`); } exports2.checkArtifactName = checkArtifactName; - function checkArtifactFilePath(path30) { - if (!path30) { - throw new Error(`Artifact path: ${path30}, is incorrectly provided`); + function checkArtifactFilePath(path31) { + if (!path31) { + throw new Error(`Artifact path: ${path31}, is incorrectly provided`); } for (const [invalidCharacterKey, errorMessageForCharacter] of invalidArtifactFilePathCharacters) { - if (path30.includes(invalidCharacterKey)) { - throw new Error(`Artifact path is not valid: ${path30}. Contains the following character: ${errorMessageForCharacter} + if (path31.includes(invalidCharacterKey)) { + throw new Error(`Artifact path is not valid: ${path31}. Contains the following character: ${errorMessageForCharacter} Invalid characters include: ${Array.from(invalidArtifactFilePathCharacters.values()).toString()} @@ -154533,25 +154533,25 @@ var require_upload_specification = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getUploadSpecification = void 0; - var fs34 = __importStar2(require("fs")); + var fs35 = __importStar2(require("fs")); var core_1 = require_core3(); var path_1 = require("path"); var path_and_artifact_name_validation_1 = require_path_and_artifact_name_validation2(); function getUploadSpecification(artifactName, rootDirectory, artifactFiles) { const specifications = []; - if (!fs34.existsSync(rootDirectory)) { + if (!fs35.existsSync(rootDirectory)) { throw new Error(`Provided rootDirectory ${rootDirectory} does not exist`); } - if (!fs34.statSync(rootDirectory).isDirectory()) { + if (!fs35.statSync(rootDirectory).isDirectory()) { throw new Error(`Provided rootDirectory ${rootDirectory} is not a valid directory`); } rootDirectory = (0, path_1.normalize)(rootDirectory); rootDirectory = (0, path_1.resolve)(rootDirectory); for (let file of artifactFiles) { - if (!fs34.existsSync(file)) { + if (!fs35.existsSync(file)) { throw new Error(`File ${file} does not exist`); } - if (!fs34.statSync(file).isDirectory()) { + if (!fs35.statSync(file).isDirectory()) { file = (0, path_1.normalize)(file); file = (0, path_1.resolve)(file); if (!file.startsWith(rootDirectory)) { @@ -154576,11 +154576,11 @@ var require_upload_specification = __commonJS({ // node_modules/tmp/lib/tmp.js var require_tmp = __commonJS({ "node_modules/tmp/lib/tmp.js"(exports2, module2) { - var fs34 = require("fs"); + var fs35 = require("fs"); var os8 = require("os"); - var path30 = require("path"); + var path31 = require("path"); var crypto3 = require("crypto"); - var _c2 = { fs: fs34.constants, os: os8.constants }; + var _c2 = { fs: fs35.constants, os: os8.constants }; var RANDOM_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; var TEMPLATE_PATTERN = /XXXXXX/; var DEFAULT_TRIES = 3; @@ -154592,13 +154592,13 @@ var require_tmp = __commonJS({ var FILE_MODE = 384; var EXIT = "exit"; var _removeObjects = []; - var FN_RMDIR_SYNC = fs34.rmdirSync.bind(fs34); + var FN_RMDIR_SYNC = fs35.rmdirSync.bind(fs35); var _gracefulCleanup = false; function rimraf(dirPath, callback) { - return fs34.rm(dirPath, { recursive: true }, callback); + return fs35.rm(dirPath, { recursive: true }, callback); } function FN_RIMRAF_SYNC(dirPath) { - return fs34.rmSync(dirPath, { recursive: true }); + return fs35.rmSync(dirPath, { recursive: true }); } function tmpName(options, callback) { const args = _parseArguments(options, callback), opts = args[0], cb = args[1]; @@ -154608,7 +154608,7 @@ var require_tmp = __commonJS({ (function _getUniqueName() { try { const name = _generateTmpName(sanitizedOptions); - fs34.stat(name, function(err2) { + fs35.stat(name, function(err2) { if (!err2) { if (tries-- > 0) return _getUniqueName(); return cb(new Error("Could not get a unique tmp filename, max tries reached " + name)); @@ -154628,7 +154628,7 @@ var require_tmp = __commonJS({ do { const name = _generateTmpName(sanitizedOptions); try { - fs34.statSync(name); + fs35.statSync(name); } catch (e) { return name; } @@ -154639,10 +154639,10 @@ var require_tmp = __commonJS({ const args = _parseArguments(options, callback), opts = args[0], cb = args[1]; tmpName(opts, function _tmpNameCreated(err, name) { if (err) return cb(err); - fs34.open(name, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err2, fd) { + fs35.open(name, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err2, fd) { if (err2) return cb(err2); if (opts.discardDescriptor) { - return fs34.close(fd, function _discardCallback(possibleErr) { + return fs35.close(fd, function _discardCallback(possibleErr) { return cb(possibleErr, name, void 0, _prepareTmpFileRemoveCallback(name, -1, opts, false)); }); } else { @@ -154656,9 +154656,9 @@ var require_tmp = __commonJS({ const args = _parseArguments(options), opts = args[0]; const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor; const name = tmpNameSync(opts); - let fd = fs34.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE); + let fd = fs35.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE); if (opts.discardDescriptor) { - fs34.closeSync(fd); + fs35.closeSync(fd); fd = void 0; } return { @@ -154671,7 +154671,7 @@ var require_tmp = __commonJS({ const args = _parseArguments(options, callback), opts = args[0], cb = args[1]; tmpName(opts, function _tmpNameCreated(err, name) { if (err) return cb(err); - fs34.mkdir(name, opts.mode || DIR_MODE, function _dirCreated(err2) { + fs35.mkdir(name, opts.mode || DIR_MODE, function _dirCreated(err2) { if (err2) return cb(err2); cb(null, name, _prepareTmpDirRemoveCallback(name, opts, false)); }); @@ -154680,7 +154680,7 @@ var require_tmp = __commonJS({ function dirSync(options) { const args = _parseArguments(options), opts = args[0]; const name = tmpNameSync(opts); - fs34.mkdirSync(name, opts.mode || DIR_MODE); + fs35.mkdirSync(name, opts.mode || DIR_MODE); return { name, removeCallback: _prepareTmpDirRemoveCallback(name, opts, true) @@ -154694,20 +154694,20 @@ var require_tmp = __commonJS({ next(); }; if (0 <= fdPath[0]) - fs34.close(fdPath[0], function() { - fs34.unlink(fdPath[1], _handler); + fs35.close(fdPath[0], function() { + fs35.unlink(fdPath[1], _handler); }); - else fs34.unlink(fdPath[1], _handler); + else fs35.unlink(fdPath[1], _handler); } function _removeFileSync(fdPath) { let rethrownException = null; try { - if (0 <= fdPath[0]) fs34.closeSync(fdPath[0]); + if (0 <= fdPath[0]) fs35.closeSync(fdPath[0]); } catch (e) { if (!_isEBADF(e) && !_isENOENT(e)) throw e; } finally { try { - fs34.unlinkSync(fdPath[1]); + fs35.unlinkSync(fdPath[1]); } catch (e) { if (!_isENOENT(e)) rethrownException = e; } @@ -154723,7 +154723,7 @@ var require_tmp = __commonJS({ return sync ? removeCallbackSync : removeCallback; } function _prepareTmpDirRemoveCallback(name, opts, sync) { - const removeFunction = opts.unsafeCleanup ? rimraf : fs34.rmdir.bind(fs34); + const removeFunction = opts.unsafeCleanup ? rimraf : fs35.rmdir.bind(fs35); const removeFunctionSync = opts.unsafeCleanup ? FN_RIMRAF_SYNC : FN_RMDIR_SYNC; const removeCallbackSync = _prepareRemoveCallback(removeFunctionSync, name, sync); const removeCallback = _prepareRemoveCallback(removeFunction, name, sync, removeCallbackSync); @@ -154785,35 +154785,35 @@ var require_tmp = __commonJS({ return [actualOptions, callback]; } function _resolvePath(name, tmpDir, cb) { - const pathToResolve = path30.isAbsolute(name) ? name : path30.join(tmpDir, name); - fs34.stat(pathToResolve, function(err) { + const pathToResolve = path31.isAbsolute(name) ? name : path31.join(tmpDir, name); + fs35.stat(pathToResolve, function(err) { if (err) { - fs34.realpath(path30.dirname(pathToResolve), function(err2, parentDir) { + fs35.realpath(path31.dirname(pathToResolve), function(err2, parentDir) { if (err2) return cb(err2); - cb(null, path30.join(parentDir, path30.basename(pathToResolve))); + cb(null, path31.join(parentDir, path31.basename(pathToResolve))); }); } else { - fs34.realpath(pathToResolve, cb); + fs35.realpath(pathToResolve, cb); } }); } function _resolvePathSync(name, tmpDir) { - const pathToResolve = path30.isAbsolute(name) ? name : path30.join(tmpDir, name); + const pathToResolve = path31.isAbsolute(name) ? name : path31.join(tmpDir, name); try { - fs34.statSync(pathToResolve); - return fs34.realpathSync(pathToResolve); + fs35.statSync(pathToResolve); + return fs35.realpathSync(pathToResolve); } catch (_err) { - const parentDir = fs34.realpathSync(path30.dirname(pathToResolve)); - return path30.join(parentDir, path30.basename(pathToResolve)); + const parentDir = fs35.realpathSync(path31.dirname(pathToResolve)); + return path31.join(parentDir, path31.basename(pathToResolve)); } } function _generateTmpName(opts) { const tmpDir = opts.tmpdir; if (!_isUndefined(opts.name)) { - return path30.join(tmpDir, opts.dir, opts.name); + return path31.join(tmpDir, opts.dir, opts.name); } if (!_isUndefined(opts.template)) { - return path30.join(tmpDir, opts.dir, opts.template).replace(TEMPLATE_PATTERN, _randomChars(6)); + return path31.join(tmpDir, opts.dir, opts.template).replace(TEMPLATE_PATTERN, _randomChars(6)); } const name = [ opts.prefix ? opts.prefix : "tmp", @@ -154823,7 +154823,7 @@ var require_tmp = __commonJS({ _randomChars(12), opts.postfix ? "-" + opts.postfix : "" ].join(""); - return path30.join(tmpDir, opts.dir, name); + return path31.join(tmpDir, opts.dir, name); } function _assertPath(option, value) { if (typeof value !== "string") { @@ -154837,8 +154837,8 @@ var require_tmp = __commonJS({ function _assertOptionsBase(options) { if (!_isUndefined(options.name)) { const name = options.name; - if (path30.isAbsolute(name)) throw new Error(`name option must not contain an absolute path, found "${name}".`); - const basename2 = path30.basename(name); + if (path31.isAbsolute(name)) throw new Error(`name option must not contain an absolute path, found "${name}".`); + const basename2 = path31.basename(name); if (basename2 === ".." || basename2 === "." || basename2 !== name) { throw new Error(`name option must not contain a path, found "${name}".`); } @@ -154867,8 +154867,8 @@ var require_tmp = __commonJS({ if (_isUndefined(name)) return cb(null); _resolvePath(name, tmpDir, function(err, resolvedPath) { if (err) return cb(err); - const relativePath2 = path30.relative(tmpDir, resolvedPath); - if (relativePath2.startsWith("..") || path30.isAbsolute(relativePath2)) { + const relativePath2 = path31.relative(tmpDir, resolvedPath); + if (relativePath2.startsWith("..") || path31.isAbsolute(relativePath2)) { return cb(new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath2}".`)); } cb(null, relativePath2); @@ -154877,8 +154877,8 @@ var require_tmp = __commonJS({ function _getRelativePathSync(option, name, tmpDir) { if (_isUndefined(name)) return; const resolvedPath = _resolvePathSync(name, tmpDir); - const relativePath2 = path30.relative(tmpDir, resolvedPath); - if (relativePath2.startsWith("..") || path30.isAbsolute(relativePath2)) { + const relativePath2 = path31.relative(tmpDir, resolvedPath); + if (relativePath2.startsWith("..") || path31.isAbsolute(relativePath2)) { throw new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath2}".`); } return relativePath2; @@ -154924,10 +154924,10 @@ var require_tmp = __commonJS({ _gracefulCleanup = true; } function _getTmpDir(options, cb) { - return fs34.realpath(options && options.tmpdir || os8.tmpdir(), cb); + return fs35.realpath(options && options.tmpdir || os8.tmpdir(), cb); } function _getTmpDirSync(options) { - return fs34.realpathSync(options && options.tmpdir || os8.tmpdir()); + return fs35.realpathSync(options && options.tmpdir || os8.tmpdir()); } process.addListener(EXIT, _garbageCollector); Object.defineProperty(module2.exports, "tmpdir", { @@ -154957,14 +154957,14 @@ var require_tmp_promise = __commonJS({ var fileWithOptions = promisify( (options, cb) => tmp2.file( options, - (err, path30, fd, cleanup) => err ? cb(err) : cb(void 0, { path: path30, fd, cleanup: promisify(cleanup) }) + (err, path31, fd, cleanup) => err ? cb(err) : cb(void 0, { path: path31, fd, cleanup: promisify(cleanup) }) ) ); module2.exports.file = async (options) => fileWithOptions(options); module2.exports.withFile = async function withFile(fn, options) { - const { path: path30, fd, cleanup } = await module2.exports.file(options); + const { path: path31, fd, cleanup } = await module2.exports.file(options); try { - return await fn({ path: path30, fd }); + return await fn({ path: path31, fd }); } finally { await cleanup(); } @@ -154973,14 +154973,14 @@ var require_tmp_promise = __commonJS({ var dirWithOptions = promisify( (options, cb) => tmp2.dir( options, - (err, path30, cleanup) => err ? cb(err) : cb(void 0, { path: path30, cleanup: promisify(cleanup) }) + (err, path31, cleanup) => err ? cb(err) : cb(void 0, { path: path31, cleanup: promisify(cleanup) }) ) ); module2.exports.dir = async (options) => dirWithOptions(options); module2.exports.withDir = async function withDir(fn, options) { - const { path: path30, cleanup } = await module2.exports.dir(options); + const { path: path31, cleanup } = await module2.exports.dir(options); try { - return await fn({ path: path30 }); + return await fn({ path: path31 }); } finally { await cleanup(); } @@ -155781,10 +155781,10 @@ var require_upload_gzip = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.createGZipFileInBuffer = exports2.createGZipFileOnDisk = void 0; - var fs34 = __importStar2(require("fs")); + var fs35 = __importStar2(require("fs")); var zlib3 = __importStar2(require("zlib")); var util_1 = require("util"); - var stat2 = (0, util_1.promisify)(fs34.stat); + var stat2 = (0, util_1.promisify)(fs35.stat); var gzipExemptFileExtensions = [ ".gz", ".gzip", @@ -155817,9 +155817,9 @@ var require_upload_gzip = __commonJS({ } } return new Promise((resolve15, reject) => { - const inputStream = fs34.createReadStream(originalFilePath); + const inputStream = fs35.createReadStream(originalFilePath); const gzip = zlib3.createGzip(); - const outputStream = fs34.createWriteStream(tempFilePath); + const outputStream = fs35.createWriteStream(tempFilePath); inputStream.pipe(gzip).pipe(outputStream); outputStream.on("finish", () => __awaiter2(this, void 0, void 0, function* () { const size = (yield stat2(tempFilePath)).size; @@ -155837,7 +155837,7 @@ var require_upload_gzip = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve15) => __awaiter2(this, void 0, void 0, function* () { var _a6, e_1, _b2, _c2; - const inputStream = fs34.createReadStream(originalFilePath); + const inputStream = fs35.createReadStream(originalFilePath); const gzip = zlib3.createGzip(); inputStream.pipe(gzip); const chunks = []; @@ -156046,7 +156046,7 @@ var require_upload_http_client = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.UploadHttpClient = void 0; - var fs34 = __importStar2(require("fs")); + var fs35 = __importStar2(require("fs")); var core29 = __importStar2(require_core3()); var tmp2 = __importStar2(require_tmp_promise()); var stream2 = __importStar2(require("stream")); @@ -156060,7 +156060,7 @@ var require_upload_http_client = __commonJS({ var http_manager_1 = require_http_manager(); var upload_gzip_1 = require_upload_gzip(); var requestUtils_1 = require_requestUtils2(); - var stat2 = (0, util_1.promisify)(fs34.stat); + var stat2 = (0, util_1.promisify)(fs35.stat); var UploadHttpClient = class { constructor() { this.uploadHttpManager = new http_manager_1.HttpManager((0, config_variables_1.getUploadFileConcurrency)(), "@actions/artifact-upload"); @@ -156197,7 +156197,7 @@ var require_upload_http_client = __commonJS({ let openUploadStream; if (totalFileSize < buffer.byteLength) { 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 = () => fs34.createReadStream(parameters.file); + openUploadStream = () => fs35.createReadStream(parameters.file); isGzip = false; uploadFileSize = totalFileSize; } else { @@ -156243,7 +156243,7 @@ var require_upload_http_client = __commonJS({ failedChunkSizes += chunkSize; continue; } - const result = yield this.uploadChunk(httpClientIndex, parameters.resourceUrl, () => fs34.createReadStream(uploadFilePath, { + const result = yield this.uploadChunk(httpClientIndex, parameters.resourceUrl, () => fs35.createReadStream(uploadFilePath, { start: startChunkIndex, end: endChunkIndex, autoClose: false @@ -156438,7 +156438,7 @@ var require_download_http_client = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.DownloadHttpClient = void 0; - var fs34 = __importStar2(require("fs")); + var fs35 = __importStar2(require("fs")); var core29 = __importStar2(require_core3()); var zlib3 = __importStar2(require("zlib")); var utils_1 = require_utils12(); @@ -156529,7 +156529,7 @@ var require_download_http_client = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { let retryCount = 0; const retryLimit = (0, config_variables_1.getRetryLimit)(); - let destinationStream = fs34.createWriteStream(downloadPath); + let destinationStream = fs35.createWriteStream(downloadPath); const headers = (0, utils_1.getDownloadHeaders)("application/json", true, true); const makeDownloadRequest = () => __awaiter2(this, void 0, void 0, function* () { const client = this.downloadHttpManager.getClient(httpClientIndex); @@ -156571,7 +156571,7 @@ var require_download_http_client = __commonJS({ } }); yield (0, utils_1.rmFile)(fileDownloadPath); - destinationStream = fs34.createWriteStream(fileDownloadPath); + destinationStream = fs35.createWriteStream(fileDownloadPath); }); while (retryCount <= retryLimit) { let response; @@ -156688,21 +156688,21 @@ var require_download_specification = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getDownloadSpecification = void 0; - var path30 = __importStar2(require("path")); + var path31 = __importStar2(require("path")); function getDownloadSpecification(artifactName, artifactEntries, downloadPath, includeRootDirectory) { const directories = /* @__PURE__ */ new Set(); const specifications = { - rootDownloadLocation: includeRootDirectory ? path30.join(downloadPath, artifactName) : downloadPath, + rootDownloadLocation: includeRootDirectory ? path31.join(downloadPath, artifactName) : downloadPath, directoryStructure: [], emptyFilesToCreate: [], filesToDownload: [] }; for (const entry of artifactEntries) { if (entry.path.startsWith(`${artifactName}/`) || entry.path.startsWith(`${artifactName}\\`)) { - const normalizedPathEntry = path30.normalize(entry.path); - const filePath = path30.join(downloadPath, includeRootDirectory ? normalizedPathEntry : normalizedPathEntry.replace(artifactName, "")); + const normalizedPathEntry = path31.normalize(entry.path); + const filePath = path31.join(downloadPath, includeRootDirectory ? normalizedPathEntry : normalizedPathEntry.replace(artifactName, "")); if (entry.itemType === "file") { - directories.add(path30.dirname(filePath)); + directories.add(path31.dirname(filePath)); if (entry.fileLength === 0) { specifications.emptyFilesToCreate.push(filePath); } else { @@ -156844,7 +156844,7 @@ Note: The size of downloaded zips can differ significantly from the reported siz return uploadResponse; }); } - downloadArtifact(name, path30, options) { + downloadArtifact(name, path31, options) { return __awaiter2(this, void 0, void 0, function* () { const downloadHttpClient = new download_http_client_1.DownloadHttpClient(); const artifacts = yield downloadHttpClient.listArtifacts(); @@ -156858,12 +156858,12 @@ Note: The size of downloaded zips can differ significantly from the reported siz throw new Error(`Unable to find an artifact with the name: ${name}`); } const items = yield downloadHttpClient.getContainerItems(artifactToDownload.name, artifactToDownload.fileContainerResourceUrl); - if (!path30) { - path30 = (0, config_variables_1.getWorkSpaceDirectory)(); + if (!path31) { + path31 = (0, config_variables_1.getWorkSpaceDirectory)(); } - path30 = (0, path_1.normalize)(path30); - path30 = (0, path_1.resolve)(path30); - const downloadSpecification = (0, download_specification_1.getDownloadSpecification)(name, items.value, path30, (options === null || options === void 0 ? void 0 : options.createArtifactFolder) || false); + path31 = (0, path_1.normalize)(path31); + path31 = (0, path_1.resolve)(path31); + const downloadSpecification = (0, download_specification_1.getDownloadSpecification)(name, items.value, path31, (options === null || options === void 0 ? void 0 : options.createArtifactFolder) || false); if (downloadSpecification.filesToDownload.length === 0) { core29.info(`No downloadable files were found for the artifact: ${artifactToDownload.name}`); } else { @@ -156878,7 +156878,7 @@ Note: The size of downloaded zips can differ significantly from the reported siz }; }); } - downloadAllArtifacts(path30) { + downloadAllArtifacts(path31) { return __awaiter2(this, void 0, void 0, function* () { const downloadHttpClient = new download_http_client_1.DownloadHttpClient(); const response = []; @@ -156887,18 +156887,18 @@ Note: The size of downloaded zips can differ significantly from the reported siz core29.info("Unable to find any artifacts for the associated workflow"); return response; } - if (!path30) { - path30 = (0, config_variables_1.getWorkSpaceDirectory)(); + if (!path31) { + path31 = (0, config_variables_1.getWorkSpaceDirectory)(); } - path30 = (0, path_1.normalize)(path30); - path30 = (0, path_1.resolve)(path30); + path31 = (0, path_1.normalize)(path31); + path31 = (0, path_1.resolve)(path31); let downloadedArtifacts = 0; while (downloadedArtifacts < artifacts.count) { const currentArtifactToDownload = artifacts.value[downloadedArtifacts]; downloadedArtifacts += 1; 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, path30, true); + const downloadSpecification = (0, download_specification_1.getDownloadSpecification)(currentArtifactToDownload.name, items.value, path31, true); if (downloadSpecification.filesToDownload.length === 0) { core29.info(`No downloadable files were found for any artifact ${currentArtifactToDownload.name}`); } else { @@ -175523,7 +175523,7 @@ __export(entry_points_exports, { module.exports = __toCommonJS(entry_points_exports); // src/analyze-action.ts -var fs25 = __toESM(require("fs")); +var fs26 = __toESM(require("fs")); var import_path5 = __toESM(require("path")); var import_perf_hooks6 = require("perf_hooks"); var core14 = __toESM(require_core()); @@ -175697,21 +175697,21 @@ async function getFolderSize(itemPath, options) { getFolderSize.loose = async (itemPath, options) => await core2(itemPath, options); getFolderSize.strict = async (itemPath, options) => await core2(itemPath, options, { strict: true }); async function core2(rootItemPath, options = {}, returnType = {}) { - const fs34 = options.fs || await import("node:fs/promises"); + const fs35 = options.fs || await import("node:fs/promises"); let folderSize = 0n; const foundInos = /* @__PURE__ */ new Set(); const errors = []; await processItem(rootItemPath); async function processItem(itemPath) { if (options.ignore?.test(itemPath)) return; - const stats = returnType.strict ? await fs34.lstat(itemPath, { bigint: true }) : await fs34.lstat(itemPath, { bigint: true }).catch((error3) => errors.push(error3)); + const stats = returnType.strict ? await fs35.lstat(itemPath, { bigint: true }) : await fs35.lstat(itemPath, { bigint: true }).catch((error3) => errors.push(error3)); if (typeof stats !== "object") return; if (!foundInos.has(stats.ino)) { foundInos.add(stats.ino); folderSize += stats.size; } if (stats.isDirectory()) { - const directoryItems = returnType.strict ? await fs34.readdir(itemPath) : await fs34.readdir(itemPath).catch((error3) => errors.push(error3)); + const directoryItems = returnType.strict ? await fs35.readdir(itemPath) : await fs35.readdir(itemPath).catch((error3) => errors.push(error3)); if (typeof directoryItems !== "object") return; await Promise.all( directoryItems.map( @@ -178948,7 +178948,7 @@ function array(validator) { }; return { validate: validate2, - check: (val, opts, path30) => { + check: (val, opts, path31) => { const result = successfulCheckSchema(); if (!isArray(val)) { result.valid = false; @@ -178956,7 +178956,7 @@ function array(validator) { } let index2 = 0; for (const e of val) { - const elementPath = `${path30}[${index2}]`; + const elementPath = `${path31}[${index2}]`; const eResult = validator.check(e, opts, `${elementPath}`); result.invalidKeys.push(...eResult.invalidKeys); result.unknownKeys.push(...eResult.unknownKeys); @@ -178982,11 +178982,11 @@ function object(schema) { validate: (val) => { return isObject2(val) && validateSchema(schema, val); }, - check: (val, opts, path30) => { + check: (val, opts, path31) => { if (!isObject2(val)) { return invalidCheckSchema(); } - return checkSchema(schema, val, opts, path30); + return checkSchema(schema, val, opts, path31); }, required: true }; @@ -178996,11 +178996,11 @@ function optionalOrNull(validator) { validate: (val) => { return val === void 0 || val === null || validator.validate(val); }, - check: (val, opts, path30) => { + check: (val, opts, path31) => { if (val === void 0 || val === null) { return successfulCheckSchema(); } - return validator.check(val, opts, path30); + return validator.check(val, opts, path31); }, required: false }; @@ -179010,11 +179010,11 @@ function optional(validator) { validate: (val) => { return val === void 0 || validator.validate(val); }, - check: (val, opts, path30) => { + check: (val, opts, path31) => { if (val === void 0) { return successfulCheckSchema(); } - return validator.check(val, opts, path30); + return validator.check(val, opts, path31); }, required: false }; @@ -179041,7 +179041,7 @@ function invalidCheckSchema() { invalidKeys: [] }; } -function checkSchema(schema, obj, options = {}, path30 = "") { +function checkSchema(schema, obj, options = {}, path31 = "") { const result = successfulCheckSchema(); const inputKeys = new Set(Object.keys(obj)); const invalidKeys = /* @__PURE__ */ new Set(); @@ -179064,7 +179064,7 @@ function checkSchema(schema, obj, options = {}, path30 = "") { continue; } if (hasKey) { - const checkResult = validator.check(obj[key], options, `${path30}.${key}`); + const checkResult = validator.check(obj[key], options, `${path31}.${key}`); result.unknownKeys.push(...checkResult.unknownKeys); result.invalidKeys.push(...checkResult.invalidKeys); if (checkResult.invalidKeys.length > 0) { @@ -179081,10 +179081,10 @@ function checkSchema(schema, obj, options = {}, path30 = "") { invalidKeys.delete(key); } for (const remainingKey of inputKeys) { - result.unknownKeys.push(`${path30}.${remainingKey}`); + result.unknownKeys.push(`${path31}.${remainingKey}`); } for (const invalidKey of invalidKeys) { - result.invalidKeys.push(`${path30}.${invalidKey}`); + result.invalidKeys.push(`${path31}.${invalidKey}`); } return result; } @@ -182200,14 +182200,14 @@ var SarifScanOrder = [ ]; // src/analyze.ts -var fs19 = __toESM(require("fs")); -var path16 = __toESM(require("path")); +var fs20 = __toESM(require("fs")); +var path17 = __toESM(require("path")); var import_perf_hooks5 = require("perf_hooks"); var io6 = __toESM(require_io()); // src/codeql.ts -var fs18 = __toESM(require("fs")); -var path15 = __toESM(require("path")); +var fs19 = __toESM(require("fs")); +var path16 = __toESM(require("path")); var core12 = __toESM(require_core()); var toolrunner4 = __toESM(require_toolrunner()); var semver11 = __toESM(require_semver2()); @@ -182462,8 +182462,8 @@ function wrapCliConfigurationError(cliError) { } // src/config-utils.ts -var fs11 = __toESM(require("fs")); -var path11 = __toESM(require("path")); +var fs12 = __toESM(require("fs")); +var path12 = __toESM(require("path")); var import_perf_hooks2 = require("perf_hooks"); // src/caching-utils.ts @@ -183236,12 +183236,12 @@ function parseNewRemoteFileAddress(env, configFile) { return new Failure(void 0); } const owner = pieces.groups.owner?.trim(); - const path30 = pieces.groups.path?.trim(); + const path31 = pieces.groups.path?.trim(); const ref = pieces.groups.ref?.trim(); return new Success({ owner: owner || getDefaultOwner(env), repo, - path: path30 || DEFAULT_CONFIG_FILE_NAME, + path: path31 || DEFAULT_CONFIG_FILE_NAME, ref: ref || DEFAULT_CONFIG_FILE_REF }); } @@ -183586,6 +183586,83 @@ function parseBuiltInLanguage(language) { return void 0; } +// src/languages/source-files.ts +var fs9 = __toESM(require("fs")); +var path9 = __toESM(require("path")); +var DATA_FILE_TYPE_NAME = "data"; +function getExtractorFileExtensions(extractorRoot, logger2) { + const extractorConfigPath = path9.join(extractorRoot, "codeql-extractor.yml"); + let extractorConfig; + try { + extractorConfig = load( + fs9.readFileSync(extractorConfigPath, "utf8") + ); + } catch (e) { + logger2.debug( + `Could not read file types from ${extractorConfigPath}: ${String(e)}` + ); + return void 0; + } + const extensions = (extractorConfig?.file_types ?? []).filter((fileType) => fileType.name !== DATA_FILE_TYPE_NAME).flatMap((fileType) => fileType.extensions ?? []); + if (extensions.length === 0) { + return void 0; + } + return extensions.map((extension) => extension.toLowerCase()); +} +function findSourceFileExtensions(rootDir, extensions) { + const found = /* @__PURE__ */ new Set(); + const pendingDirs = [rootDir]; + while (pendingDirs.length > 0 && found.size < extensions.size) { + const dir = pendingDirs.pop(); + let entries; + try { + entries = fs9.readdirSync(dir, { withFileTypes: true }); + } catch { + continue; + } + for (const entry of entries) { + if (entry.isDirectory()) { + if (entry.name !== ".git") { + pendingDirs.push(path9.join(dir, entry.name)); + } + } else if (entry.isFile()) { + const extension = path9.extname(entry.name).toLowerCase(); + if (extensions.has(extension)) { + found.add(extension); + } + } + } + } + return found; +} +function filterLanguagesWithSourceFiles(languages, extractorRoots, sourceRoot, logger2) { + const extensionsByLanguage = /* @__PURE__ */ new Map(); + for (const language of languages) { + const extractorRoot = extractorRoots[language]; + const extensions = extractorRoot === void 0 ? void 0 : getExtractorFileExtensions(extractorRoot, logger2); + if (extensions !== void 0) { + extensionsByLanguage.set(language, extensions); + } + } + if (extensionsByLanguage.size === 0) { + return languages; + } + const foundExtensions = findSourceFileExtensions( + sourceRoot, + new Set([...extensionsByLanguage.values()].flat()) + ); + return languages.filter((language) => { + const extensions = extensionsByLanguage.get(language); + if (extensions === void 0 || extensions.some((extension) => foundExtensions.has(extension))) { + return true; + } + logger2.info( + `Not analyzing ${language}: the GitHub languages API reported it, but the checkout contains no files with the extensions ${extensions.join(", ")}.` + ); + return false; + }); +} + // src/overlay/diagnostics.ts async function addOverlayDisablementDiagnostics(config, codeql, overlayDisabledReason) { addNoLanguageDiagnostic( @@ -183645,13 +183722,13 @@ Improved incremental analysis will be automatically retried when the next versio } // src/overlay/status.ts -var fs9 = __toESM(require("fs")); -var path9 = __toESM(require("path")); +var fs10 = __toESM(require("fs")); +var path10 = __toESM(require("path")); var actionsCache = __toESM(require_cache6()); var MAX_CACHE_OPERATION_MS = 3e4; var STATUS_FILE_NAME = "overlay-status.json"; function getStatusFilePath(languages) { - return path9.join( + return path10.join( getTemporaryDirectory(), "overlay-status", [...languages].sort().join("+"), @@ -183690,7 +183767,7 @@ async function getOverlayStatus(codeql, languages, diskUsage, logger2) { const cacheKey3 = await getCacheKey(codeql, languages, diskUsage); const statusFile = getStatusFilePath(languages); try { - await fs9.promises.mkdir(path9.dirname(statusFile), { recursive: true }); + await fs10.promises.mkdir(path10.dirname(statusFile), { recursive: true }); const foundKey = await waitForResultWithTimeLimit( MAX_CACHE_OPERATION_MS, actionsCache.restoreCache([statusFile], cacheKey3, [cacheKey3]), @@ -183702,13 +183779,13 @@ async function getOverlayStatus(codeql, languages, diskUsage, logger2) { logger2.debug("No overlay status found in Actions cache."); return void 0; } - if (!fs9.existsSync(statusFile)) { + if (!fs10.existsSync(statusFile)) { logger2.debug( "Overlay status cache entry found but status file is missing." ); return void 0; } - const contents = await fs9.promises.readFile(statusFile, "utf-8"); + const contents = await fs10.promises.readFile(statusFile, "utf-8"); const parsed = JSON.parse(contents); if (!isObject2(parsed) || typeof parsed["attemptedToBuildOverlayBaseDatabase"] !== "boolean" || typeof parsed["builtOverlayBaseDatabase"] !== "boolean") { logger2.debug( @@ -183728,8 +183805,8 @@ async function saveOverlayStatus(codeql, languages, diskUsage, status, logger2) const cacheKey3 = await getCacheKey(codeql, languages, diskUsage); const statusFile = getStatusFilePath(languages); try { - await fs9.promises.mkdir(path9.dirname(statusFile), { recursive: true }); - await fs9.promises.writeFile(statusFile, JSON.stringify(status)); + await fs10.promises.mkdir(path10.dirname(statusFile), { recursive: true }); + await fs10.promises.writeFile(statusFile, JSON.stringify(status)); const cacheId = await waitForResultWithTimeLimit( MAX_CACHE_OPERATION_MS, actionsCache.saveCache([statusFile], cacheKey3), @@ -183755,8 +183832,8 @@ async function getCacheKey(codeql, languages, diskUsage) { } // src/trap-caching.ts -var fs10 = __toESM(require("fs")); -var path10 = __toESM(require("path")); +var fs11 = __toESM(require("fs")); +var path11 = __toESM(require("path")); var actionsCache2 = __toESM(require_cache6()); var CACHE_VERSION = 1; var CODEQL_TRAP_CACHE_PREFIX = "codeql-trap"; @@ -183773,13 +183850,13 @@ async function downloadTrapCaches(codeql, languages, logger2, repositoryRoot) { `Found ${languagesSupportingCaching.length} languages that support TRAP caching` ); if (languagesSupportingCaching.length === 0) return result; - const cachesDir = path10.join( + const cachesDir = path11.join( getTemporaryDirectory(), "trapCaches" ); for (const language of languagesSupportingCaching) { - const cacheDir2 = path10.join(cachesDir, language); - fs10.mkdirSync(cacheDir2, { recursive: true }); + const cacheDir2 = path11.join(cachesDir, language); + fs11.mkdirSync(cacheDir2, { recursive: true }); result[language] = cacheDir2; } if (await isAnalyzingDefaultBranch(getEnv(), repositoryRoot)) { @@ -183791,7 +183868,7 @@ async function downloadTrapCaches(codeql, languages, logger2, repositoryRoot) { let baseSha = "unknown"; const eventPath = process.env.GITHUB_EVENT_PATH; if (getWorkflowEventName() === "pull_request" && eventPath !== void 0) { - const event = JSON.parse(fs10.readFileSync(path10.resolve(eventPath), "utf-8")); + const event = JSON.parse(fs11.readFileSync(path11.resolve(eventPath), "utf-8")); baseSha = event.pull_request?.base?.sha || baseSha; } for (const language of languages) { @@ -183938,9 +184015,11 @@ async function getSupportedLanguageMap(codeql, logger2) { ); } const supportedLanguages = {}; + const extractorRoots = {}; for (const extractor of Object.keys(resolveResult.extractors)) { if (resolveSupportedLanguagesUsingCli || BuiltInLanguage[extractor] !== void 0) { supportedLanguages[extractor] = extractor; + extractorRoots[extractor] = resolveResult.extractors[extractor][0]?.extractor_root; } } if (resolveResult.aliases) { @@ -183948,13 +184027,13 @@ async function getSupportedLanguageMap(codeql, logger2) { supportedLanguages[alias] = extractor; } } - return supportedLanguages; + return { languageMap: supportedLanguages, extractorRoots }; } var baseWorkflowsPath = ".github/workflows"; function hasActionsWorkflows(sourceRoot) { - const workflowsPath = path11.resolve(sourceRoot, baseWorkflowsPath); - const stats = fs11.lstatSync(workflowsPath, { throwIfNoEntry: false }); - return stats !== void 0 && stats.isDirectory() && fs11.readdirSync(workflowsPath).length > 0; + const workflowsPath = path12.resolve(sourceRoot, baseWorkflowsPath); + const stats = fs12.lstatSync(workflowsPath, { throwIfNoEntry: false }); + return stats !== void 0 && stats.isDirectory() && fs12.readdirSync(workflowsPath).length > 0; } async function getRawLanguagesInRepo(repository, sourceRoot, logger2) { logger2.debug( @@ -183982,7 +184061,10 @@ async function getLanguages(codeql, languagesInput, repository, sourceRoot, logg sourceRoot, logger2 ); - const languageMap = await getSupportedLanguageMap(codeql, logger2); + const { languageMap, extractorRoots } = await getSupportedLanguageMap( + codeql, + logger2 + ); const languagesSet = /* @__PURE__ */ new Set(); const unknownLanguages = []; for (const language of rawLanguages) { @@ -183993,7 +184075,15 @@ async function getLanguages(codeql, languagesInput, repository, sourceRoot, logg languagesSet.add(extractorName); } } - const languages = Array.from(languagesSet); + let languages = Array.from(languagesSet); + if (autodetected) { + languages = filterLanguagesWithSourceFiles( + languages, + extractorRoots, + sourceRoot, + logger2 + ); + } if (!autodetected && unknownLanguages.length > 0) { throw new ConfigurationError( getUnknownLanguagesError(unknownLanguages) @@ -184119,8 +184209,8 @@ async function downloadCacheWithTime(codeQL, languages, logger2, repositoryRoot) async function loadUserConfig(actionState, configFile, workspacePath, apiDetails, tempDir) { if (isLocal(configFile)) { if (configFile !== userConfigFromActionPath(tempDir)) { - configFile = path11.resolve(workspacePath, configFile); - if (!(configFile + path11.sep).startsWith(workspacePath + path11.sep)) { + configFile = path12.resolve(workspacePath, configFile); + if (!(configFile + path12.sep).startsWith(workspacePath + path12.sep)) { throw new ConfigurationError( getConfigFileOutsideWorkspaceErrorMessage(configFile) ); @@ -184401,10 +184491,10 @@ async function setCppTrapCachingEnvironmentVariables(config, logger2) { } } function dbLocationOrDefault(dbLocation, tempDir) { - return dbLocation || path11.resolve(tempDir, "codeql_databases"); + return dbLocation || path12.resolve(tempDir, "codeql_databases"); } function userConfigFromActionPath(tempDir) { - return path11.resolve(tempDir, "user-config-from-action.yml"); + return path12.resolve(tempDir, "user-config-from-action.yml"); } function hasQueryCustomisation(userConfig) { return isDefined2(userConfig["disable-default-queries"]) || isDefined2(userConfig.queries) || isDefined2(userConfig["query-filters"]); @@ -184445,7 +184535,7 @@ async function determineUserConfig(action, tempDir, inputs) { inputs.configInput, fromConfigFile ); - fs11.writeFileSync(computedConfigPath, dump(mergedConfig)); + fs12.writeFileSync(computedConfigPath, dump(mergedConfig)); action.logger.debug( `Using merged configurations from 'config' input with configuration from '${inputs.configFile}': ${computedConfigPath}` ); @@ -184457,7 +184547,7 @@ async function determineUserConfig(action, tempDir, inputs) { `Both a config file and config input were provided. Ignoring config file.` ); } - fs11.writeFileSync(computedConfigPath, dump(inputs.configInput)); + fs12.writeFileSync(computedConfigPath, dump(inputs.configInput)); inputs.configFile = computedConfigPath; action.logger.debug( `Using config from action input: ${inputs.configFile}` @@ -184614,7 +184704,7 @@ function isLocal(configPath) { return !containsAtRef(configPath); } function getLocalConfig(logger2, configFile, validateConfig) { - if (!fs11.existsSync(configFile)) { + if (!fs12.existsSync(configFile)) { throw new ConfigurationError( getConfigFileDoesNotExistErrorMessage(configFile) ); @@ -184622,20 +184712,20 @@ function getLocalConfig(logger2, configFile, validateConfig) { return parseUserConfig( logger2, configFile, - fs11.readFileSync(configFile, "utf-8"), + fs12.readFileSync(configFile, "utf-8"), validateConfig ); } function getPathToParsedConfigFile(tempDir) { - return path11.join(tempDir, "config"); + return path12.join(tempDir, "config"); } function getPathToFailedConfigFile(tempDir) { - return path11.join(tempDir, "failed-config"); + return path12.join(tempDir, "failed-config"); } function saveConfigFile(logger2, configFilePath, config) { const configString = JSON.stringify(config); - fs11.mkdirSync(path11.dirname(configFilePath), { recursive: true }); - fs11.writeFileSync(configFilePath, configString, "utf8"); + fs12.mkdirSync(path12.dirname(configFilePath), { recursive: true }); + fs12.writeFileSync(configFilePath, configString, "utf8"); logger2.debug("Saved config:"); logger2.debug(configString); } @@ -184666,10 +184756,10 @@ function saveAbortedInitConfig(action, config) { ); } function readConfigFile(logger2, configFilePath) { - if (!fs11.existsSync(configFilePath)) { + if (!fs12.existsSync(configFilePath)) { return void 0; } - const configString = fs11.readFileSync(configFilePath, "utf8"); + const configString = fs12.readFileSync(configFilePath, "utf8"); logger2.debug("Loaded config:"); logger2.debug(configString); const config = JSON.parse(configString); @@ -184708,9 +184798,9 @@ async function generateRegistries(registriesInput, tempDir, logger2) { let qlconfigFile; if (registries) { const qlconfig = createRegistriesBlock(registries); - qlconfigFile = path11.join(tempDir, "qlconfig.yml"); + qlconfigFile = path12.join(tempDir, "qlconfig.yml"); const qlconfigContents = dump(qlconfig); - fs11.writeFileSync(qlconfigFile, qlconfigContents, "utf8"); + fs12.writeFileSync(qlconfigFile, qlconfigContents, "utf8"); logger2.debug("Generated qlconfig.yml:"); logger2.debug(qlconfigContents); registriesAuthTokens = registries.map((registry) => `${registry.url}=${registry.token}`).join(","); @@ -184839,8 +184929,8 @@ async function logGeneratedFilesTelemetry(config, duration, generatedFilesCount) } // src/setup-codeql.ts -var fs16 = __toESM(require("fs")); -var path13 = __toESM(require("path")); +var fs17 = __toESM(require("fs")); +var path14 = __toESM(require("path")); var import_perf_hooks4 = require("perf_hooks"); var toolcache3 = __toESM(require_tool_cache()); var semver10 = __toESM(require_semver2()); @@ -184875,7 +184965,7 @@ function getCodeQLBundleFromUrl(url2) { } // src/overlay/caching.ts -var fs12 = __toESM(require("fs")); +var fs13 = __toESM(require("fs")); var actionsCache3 = __toESM(require_cache6()); var semver5 = __toESM(require_semver2()); var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB = 7500; @@ -184885,7 +184975,7 @@ var CACHE_PREFIX = "codeql-overlay-base-database"; var MAX_CACHE_OPERATION_MS3 = 6e5; async function checkOverlayBaseDatabase(codeql, config, logger2, warningPrefix) { const baseDatabaseOidsFilePath = getBaseDatabaseOidsFilePath(config); - if (!fs12.existsSync(baseDatabaseOidsFilePath)) { + if (!fs13.existsSync(baseDatabaseOidsFilePath)) { logger2.warning( `${warningPrefix}: ${baseDatabaseOidsFilePath} does not exist` ); @@ -185518,7 +185608,7 @@ async function getCodeQLAssetDownloadURL(action, apiDetails, tagName, assetName, // src/tar.ts var import_child_process = require("child_process"); -var fs14 = __toESM(require("fs")); +var fs15 = __toESM(require("fs")); var stream = __toESM(require("stream")); var import_toolrunner = __toESM(require_toolrunner()); var io5 = __toESM(require_io()); @@ -185591,7 +185681,7 @@ async function isZstdAvailable(logger2) { } } async function extract(tarPath, dest, compressionMethod, tarVersion, logger2) { - fs14.mkdirSync(dest, { recursive: true }); + fs15.mkdirSync(dest, { recursive: true }); switch (compressionMethod) { case "gzip": return await toolcache.extractTar(tarPath, dest); @@ -185677,9 +185767,9 @@ function inferCompressionMethod(tarPath) { } // src/tools-download.ts -var fs15 = __toESM(require("fs")); +var fs16 = __toESM(require("fs")); var os5 = __toESM(require("os")); -var path12 = __toESM(require("path")); +var path13 = __toESM(require("path")); var import_perf_hooks3 = require("perf_hooks"); var core11 = __toESM(require_core()); var import_http_client = __toESM(require_lib()); @@ -185763,7 +185853,7 @@ async function downloadAndExtract(codeqlURL, compressionMethod, dest, authorizat }; } async function downloadAndExtractZstdWithStreaming(codeqlURL, dest, authorization, headers, tarVersion, logger2) { - fs15.mkdirSync(dest, { recursive: true }); + fs16.mkdirSync(dest, { recursive: true }); const agent = new import_http_client.HttpClient().getAgent(codeqlURL); headers = Object.assign( { "User-Agent": "CodeQL Action" }, @@ -185805,7 +185895,7 @@ async function downloadAndExtractZstdWithStreaming(codeqlURL, dest, authorizatio await extractTarZst(response, dest, tarVersion, logger2); } function getToolcacheToolDirectory(env) { - return path12.join( + return path13.join( env.getRequired("RUNNER_TOOL_CACHE" /* RUNNER_TOOL_CACHE */), TOOLCACHE_TOOL_NAME ); @@ -185814,7 +185904,7 @@ function getToolcacheVersionDirectoryName(version) { return semver9.clean(version) || version; } function getToolcacheDirectory(version) { - return path12.join( + return path13.join( getToolcacheToolDirectory(getEnv()), getToolcacheVersionDirectoryName(version), os5.arch() || "" @@ -185822,7 +185912,7 @@ function getToolcacheDirectory(version) { } function isToolcacheOnWorkspaceFilesystem(logger2) { try { - return fs15.statSync(getRequiredEnvParam("RUNNER_TOOL_CACHE")).dev === fs15.statSync(getRequiredEnvParam("GITHUB_WORKSPACE")).dev; + return fs16.statSync(getRequiredEnvParam("RUNNER_TOOL_CACHE")).dev === fs16.statSync(getRequiredEnvParam("GITHUB_WORKSPACE")).dev; } catch (e) { logger2.debug( `Could not determine whether the toolcache is on the same filesystem as the workspace: ${getErrorMessage(e)}` @@ -185844,7 +185934,7 @@ async function deleteToolcacheBundles({ return { deletedVersions: [], failed: true }; } try { - if ((await fs15.promises.lstat(toolDirectory)).isSymbolicLink()) { + if ((await fs16.promises.lstat(toolDirectory)).isSymbolicLink()) { logger2.info( `Not deleting the CodeQL tools from the toolcache since '${toolDirectory}' is a symlink.` ); @@ -185863,7 +185953,7 @@ async function deleteToolcacheBundles({ return { deletedVersions: [], failed: true }; } try { - const entries = await fs15.promises.readdir(toolDirectory, { + const entries = await fs16.promises.readdir(toolDirectory, { withFileTypes: true }); const deletedVersions = []; @@ -185875,10 +185965,10 @@ async function deleteToolcacheBundles({ ); continue; } - const versionDirectory = path12.join(toolDirectory, entry.name); + const versionDirectory = path13.join(toolDirectory, entry.name); try { const deletionStart = import_perf_hooks3.performance.now(); - await fs15.promises.rm(versionDirectory, { + await fs16.promises.rm(versionDirectory, { force: true, recursive: true }); @@ -185905,7 +185995,7 @@ async function deleteToolcacheBundles({ } function writeToolcacheMarkerFile(extractedPath, logger2) { const markerFilePath = `${extractedPath}.complete`; - fs15.writeFileSync(markerFilePath, ""); + fs16.writeFileSync(markerFilePath, ""); logger2.info(`Created toolcache marker file ${markerFilePath}`); } @@ -185957,7 +186047,7 @@ async function findOverridingToolsInCache(humanReadableVersion, logger2) { const candidates = toolcache3.findAllVersions("CodeQL").filter(isGoodVersion).map((version) => ({ folder: toolcache3.find("CodeQL", version), version - })).filter(({ folder }) => fs16.existsSync(path13.join(folder, "pinned-version"))); + })).filter(({ folder }) => fs17.existsSync(path14.join(folder, "pinned-version"))); if (candidates.length === 1) { const candidate = candidates[0]; logger2.debug( @@ -186510,7 +186600,7 @@ async function useZstdBundle(cliVersion2, tarSupportsZstd) { ); } function getTempExtractionDir(tempDir) { - return path13.join(tempDir, v4_default()); + return path14.join(tempDir, v4_default()); } async function getLatestNightlyBundle(action, rawLanguages, otherLanguagePacksReason, variant) { const { logger: logger2 } = action; @@ -186580,8 +186670,8 @@ function isReservedToolsValue(tools) { } // src/tracer-config.ts -var fs17 = __toESM(require("fs")); -var path14 = __toESM(require("path")); +var fs18 = __toESM(require("fs")); +var path15 = __toESM(require("path")); async function shouldEnableIndirectTracing(codeql, config) { if (config.buildMode === "none" /* None */) { return false; @@ -186596,18 +186686,18 @@ async function endTracingForCluster(codeql, config, logger2) { logger2.info( "Unsetting build tracing environment variables. Subsequent steps of this job will not be traced." ); - const envVariablesFile = path14.resolve( + const envVariablesFile = path15.resolve( config.dbLocation, "temp/tracingEnvironment/end-tracing.json" ); - if (!fs17.existsSync(envVariablesFile)) { + if (!fs18.existsSync(envVariablesFile)) { throw new Error( `Environment file for ending tracing not found: ${envVariablesFile}` ); } try { const endTracingEnvVariables = JSON.parse( - fs17.readFileSync(envVariablesFile, "utf8") + fs18.readFileSync(envVariablesFile, "utf8") ); for (const [key, value] of Object.entries(endTracingEnvVariables)) { if (value !== null) { @@ -186623,12 +186713,12 @@ async function endTracingForCluster(codeql, config, logger2) { } } async function getTracerConfigForCluster(logger2, config) { - const filePath = path14.resolve( + const filePath = path15.resolve( config.dbLocation, "temp/tracingEnvironment/start-tracing.json" ); try { - const tracingEnvVariables = JSON.parse(fs17.readFileSync(filePath, "utf8")); + const tracingEnvVariables = JSON.parse(fs18.readFileSync(filePath, "utf8")); return { env: tracingEnvVariables }; @@ -186672,7 +186762,7 @@ async function setupCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliV features, logger2 ); - let codeqlCmd = path15.join(codeqlFolder, "codeql", "codeql"); + let codeqlCmd = path16.join(codeqlFolder, "codeql", "codeql"); if (process.platform === "win32") { codeqlCmd += ".exe"; } else if (process.platform !== "linux" && process.platform !== "darwin") { @@ -186739,12 +186829,12 @@ async function getCodeQLForCmd(logger2, cmd, checkVersion, env = getEnv()) { }, async isTracedLanguage(language) { const extractorPath = await this.resolveExtractor(language); - const tracingConfigPath = path15.join( + const tracingConfigPath = path16.join( extractorPath, "tools", "tracing-config.lua" ); - return fs18.existsSync(tracingConfigPath); + return fs19.existsSync(tracingConfigPath); }, async isScannedLanguage(language) { return !await this.isTracedLanguage(language); @@ -186825,7 +186915,7 @@ async function getCodeQLForCmd(logger2, cmd, checkVersion, env = getEnv()) { }, async runAutobuild(config, language) { applyAutobuildAzurePipelinesTimeoutFix(env); - const autobuildCmd = path15.join( + const autobuildCmd = path16.join( await this.resolveExtractor(language), "tools", process.platform === "win32" ? "autobuild.cmd" : "autobuild.sh" @@ -187040,7 +187130,7 @@ async function getCodeQLForCmd(logger2, cmd, checkVersion, env = getEnv()) { }, async diagnosticsExport(sarifFile, automationDetailsId, config, diagnosticDir) { let configPath = getGeneratedCodeScanningConfigPath(config); - if (!fs18.existsSync(configPath)) { + if (!fs19.existsSync(configPath)) { if (config.successfullyInitialised) { logger2.warning( [ @@ -187228,7 +187318,7 @@ async function writeCodeScanningConfigFile(config, logger2) { logger2.startGroup("Augmented user configuration file contents"); logger2.info(dump(augmentedConfig)); logger2.endGroup(); - fs18.writeFileSync(codeScanningConfigFile, dump(augmentedConfig)); + fs19.writeFileSync(codeScanningConfigFile, dump(augmentedConfig)); return codeScanningConfigFile; } var TRAP_CACHE_SIZE_MB = 1024; @@ -187251,7 +187341,7 @@ async function getTrapCachingExtractorConfigArgsForLang(config, language) { ]; } function getGeneratedCodeScanningConfigPath(config) { - return path15.resolve(config.tempDir, "user-config.yaml"); + return path16.resolve(config.tempDir, "user-config.yaml"); } function getExtractionVerbosityArguments(enableDebugLogging) { return enableDebugLogging ? [`--verbosity=${EXTRACTION_DEBUG_MODE_VERBOSITY}`] : []; @@ -187646,7 +187736,7 @@ var CodeQLAnalysisError = class extends Error { }; async function determineCheckoutPath(action, config) { const checkoutPathInput = action.actions.getRequiredInput("checkout_path"); - const absCheckoutPathInput = path16.resolve(checkoutPathInput); + const absCheckoutPathInput = path17.resolve(checkoutPathInput); const repositoryRoot = await getGitRoot(absCheckoutPathInput); if (repositoryRoot === void 0) { action.logger.warning( @@ -187724,7 +187814,7 @@ function dbIsFinalized(config, language, logger2) { const dbPath = getCodeQLDatabasePath(config, language); try { const dbInfo = load( - fs19.readFileSync(path16.resolve(dbPath, "codeql-database.yml"), "utf8") + fs20.readFileSync(path17.resolve(dbPath, "codeql-database.yml"), "utf8") ); return !("inProgress" in dbInfo); } catch { @@ -187793,7 +187883,7 @@ function diffRangeExtensionPackContents(ranges, checkoutPath) { data: `; let data = ranges.map((range2) => { - const filename = path16.join(checkoutPath, range2.path).replaceAll(path16.sep, "/"); + const filename = path17.join(checkoutPath, range2.path).replaceAll(path17.sep, "/"); return ` - [${dump(filename, { forceQuotes: true, quoteStyle: "double" }).trim()}, ${range2.startLine}, ${range2.endLine}] `; }).join(""); @@ -187806,10 +187896,10 @@ function writeDiffRangeDataExtensionPack(logger2, ranges, checkoutPath) { if (ranges.length === 0) { ranges = [{ path: "", startLine: 0, endLine: 0 }]; } - const diffRangeDir = path16.join(getTemporaryDirectory(), "pr-diff-range"); - fs19.mkdirSync(diffRangeDir, { recursive: true }); - fs19.writeFileSync( - path16.join(diffRangeDir, "qlpack.yml"), + const diffRangeDir = path17.join(getTemporaryDirectory(), "pr-diff-range"); + fs20.mkdirSync(diffRangeDir, { recursive: true }); + fs20.writeFileSync( + path17.join(diffRangeDir, "qlpack.yml"), ` name: codeql-action/pr-diff-range version: 0.0.0 @@ -187824,8 +187914,8 @@ dataExtensions: ranges, checkoutPath ); - const extensionFilePath = path16.join(diffRangeDir, "pr-diff-range.yml"); - fs19.writeFileSync(extensionFilePath, extensionContents); + const extensionFilePath = path17.join(diffRangeDir, "pr-diff-range.yml"); + fs20.writeFileSync(extensionFilePath, extensionContents); logger2.debug( `Wrote pr-diff-range extension pack to ${extensionFilePath}: ${extensionContents}` @@ -187941,7 +188031,7 @@ async function runQueries(sarifFolder, memoryFlag, threadsFlag, diffRangePackDir async function runInterpretResultsFor(analysis, language, queries, enableDebugLogging) { logger2.info(`Interpreting ${analysis.name} results for ${language}`); const category = analysis.fixCategory(logger2, automationDetailsId); - const sarifFile = path16.join( + const sarifFile = path17.join( sarifFolder, addSarifExtension(analysis, language) ); @@ -187970,7 +188060,7 @@ async function runQueries(sarifFolder, memoryFlag, threadsFlag, diffRangePackDir } function getPerQueryAlertCounts(sarifPath) { const sarifObject = JSON.parse( - fs19.readFileSync(sarifPath, "utf8") + fs20.readFileSync(sarifPath, "utf8") ); const perQueryAlertCounts = {}; for (const sarifRun of sarifObject.runs) { @@ -187988,13 +188078,13 @@ async function runQueries(sarifFolder, memoryFlag, threadsFlag, diffRangePackDir } async function runFinalize(features, outputDir, threadsFlag, memoryFlag, codeql, config, logger2) { try { - await fs19.promises.rm(outputDir, { force: true, recursive: true }); + await fs20.promises.rm(outputDir, { force: true, recursive: true }); } catch (error3) { if (error3?.code !== "ENOENT") { throw error3; } } - await fs19.promises.mkdir(outputDir, { recursive: true }); + await fs20.promises.mkdir(outputDir, { recursive: true }); const timings = await finalizeDatabaseCreation( codeql, features, @@ -188038,7 +188128,7 @@ async function warnIfGoInstalledAfterInit(config, logger2) { } // src/database-upload.ts -var fs20 = __toESM(require("fs")); +var fs21 = __toESM(require("fs")); async function cleanupAndUploadDatabases(action, repositoryNwo, codeql, config, apiDetails, checkoutPath) { const logger2 = action.logger; if (getRequiredInput("upload-database") !== "true") { @@ -188075,7 +188165,7 @@ async function cleanupAndUploadDatabases(action, repositoryNwo, codeql, config, const bundledDb = await bundleDb(config, language, codeql, language, { includeDiagnostics: false }); - bundledDbSize = fs20.statSync(bundledDb).size; + bundledDbSize = fs21.statSync(bundledDb).size; const commitOid = await getCommitOid(action.env, checkoutPath); const maxAttempts = 4; let uploadDurationMs; @@ -188153,7 +188243,7 @@ async function recordClearCleanupSizes(codeql, config, reports, logger2) { const bundledDb = await bundleDb(config, language, codeql, language, { includeDiagnostics: false }); - report.clear_cleanup_zipped_size_bytes = fs20.statSync(bundledDb).size; + report.clear_cleanup_zipped_size_bytes = fs21.statSync(bundledDb).size; logger2.debug( `Database for ${language} is ${report.clear_cleanup_zipped_size_bytes} bytes zipped at the '${"clear" /* Clear */}' cleanup level (vs. ${report.zipped_upload_size_bytes ?? "unknown"} bytes at the '${"overlay" /* Overlay */}' level).` ); @@ -188176,7 +188266,7 @@ async function uploadBundledDatabase(repositoryNwo, language, commitOid, bundled if (uploadsBaseUrl.endsWith("/")) { uploadsBaseUrl = uploadsBaseUrl.slice(0, -1); } - const bundledDbReadStream = fs20.createReadStream(bundledDb); + const bundledDbReadStream = fs21.createReadStream(bundledDb); try { const startTime = performance.now(); await client.request( @@ -188228,15 +188318,15 @@ __export(upload_lib_exports, { waitForProcessing: () => waitForProcessing, writePostProcessedFiles: () => writePostProcessedFiles }); -var fs24 = __toESM(require("fs")); -var path19 = __toESM(require("path")); +var fs25 = __toESM(require("fs")); +var path20 = __toESM(require("path")); var url = __toESM(require("url")); var import_zlib = __toESM(require("zlib")); var core13 = __toESM(require_core()); var jsonschema2 = __toESM(require_lib2()); // src/fingerprints.ts -var fs21 = __toESM(require("fs")); +var fs22 = __toESM(require("fs")); var import_path4 = __toESM(require("path")); // node_modules/long/index.js @@ -189224,7 +189314,7 @@ async function hash(callback, filepath) { } updateHash(current); }; - const readStream = fs21.createReadStream(filepath, "utf8"); + const readStream = fs22.createReadStream(filepath, "utf8"); for await (const data of readStream) { for (let i = 0; i < data.length; ++i) { processCharacter(data.charCodeAt(i)); @@ -189299,11 +189389,11 @@ function resolveUriToFile(location, artifacts, sourceRoot, logger2) { if (!import_path4.default.isAbsolute(uri)) { uri = srcRootPrefix + uri; } - if (!fs21.existsSync(uri)) { + if (!fs22.existsSync(uri)) { logger2.debug(`Unable to compute fingerprint for non-existent file: ${uri}`); return void 0; } - if (fs21.statSync(uri).isDirectory()) { + if (fs22.statSync(uri).isDirectory()) { logger2.debug(`Unable to compute fingerprint for directory: ${uri}`); return void 0; } @@ -189358,8 +189448,8 @@ async function addFingerprints(sarifLog, sourceRoot, logger2) { } // src/init.ts -var fs22 = __toESM(require("fs")); -var path18 = __toESM(require("path")); +var fs23 = __toESM(require("fs")); +var path19 = __toESM(require("path")); var toolrunner5 = __toESM(require_toolrunner()); var github3 = __toESM(require_github()); var io7 = __toESM(require_io()); @@ -189393,7 +189483,7 @@ async function initConfig2(actionState, inputs) { }); } async function runDatabaseInitCluster(databaseInitEnvironment, codeql, config, sourceRoot, processName, qlconfigFile) { - fs22.mkdirSync(config.dbLocation, { recursive: true }); + fs23.mkdirSync(config.dbLocation, { recursive: true }); await wrapEnvironment( databaseInitEnvironment, async () => await codeql.databaseInitCluster( @@ -189427,25 +189517,25 @@ async function checkPacksForOverlayCompatibility(codeql, config, logger2) { } function checkPackForOverlayCompatibility(packDir, codeQlOverlayVersion, logger2) { try { - let qlpackPath = path18.join(packDir, "qlpack.yml"); - if (!fs22.existsSync(qlpackPath)) { - qlpackPath = path18.join(packDir, "codeql-pack.yml"); + let qlpackPath = path19.join(packDir, "qlpack.yml"); + if (!fs23.existsSync(qlpackPath)) { + qlpackPath = path19.join(packDir, "codeql-pack.yml"); } const qlpackContents = load( - fs22.readFileSync(qlpackPath, "utf8") + fs23.readFileSync(qlpackPath, "utf8") ); if (!qlpackContents.buildMetadata) { return true; } - const packInfoPath = path18.join(packDir, ".packinfo"); - if (!fs22.existsSync(packInfoPath)) { + const packInfoPath = path19.join(packDir, ".packinfo"); + if (!fs23.existsSync(packInfoPath)) { logger2.warning( `The query pack at ${packDir} does not have a .packinfo file, so it cannot support overlay analysis. Recompiling the query pack with the latest CodeQL CLI should solve this problem.` ); return false; } const packInfoFileContents = JSON.parse( - fs22.readFileSync(packInfoPath, "utf8") + fs23.readFileSync(packInfoPath, "utf8") ); const packOverlayVersion = packInfoFileContents.overlayVersion; if (typeof packOverlayVersion !== "number") { @@ -189470,7 +189560,7 @@ function checkPackForOverlayCompatibility(packDir, codeQlOverlayVersion, logger2 } async function checkInstallPython311(languages, codeql) { if (languages.includes("python" /* python */) && process.platform === "win32" && !(await codeql.getVersion()).features?.supportsPython312) { - const script = path18.resolve( + const script = path19.resolve( __dirname, "../python-setup", "check_python12.ps1" @@ -189480,8 +189570,8 @@ async function checkInstallPython311(languages, codeql) { ]).exec(); } } -function cleanupDatabaseClusterDirectory(config, logger2, options = {}, rmSync5 = fs22.rmSync) { - if (fs22.existsSync(config.dbLocation) && (fs22.statSync(config.dbLocation).isFile() || fs22.readdirSync(config.dbLocation).length > 0)) { +function cleanupDatabaseClusterDirectory(config, logger2, options = {}, rmSync5 = fs23.rmSync) { + if (fs23.existsSync(config.dbLocation) && (fs23.statSync(config.dbLocation).isFile() || fs23.readdirSync(config.dbLocation).length > 0)) { if (!options.disableExistingDirectoryWarning) { logger2.warning( `The database cluster directory ${config.dbLocation} must be empty. Attempting to clean it up.` @@ -189586,7 +189676,7 @@ To opt out of this change, ${envVarOptOut}`; } // src/sarif/index.ts -var fs23 = __toESM(require("fs")); +var fs24 = __toESM(require("fs")); var InvalidSarifUploadError = class extends Error { }; function getToolNames(sarifFile) { @@ -189602,7 +189692,7 @@ function getToolNames(sarifFile) { } function readSarifFile(sarifFilePath) { try { - return JSON.parse(fs23.readFileSync(sarifFilePath, "utf8")); + return JSON.parse(fs24.readFileSync(sarifFilePath, "utf8")); } catch (err) { throw new Error( `Parsing SARIF file at '${sarifFilePath}' failed: ${getErrorMessage(err)}` @@ -189742,10 +189832,10 @@ async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, lo ); codeQL = initCodeQLResult.codeql; } - const baseTempDir = path19.resolve(tempDir, "combined-sarif"); - fs24.mkdirSync(baseTempDir, { recursive: true }); - const outputDirectory = fs24.mkdtempSync(path19.resolve(baseTempDir, "output-")); - const outputFile = path19.resolve(outputDirectory, "combined-sarif.sarif"); + const baseTempDir = path20.resolve(tempDir, "combined-sarif"); + fs25.mkdirSync(baseTempDir, { recursive: true }); + const outputDirectory = fs25.mkdtempSync(path20.resolve(baseTempDir, "output-")); + const outputFile = path20.resolve(outputDirectory, "combined-sarif.sarif"); await codeQL.mergeResults(sarifFiles, outputFile, { mergeRunsFromEqualCategory: true }); @@ -189776,7 +189866,7 @@ function getAutomationID2(category, analysis_key, environment) { return computeAutomationID(analysis_key, environment); } function getSavedPayloadPath(analysisKind) { - return path19.join( + return path20.join( getTemporaryDirectory(), `payload-${analysisKind}.json` ); @@ -189789,7 +189879,7 @@ async function uploadPayload(payload, repositoryNwo, logger2, analysis) { `SARIF upload disabled by an environment variable. Saving to ${payloadSaveFile}` ); logger2.info(`Payload: ${JSON.stringify(payload, null, 2)}`); - fs24.writeFileSync(payloadSaveFile, JSON.stringify(payload, null, 2)); + fs25.writeFileSync(payloadSaveFile, JSON.stringify(payload, null, 2)); return "dummy-sarif-id"; } const client = getApiClient(); @@ -189823,12 +189913,12 @@ async function uploadPayload(payload, repositoryNwo, logger2, analysis) { function findSarifFilesInDir(sarifPath, isSarif) { const sarifFiles = []; const walkSarifFiles = (dir) => { - const entries = fs24.readdirSync(dir, { withFileTypes: true }); + const entries = fs25.readdirSync(dir, { withFileTypes: true }); for (const entry of entries) { if (entry.isFile() && isSarif(entry.name)) { - sarifFiles.push(path19.resolve(dir, entry.name)); + sarifFiles.push(path20.resolve(dir, entry.name)); } else if (entry.isDirectory()) { - walkSarifFiles(path19.resolve(dir, entry.name)); + walkSarifFiles(path20.resolve(dir, entry.name)); } } }; @@ -189836,11 +189926,11 @@ function findSarifFilesInDir(sarifPath, isSarif) { return sarifFiles; } function getSarifFilePaths(sarifPath, isSarif) { - if (!fs24.existsSync(sarifPath)) { + if (!fs25.existsSync(sarifPath)) { throw new ConfigurationError(`Path does not exist: ${sarifPath}`); } let sarifFiles; - if (fs24.lstatSync(sarifPath).isDirectory()) { + if (fs25.lstatSync(sarifPath).isDirectory()) { sarifFiles = findSarifFilesInDir(sarifPath, isSarif); if (sarifFiles.length === 0) { throw new ConfigurationError( @@ -189853,7 +189943,7 @@ function getSarifFilePaths(sarifPath, isSarif) { return sarifFiles; } async function getGroupedSarifFilePaths(logger2, sarifPath) { - const stats = fs24.statSync(sarifPath, { throwIfNoEntry: false }); + const stats = fs25.statSync(sarifPath, { throwIfNoEntry: false }); if (stats === void 0) { throw new ConfigurationError(`Path does not exist: ${sarifPath}`); } @@ -189861,7 +189951,7 @@ async function getGroupedSarifFilePaths(logger2, sarifPath) { if (stats.isDirectory()) { let unassignedSarifFiles = findSarifFilesInDir( sarifPath, - (name) => path19.extname(name) === ".sarif" + (name) => path20.extname(name) === ".sarif" ); logger2.debug( `Found the following .sarif files in ${sarifPath}: ${unassignedSarifFiles.join(", ")}` @@ -189988,7 +190078,7 @@ function buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, wo payloadObj.base_sha = mergeBaseCommitOid; } else if (process.env.GITHUB_EVENT_PATH) { const githubEvent = JSON.parse( - fs24.readFileSync(process.env.GITHUB_EVENT_PATH, "utf8") + fs25.readFileSync(process.env.GITHUB_EVENT_PATH, "utf8") ); payloadObj.base_ref = `refs/heads/${githubEvent.pull_request.base.ref}`; payloadObj.base_sha = githubEvent.pull_request.base.sha; @@ -190126,19 +190216,19 @@ async function uploadPostProcessedFiles(logger2, checkoutPath, uploadTarget, pos }; } function dumpSarifFile(sarifPayload, outputDir, logger2, uploadTarget) { - if (!fs24.existsSync(outputDir)) { - fs24.mkdirSync(outputDir, { recursive: true }); - } else if (!fs24.lstatSync(outputDir).isDirectory()) { + if (!fs25.existsSync(outputDir)) { + fs25.mkdirSync(outputDir, { recursive: true }); + } else if (!fs25.lstatSync(outputDir).isDirectory()) { throw new ConfigurationError( `The path that processed SARIF files should be written to exists, but is not a directory: ${outputDir}` ); } - const outputFile = path19.resolve( + const outputFile = path20.resolve( outputDir, `upload${uploadTarget.sarifExtension}` ); logger2.info(`Writing processed SARIF file to ${outputFile}`); - fs24.writeFileSync(outputFile, sarifPayload); + fs25.writeFileSync(outputFile, sarifPayload); } var STATUS_CHECK_INITIAL_BACKOFF_MILLISECONDS = 5 * 1e3; var STATUS_CHECK_BACKOFF_MULTIPLIER = 2; @@ -190392,7 +190482,7 @@ function doesGoExtractionOutputExist(config) { "trap", "go" /* go */ ); - return fs25.existsSync(trapDirectory) && fs25.readdirSync(trapDirectory).some( + return fs26.existsSync(trapDirectory) && fs26.readdirSync(trapDirectory).some( (fileName) => [ ".trap", ".trap.gz", @@ -190688,12 +190778,12 @@ async function runWrapper() { } // src/analyze-action-post.ts -var fs29 = __toESM(require("fs")); +var fs30 = __toESM(require("fs")); var core16 = __toESM(require_core()); // src/debug-artifacts.ts -var fs28 = __toESM(require("fs")); -var path23 = __toESM(require("path")); +var fs29 = __toESM(require("fs")); +var path24 = __toESM(require("path")); var artifact = __toESM(require_artifact2()); var artifactLegacy = __toESM(require_artifact_client2()); var core15 = __toESM(require_core()); @@ -190707,7 +190797,7 @@ function isStream(stream2, { checkOpen = true } = {}) { } // node_modules/readdir-glob/dist/index.mjs -var fs26 = __toESM(require("fs"), 1); +var fs27 = __toESM(require("fs"), 1); var import_events = require("events"); // node_modules/readdir-glob/node_modules/balanced-match/dist/esm/index.js @@ -191830,11 +191920,11 @@ var qmarksTestNoExtDot = ([$0]) => { return (f) => f.length === len && f !== "." && f !== ".."; }; var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix"; -var path21 = { +var path22 = { win32: { sep: "\\" }, posix: { sep: "/" } }; -var sep6 = defaultPlatform === "win32" ? path21.win32.sep : path21.posix.sep; +var sep6 = defaultPlatform === "win32" ? path22.win32.sep : path22.posix.sep; minimatch.sep = sep6; var GLOBSTAR = /* @__PURE__ */ Symbol("globstar **"); minimatch.GLOBSTAR = GLOBSTAR; @@ -192584,7 +192674,7 @@ minimatch.unescape = unescape2; var import_path6 = require("path"); function readdir2(dir, strict) { return new Promise((resolve$1, reject) => { - fs26.readdir(dir, { withFileTypes: true }, (err, files) => { + fs27.readdir(dir, { withFileTypes: true }, (err, files) => { if (err) switch (err.code) { case "ENOTDIR": if (strict) reject(err); @@ -192607,7 +192697,7 @@ function readdir2(dir, strict) { } function getStat(file, followSymlinks) { return new Promise((resolve$1) => { - const statFunc = followSymlinks ? fs26.stat : fs26.lstat; + const statFunc = followSymlinks ? fs27.stat : fs27.lstat; statFunc(file, (err, stats) => { if (err) switch (err.code) { case "ENOENT": @@ -192622,13 +192712,13 @@ function getStat(file, followSymlinks) { }); }); } -async function* exploreWalkAsync(dir, path30, followSymlinks, useStat, shouldSkip, strict) { - let files = await readdir2(path30 + dir, strict); +async function* exploreWalkAsync(dir, path31, followSymlinks, useStat, shouldSkip, strict) { + let files = await readdir2(path31 + dir, strict); for (const file of files) { let name = file.name; const filename = dir + "/" + name; const relative3 = filename.slice(1); - const absolute = path30 + "/" + relative3; + const absolute = path31 + "/" + relative3; let stat2 = file; if (useStat || followSymlinks) stat2 = await getStat(absolute, followSymlinks) ?? stat2; if (stat2.isDirectory()) { @@ -192638,7 +192728,7 @@ async function* exploreWalkAsync(dir, path30, followSymlinks, useStat, shouldSki absolute, stat: stat2 }; - yield* exploreWalkAsync(filename, path30, followSymlinks, useStat, shouldSkip, false); + yield* exploreWalkAsync(filename, path31, followSymlinks, useStat, shouldSkip, false); } } else yield { relative: relative3, @@ -192647,8 +192737,8 @@ async function* exploreWalkAsync(dir, path30, followSymlinks, useStat, shouldSki }; } } -async function* explore(path30, followSymlinks, useStat, shouldSkip) { - yield* exploreWalkAsync("", path30, followSymlinks, useStat, shouldSkip, true); +async function* explore(path31, followSymlinks, useStat, shouldSkip) { + yield* exploreWalkAsync("", path31, followSymlinks, useStat, shouldSkip, true); } function readOptions(options) { return { @@ -195077,9 +195167,9 @@ var ZipArchive = class extends Archiver { }; // src/artifact-scanner.ts -var fs27 = __toESM(require("fs")); +var fs28 = __toESM(require("fs")); var os7 = __toESM(require("os")); -var path22 = __toESM(require("path")); +var path23 = __toESM(require("path")); var exec = __toESM(require_exec()); var GITHUB_PAT_CLASSIC_PATTERN = { type: "Personal Access Token (Classic)" /* PersonalAccessClassic */, @@ -195124,7 +195214,7 @@ function isAuthToken(value, patterns = GITHUB_TOKEN_PATTERNS) { function scanFileForTokens(filePath, relativePath2, logger2) { const findings = []; try { - const content = fs27.readFileSync(filePath, "utf8"); + const content = fs28.readFileSync(filePath, "utf8"); for (const { type, pattern } of GITHUB_TOKEN_PATTERNS) { const matches = content.match(pattern); if (matches) { @@ -195157,10 +195247,10 @@ async function scanArchiveFile(archivePath, relativeArchivePath, extractDir, log findings: [] }; try { - const tempExtractDir = fs27.mkdtempSync( - path22.join(extractDir, `extract-${depth}-`) + const tempExtractDir = fs28.mkdtempSync( + path23.join(extractDir, `extract-${depth}-`) ); - const fileName = path22.basename(archivePath).toLowerCase(); + const fileName = path23.basename(archivePath).toLowerCase(); if (fileName.endsWith(".tar.gz") || fileName.endsWith(".tgz")) { logger2.debug(`Extracting tar.gz file: ${archivePath}`); await exec.exec("tar", ["-xzf", archivePath, "-C", tempExtractDir], { @@ -195177,21 +195267,21 @@ async function scanArchiveFile(archivePath, relativeArchivePath, extractDir, log ); } else if (fileName.endsWith(".zst")) { logger2.debug(`Extracting zst file: ${archivePath}`); - const outputFile = path22.join( + const outputFile = path23.join( tempExtractDir, - path22.basename(archivePath, ".zst") + path23.basename(archivePath, ".zst") ); await exec.exec("zstd", ["-d", archivePath, "-o", outputFile], { silent: true }); } else if (fileName.endsWith(".gz")) { logger2.debug(`Extracting gz file: ${archivePath}`); - const outputFile = path22.join( + const outputFile = path23.join( tempExtractDir, - path22.basename(archivePath, ".gz") + path23.basename(archivePath, ".gz") ); await exec.exec("gunzip", ["-c", archivePath], { - outStream: fs27.createWriteStream(outputFile), + outStream: fs28.createWriteStream(outputFile), silent: true }); } else if (fileName.endsWith(".zip")) { @@ -195212,7 +195302,7 @@ async function scanArchiveFile(archivePath, relativeArchivePath, extractDir, log ); result.scannedFiles += scanResult.scannedFiles; result.findings.push(...scanResult.findings); - fs27.rmSync(tempExtractDir, { recursive: true, force: true }); + fs28.rmSync(tempExtractDir, { recursive: true, force: true }); } catch (e) { logger2.debug( `Could not extract or scan archive file ${archivePath}: ${getErrorMessage(e)}` @@ -195225,7 +195315,7 @@ async function scanFile(fullPath, relativePath2, extractDir, logger2, depth = 0) scannedFiles: 1, findings: [] }; - const fileName = path22.basename(fullPath).toLowerCase(); + const fileName = path23.basename(fullPath).toLowerCase(); const isArchive = fileName.endsWith(".zip") || fileName.endsWith(".tar.gz") || fileName.endsWith(".tgz") || fileName.endsWith(".tar.zst") || fileName.endsWith(".zst") || fileName.endsWith(".gz"); if (isArchive) { const archiveResult = await scanArchiveFile( @@ -195247,10 +195337,10 @@ async function scanDirectory(dirPath, baseRelativePath, logger2, depth = 0) { scannedFiles: 0, findings: [] }; - const entries = fs27.readdirSync(dirPath, { withFileTypes: true }); + const entries = fs28.readdirSync(dirPath, { withFileTypes: true }); for (const entry of entries) { - const fullPath = path22.join(dirPath, entry.name); - const relativePath2 = path22.join(baseRelativePath, entry.name); + const fullPath = path23.join(dirPath, entry.name); + const relativePath2 = path23.join(baseRelativePath, entry.name); if (entry.isDirectory()) { const subResult = await scanDirectory( fullPath, @@ -195264,7 +195354,7 @@ async function scanDirectory(dirPath, baseRelativePath, logger2, depth = 0) { const fileResult = await scanFile( fullPath, relativePath2, - path22.dirname(fullPath), + path23.dirname(fullPath), logger2, depth ); @@ -195282,11 +195372,11 @@ async function scanArtifactsForTokens(filesToScan, logger2) { scannedFiles: 0, findings: [] }; - const tempScanDir = fs27.mkdtempSync(path22.join(os7.tmpdir(), "artifact-scan-")); + const tempScanDir = fs28.mkdtempSync(path23.join(os7.tmpdir(), "artifact-scan-")); try { for (const filePath of filesToScan) { - const stats = fs27.statSync(filePath); - const fileName = path22.basename(filePath); + const stats = fs28.statSync(filePath); + const fileName = path23.basename(filePath); if (stats.isDirectory()) { const dirResult = await scanDirectory(filePath, fileName, logger2); result.scannedFiles += dirResult.scannedFiles; @@ -195323,7 +195413,7 @@ async function scanArtifactsForTokens(filesToScan, logger2) { } } finally { try { - fs27.rmSync(tempScanDir, { recursive: true, force: true }); + fs28.rmSync(tempScanDir, { recursive: true, force: true }); } catch (e) { logger2.debug( `Could not clean up temporary scan directory: ${getErrorMessage(e)}` @@ -195343,14 +195433,14 @@ async function uploadCombinedSarifArtifacts(logger2, gitHubVariant) { logger2.info( "Uploading available combined SARIF files as Actions debugging artifact..." ); - const baseTempDir = path23.resolve(tempDir, "combined-sarif"); + const baseTempDir = path24.resolve(tempDir, "combined-sarif"); const toUpload = []; - if (fs28.existsSync(baseTempDir)) { - const outputDirs = fs28.readdirSync(baseTempDir); + if (fs29.existsSync(baseTempDir)) { + const outputDirs = fs29.readdirSync(baseTempDir); for (const outputDir of outputDirs) { - const sarifFiles = fs28.readdirSync(path23.resolve(baseTempDir, outputDir)).filter((f) => path23.extname(f) === ".sarif"); + const sarifFiles = fs29.readdirSync(path24.resolve(baseTempDir, outputDir)).filter((f) => path24.extname(f) === ".sarif"); for (const sarifFile of sarifFiles) { - toUpload.push(path23.resolve(baseTempDir, outputDir, sarifFile)); + toUpload.push(path24.resolve(baseTempDir, outputDir, sarifFile)); } } } @@ -195375,17 +195465,17 @@ async function uploadCombinedSarifArtifacts(logger2, gitHubVariant) { function tryPrepareSarifDebugArtifact(config, language, logger2) { try { const analyzeActionOutputDir = process.env["CODEQL_ACTION_SARIF_RESULTS_OUTPUT_DIR" /* SARIF_RESULTS_OUTPUT_DIR */]; - if (analyzeActionOutputDir !== void 0 && fs28.existsSync(analyzeActionOutputDir) && fs28.lstatSync(analyzeActionOutputDir).isDirectory()) { - const sarifFile = path23.resolve( + if (analyzeActionOutputDir !== void 0 && fs29.existsSync(analyzeActionOutputDir) && fs29.lstatSync(analyzeActionOutputDir).isDirectory()) { + const sarifFile = path24.resolve( analyzeActionOutputDir, `${language}.sarif` ); - if (fs28.existsSync(sarifFile)) { - const sarifInDbLocation = path23.resolve( + if (fs29.existsSync(sarifFile)) { + const sarifInDbLocation = path24.resolve( config.dbLocation, `${language}.sarif` ); - fs28.copyFileSync(sarifFile, sarifInDbLocation); + fs29.copyFileSync(sarifFile, sarifInDbLocation); return sarifInDbLocation; } } @@ -195436,13 +195526,13 @@ async function tryUploadAllAvailableDebugArtifacts(codeql, config, logger2) { } logger2.info("Preparing database logs debug artifact..."); const databaseDirectory = getCodeQLDatabasePath(config, language); - const logsDirectory = path23.resolve(databaseDirectory, "log"); + const logsDirectory = path24.resolve(databaseDirectory, "log"); if (doesDirectoryExist(logsDirectory)) { filesToUpload.push(...listFolder(logsDirectory)); logger2.info("Database logs debug artifact ready for upload."); } logger2.info("Preparing database cluster logs debug artifact..."); - const multiLanguageTracingLogsDirectory = path23.resolve( + const multiLanguageTracingLogsDirectory = path24.resolve( config.dbLocation, "log" ); @@ -195518,8 +195608,8 @@ async function uploadArtifacts(logger2, toUpload, rootDir, artifactName, ghVaria try { await artifactUploader.uploadArtifact( sanitizeArtifactName(`${artifactName}${suffix}`), - toUpload.map((file) => path23.normalize(file)), - path23.normalize(rootDir), + toUpload.map((file) => path24.normalize(file)), + path24.normalize(rootDir), { // ensure we don't keep the debug artifacts around for too long since they can be large. retentionDays: 7 @@ -195546,17 +195636,17 @@ async function getArtifactUploaderClient(logger2, ghVariant) { } async function createPartialDatabaseBundle(config, language) { const databasePath = getCodeQLDatabasePath(config, language); - const databaseBundlePath = path23.resolve( + const databaseBundlePath = path24.resolve( config.dbLocation, `${config.debugDatabaseName}-${language}-partial.zip` ); core15.info( `${config.debugDatabaseName}-${language} is not finalized. Uploading partial database bundle at ${databaseBundlePath}...` ); - if (fs28.existsSync(databaseBundlePath)) { - await fs28.promises.rm(databaseBundlePath, { force: true }); + if (fs29.existsSync(databaseBundlePath)) { + await fs29.promises.rm(databaseBundlePath, { force: true }); } - const output = fs28.createWriteStream(databaseBundlePath); + const output = fs29.createWriteStream(databaseBundlePath); const zip = new ZipArchive(); zip.on("error", (err) => { throw err; @@ -195606,9 +195696,9 @@ async function runWrapper2() { getCsharpTempDependencyDir() ]; for (const tempDependencyDir of tempDependencyDirs) { - if (fs29.existsSync(tempDependencyDir)) { + if (fs30.existsSync(tempDependencyDir)) { try { - fs29.rmSync(tempDependencyDir, { recursive: true }); + fs30.rmSync(tempDependencyDir, { recursive: true }); } catch (error3) { logger2.info( `Failed to remove temporary dependencies directory: ${getErrorMessage(error3)}` @@ -195726,8 +195816,8 @@ async function runWrapper3() { } // src/init-action.ts -var fs31 = __toESM(require("fs")); -var path25 = __toESM(require("path")); +var fs32 = __toESM(require("fs")); +var path26 = __toESM(require("path")); var core19 = __toESM(require_core()); var io8 = __toESM(require_io()); var semver12 = __toESM(require_semver2()); @@ -195939,8 +196029,8 @@ function createInitToolsDownloadFields(report, toolsFeatureFlagsValid) { } // src/workflow.ts -var fs30 = __toESM(require("fs")); -var path24 = __toESM(require("path")); +var fs31 = __toESM(require("fs")); +var path25 = __toESM(require("path")); var import_zlib3 = __toESM(require("zlib")); var core18 = __toESM(require_core()); function toCodedErrors(errors) { @@ -196091,15 +196181,15 @@ async function getWorkflow(logger2) { ); } const workflowPath = await getWorkflowAbsolutePath(logger2); - return load(fs30.readFileSync(workflowPath, "utf-8")); + return load(fs31.readFileSync(workflowPath, "utf-8")); } async function getWorkflowAbsolutePath(logger2) { const relativePath2 = await getWorkflowRelativePath(); - const absolutePath = path24.join( + const absolutePath = path25.join( getRequiredEnvParam("GITHUB_WORKSPACE"), relativePath2 ); - if (fs30.existsSync(absolutePath)) { + if (fs31.existsSync(absolutePath)) { logger2.debug( `Derived the following absolute path for the currently executing workflow: ${absolutePath}.` ); @@ -196320,7 +196410,7 @@ async function run3(actionState) { ); const repositoryProperties = repositoryPropertiesResult.orElse({}); actionState.env.export("CODEQL_ACTION_INIT_HAS_RUN" /* INIT_ACTION_HAS_RUN */, "true"); - sourceRoot = path25.resolve( + sourceRoot = path26.resolve( actionState.env.getRequired("GITHUB_WORKSPACE" /* GITHUB_WORKSPACE */), getOptionalInput("source-root") || "" ); @@ -196538,21 +196628,21 @@ async function run3(actionState) { )) { try { logger2.debug(`Applying static binary workaround for Go`); - const tempBinPath = path25.resolve( + const tempBinPath = path26.resolve( getTemporaryDirectory(), "codeql-action-go-tracing", "bin" ); - fs31.mkdirSync(tempBinPath, { recursive: true }); + fs32.mkdirSync(tempBinPath, { recursive: true }); core19.addPath(tempBinPath); - const goWrapperPath = path25.resolve(tempBinPath, "go"); - fs31.writeFileSync( + const goWrapperPath = path26.resolve(tempBinPath, "go"); + fs32.writeFileSync( goWrapperPath, `#!/bin/bash exec ${goBinaryPath} "$@"` ); - fs31.chmodSync(goWrapperPath, "755"); + fs32.chmodSync(goWrapperPath, "755"); actionState.env.export("CODEQL_ACTION_GO_BINARY" /* GO_BINARY_LOCATION */, goWrapperPath); } catch (e) { logger2.warning( @@ -196735,7 +196825,7 @@ async function runWrapper4() { var core20 = __toESM(require_core()); // src/init-action-post-helper.ts -var fs32 = __toESM(require("fs")); +var fs33 = __toESM(require("fs")); var import_path8 = __toESM(require("path")); var github4 = __toESM(require_github()); function createFailedUploadFailedSarifResult(error3) { @@ -196817,7 +196907,7 @@ async function generateFailedSarif(logger2, features, config, category, checkout let diagnosticDir = getTempDiagnosticsRoot( config.tempDir ); - if (!exportDiagnosticsEnabled || !fs32.existsSync(diagnosticDir)) { + if (!exportDiagnosticsEnabled || !fs33.existsSync(diagnosticDir)) { diagnosticDir = void 0; } await codeql.diagnosticsExport(sarifFile, category, config, diagnosticDir); @@ -196944,7 +197034,7 @@ async function uploadFailureInfo(uploadAllAvailableDebugArtifacts, printDebugLog } if (isSelfHostedRunner() && config.dbLocation) { try { - fs32.rmSync(config.dbLocation, { + fs33.rmSync(config.dbLocation, { recursive: true, force: true, maxRetries: 3 @@ -197472,11 +197562,11 @@ async function runWrapper7() { // src/start-proxy-action.ts var import_child_process2 = require("child_process"); -var path29 = __toESM(require("path")); +var path30 = __toESM(require("path")); var core25 = __toESM(require_core()); // src/start-proxy.ts -var path27 = __toESM(require("path")); +var path28 = __toESM(require("path")); var toolcache4 = __toESM(require_tool_cache()); // src/start-proxy/status-report.ts @@ -197814,7 +197904,7 @@ async function getProxyBinaryPath(action, apiDetails) { logger2.info(`Extracted the authentication proxy to '${proxyDir}'.`); } return { - path: path27.join(proxyDir, proxyFileName), + path: path28.join(proxyDir, proxyFileName), version: proxyInfo.version }; } finally { @@ -197884,8 +197974,8 @@ function generateCertificateAuthority() { } // src/start-proxy/environment.ts -var fs33 = __toESM(require("fs")); -var path28 = __toESM(require("path")); +var fs34 = __toESM(require("fs")); +var path29 = __toESM(require("path")); var toolrunner6 = __toESM(require_toolrunner()); var io9 = __toESM(require_io()); function checkEnvVar(logger2, name) { @@ -197950,16 +198040,16 @@ function discoverActionsJdks() { function checkJdkSettings(logger2, jdkHome) { const filesToCheck = [ // JDK 9+ - path28.join("conf", "net.properties"), + path29.join("conf", "net.properties"), // JDK 8 and below - path28.join("lib", "net.properties") + path29.join("lib", "net.properties") ]; for (const fileToCheck of filesToCheck) { - const file = path28.join(jdkHome, fileToCheck); + const file = path29.join(jdkHome, fileToCheck); try { - if (fs33.existsSync(file)) { + if (fs34.existsSync(file)) { logger2.debug(`Found '${file}'.`); - const lines = String(fs33.readFileSync(file)).split("\n"); + const lines = String(fs34.readFileSync(file)).split("\n"); for (const line of lines) { for (const property of javaProperties) { if (line.startsWith(`${property}=`)) { @@ -198141,7 +198231,7 @@ async function run7(action) { try { persistInputs(); const tempDir = getTemporaryDirectory(); - const proxyLogFilePath = path29.resolve(tempDir, "proxy.log"); + const proxyLogFilePath = path30.resolve(tempDir, "proxy.log"); core25.saveState("proxy-log-file", proxyLogFilePath); const repositoryNwo = getRepositoryNwo(); const gitHubVersion = await getGitHubVersion(); diff --git a/src/config-utils.test.ts b/src/config-utils.test.ts index b66d4a797e..4450a7e5ee 100644 --- a/src/config-utils.test.ts +++ b/src/config-utils.test.ts @@ -958,6 +958,61 @@ const mockRepositoryNwo = parseRepositoryNwo("owner/repo"); }); }); +test.serial( + "getLanguages: skips autodetected languages without source files", + async (t) => { + await withTmpDir(async (tmpDir) => { + const mockRequest = mockLanguagesInRepo(["Go", "Python"]); + const extractorRoot = (language: string, extension: string) => { + const root = path.join(tmpDir, "extractors", language); + fs.mkdirSync(root, { recursive: true }); + fs.writeFileSync( + path.join(root, "codeql-extractor.yml"), + `file_types:\n - name: ${language}\n extensions: [${extension}]\n`, + ); + return root; + }; + const codeQL = createStubCodeQL({ + resolveLanguages: () => + Promise.resolve({ + extractors: { + go: [{ extractor_root: extractorRoot("go", ".go") }], + python: [{ extractor_root: extractorRoot("python", ".py") }], + }, + }), + }); + const sourceRoot = path.join(tmpDir, "source"); + fs.mkdirSync(sourceRoot); + fs.writeFileSync(path.join(sourceRoot, "main.go"), ""); + + // Languages from the API are filtered by the files in the checkout. + t.deepEqual( + await configUtils.getLanguages( + codeQL, + "", + mockRepositoryNwo, + sourceRoot, + mockLogger, + ), + [BuiltInLanguage.go], + ); + t.true(mockRequest.called); + + // Languages from the input are not filtered. + t.deepEqual( + await configUtils.getLanguages( + codeQL, + "go, python", + mockRepositoryNwo, + sourceRoot, + mockLogger, + ), + [BuiltInLanguage.go, BuiltInLanguage.python], + ); + }); + }, +); + for (const { displayName, language, feature } of [ { displayName: "Java", diff --git a/src/config-utils.ts b/src/config-utils.ts index b59149e47f..2ee4371f1d 100644 --- a/src/config-utils.ts +++ b/src/config-utils.ts @@ -66,6 +66,7 @@ import { isAnalyzingDefaultBranch, } from "./git-utils"; import { BuiltInLanguage, Language } from "./languages"; +import { filterLanguagesWithSourceFiles } from "./languages/source-files"; import { Logger } from "./logging"; import { CODEQL_OVERLAY_MINIMUM_VERSION } from "./overlay"; import { @@ -139,10 +140,20 @@ const OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; */ const CODEQL_VERSION_REDUCED_OVERLAY_MEMORY_USAGE = "2.24.3"; +/** + * Resolves the languages that the CodeQL CLI supports. + * + * @returns `languageMap`, which maps each supported language name and alias + * to its canonical language, and `extractorRoots`, which maps each canonical + * language to the root directory of its extractor. + */ async function getSupportedLanguageMap( codeql: CodeQL, logger: Logger, -): Promise> { +): Promise<{ + languageMap: Record; + extractorRoots: Record; +}> { const resolveSupportedLanguagesUsingCli = await codeql.supportsFeature( ToolsFeature.BuiltinExtractorsSpecifyDefaultQueries, ); @@ -155,6 +166,7 @@ async function getSupportedLanguageMap( ); } const supportedLanguages: Record = {}; + const extractorRoots: Record = {}; // Populate canonical language names for (const extractor of Object.keys(resolveResult.extractors)) { // If the CLI supports resolving languages with default queries, use these @@ -165,6 +177,8 @@ async function getSupportedLanguageMap( BuiltInLanguage[extractor] !== undefined ) { supportedLanguages[extractor] = extractor; + extractorRoots[extractor] = + resolveResult.extractors[extractor][0]?.extractor_root; } } // Populate language aliases @@ -173,7 +187,7 @@ async function getSupportedLanguageMap( supportedLanguages[alias] = extractor; } } - return supportedLanguages; + return { languageMap: supportedLanguages, extractorRoots }; } const baseWorkflowsPath = ".github/workflows"; @@ -255,7 +269,10 @@ export async function getLanguages( logger, ); - const languageMap = await getSupportedLanguageMap(codeql, logger); + const { languageMap, extractorRoots } = await getSupportedLanguageMap( + codeql, + logger, + ); const languagesSet = new Set(); const unknownLanguages: string[] = []; @@ -269,7 +286,18 @@ export async function getLanguages( } } - const languages = Array.from(languagesSet); + let languages = Array.from(languagesSet); + + // The languages API can report languages that are no longer in the + // checkout, so only analyze autodetected languages that have source files. + if (autodetected) { + languages = filterLanguagesWithSourceFiles( + languages, + extractorRoots, + sourceRoot, + logger, + ); + } if (!autodetected && unknownLanguages.length > 0) { throw new ConfigurationError( diff --git a/src/languages/source-files.test.ts b/src/languages/source-files.test.ts new file mode 100644 index 0000000000..53048691db --- /dev/null +++ b/src/languages/source-files.test.ts @@ -0,0 +1,129 @@ +import * as fs from "fs"; +import * as path from "path"; + +import test from "ava"; + +import { RecordingLogger, setupTests } from "../testing-utils"; +import { withTmpDir } from "../util"; + +import { + filterLanguagesWithSourceFiles, + findSourceFileExtensions, + getExtractorFileExtensions, +} from "./source-files"; + +setupTests(test); + +function writeExtractor( + extractorRoot: string, + extractorConfig: string, +): string { + fs.mkdirSync(extractorRoot, { recursive: true }); + fs.writeFileSync( + path.join(extractorRoot, "codeql-extractor.yml"), + extractorConfig, + ); + return extractorRoot; +} + +function writeSourceFile(sourceRoot: string, relativePath: string) { + const filePath = path.join(sourceRoot, relativePath); + fs.mkdirSync(path.dirname(filePath), { recursive: true }); + fs.writeFileSync(filePath, ""); +} + +test("getExtractorFileExtensions reads all file type extensions", async (t) => { + await withTmpDir(async (tmpDir) => { + const extractorRoot = writeExtractor( + tmpDir, + [ + "name: ruby", + "file_types:", + " - name: ruby", + " extensions: [.rb]", + " - name: erb", + " extensions: [.ERB]", + ].join("\n"), + ); + t.deepEqual( + getExtractorFileExtensions(extractorRoot, new RecordingLogger(false)), + [".rb", ".erb"], + ); + }); +}); + +test("getExtractorFileExtensions ignores data file types", async (t) => { + await withTmpDir(async (tmpDir) => { + const extractorRoot = writeExtractor( + tmpDir, + [ + "name: javascript", + "file_types:", + " - name: javascript", + " extensions: [.js]", + " - name: data", + " extensions: [.json, .yml]", + ].join("\n"), + ); + t.deepEqual( + getExtractorFileExtensions(extractorRoot, new RecordingLogger(false)), + [".js"], + ); + }); +}); + +test("getExtractorFileExtensions returns undefined without file types", async (t) => { + await withTmpDir(async (tmpDir) => { + const logger = new RecordingLogger(false); + t.is(getExtractorFileExtensions(tmpDir, logger), undefined); + writeExtractor(tmpDir, "name: python"); + t.is(getExtractorFileExtensions(tmpDir, logger), undefined); + }); +}); + +test("findSourceFileExtensions finds nested files and skips .git", async (t) => { + await withTmpDir(async (tmpDir) => { + writeSourceFile(tmpDir, "src/nested/main.PY"); + writeSourceFile(tmpDir, ".git/objects/script.rb"); + t.deepEqual( + findSourceFileExtensions(tmpDir, new Set([".py", ".rb", ".go"])), + new Set([".py"]), + ); + }); +}); + +test("filterLanguagesWithSourceFiles removes languages without source files", async (t) => { + await withTmpDir(async (tmpDir) => { + const extractorsDir = path.join(tmpDir, "extractors"); + const sourceRoot = path.join(tmpDir, "source"); + writeSourceFile(sourceRoot, "main.go"); + const extractorRoots = { + go: writeExtractor( + path.join(extractorsDir, "go"), + "file_types:\n - name: go\n extensions: [.go]\n", + ), + python: writeExtractor( + path.join(extractorsDir, "python"), + "file_types:\n - name: python\n extensions: [.py]\n", + ), + // An extractor without declared file types is always kept. + swift: writeExtractor(path.join(extractorsDir, "swift"), "name: swift"), + }; + const logger = new RecordingLogger(false); + + t.deepEqual( + filterLanguagesWithSourceFiles( + ["go", "python", "swift", "cpp"], + extractorRoots, + sourceRoot, + logger, + ), + ["go", "swift", "cpp"], + ); + t.true( + logger.hasMessage( + "Not analyzing python: the GitHub languages API reported it, but the checkout contains no files with the extensions .py.", + ), + ); + }); +}); diff --git a/src/languages/source-files.ts b/src/languages/source-files.ts new file mode 100644 index 0000000000..0b55b953f7 --- /dev/null +++ b/src/languages/source-files.ts @@ -0,0 +1,145 @@ +import * as fs from "fs"; +import * as path from "path"; + +import * as yaml from "js-yaml"; + +import type { Logger } from "../logging"; + +/** The subset of an extractor's `codeql-extractor.yml` file that we read. */ +interface ExtractorFileTypesConfig { + file_types?: Array<{ name?: string; extensions?: string[] }>; +} + +/** + * The name of the file type that the JavaScript extractor uses for data and + * configuration files, such as `.json` and `.yml` files. CodeQL does not + * count these files as source code, so they alone do not make an analysis + * succeed. + */ +const DATA_FILE_TYPE_NAME = "data"; + +/** + * Reads the source file extensions that an extractor declares in the + * `file_types` section of its `codeql-extractor.yml` file. Ignores the + * extensions of data file types. + * + * @returns The lowercase extensions, or `undefined` if the extractor does not + * declare any or the file cannot be read. + */ +export function getExtractorFileExtensions( + extractorRoot: string, + logger: Logger, +): string[] | undefined { + const extractorConfigPath = path.join(extractorRoot, "codeql-extractor.yml"); + let extractorConfig: ExtractorFileTypesConfig | undefined; + try { + extractorConfig = yaml.load( + fs.readFileSync(extractorConfigPath, "utf8"), + ) as ExtractorFileTypesConfig | undefined; + } catch (e) { + logger.debug( + `Could not read file types from ${extractorConfigPath}: ${String(e)}`, + ); + return undefined; + } + const extensions = (extractorConfig?.file_types ?? []) + .filter((fileType) => fileType.name !== DATA_FILE_TYPE_NAME) + .flatMap((fileType) => fileType.extensions ?? []); + if (extensions.length === 0) { + return undefined; + } + return extensions.map((extension) => extension.toLowerCase()); +} + +/** + * Finds which of the given file extensions occur in a directory tree. Skips + * `.git` directories and does not follow symbolic links. Stops as soon as all + * extensions have been found. + * + * @returns The subset of `extensions` that at least one file has. + */ +export function findSourceFileExtensions( + rootDir: string, + extensions: Set, +): Set { + const found = new Set(); + const pendingDirs = [rootDir]; + while (pendingDirs.length > 0 && found.size < extensions.size) { + const dir = pendingDirs.pop() as string; + let entries: fs.Dirent[]; + try { + entries = fs.readdirSync(dir, { withFileTypes: true }); + } catch { + continue; + } + for (const entry of entries) { + if (entry.isDirectory()) { + if (entry.name !== ".git") { + pendingDirs.push(path.join(dir, entry.name)); + } + } else if (entry.isFile()) { + const extension = path.extname(entry.name).toLowerCase(); + if (extensions.has(extension)) { + found.add(extension); + } + } + } + } + return found; +} + +/** + * Removes autodetected languages that have no source files in the checkout. + * + * The GitHub languages API reports the languages of the default branch, and + * GitHub updates this data in the background. It can therefore report a + * language whose last file was removed, for example by a recent push or by the + * pull request under analysis. Analysis of such a language fails because + * CodeQL sees no source code for it. + * + * A language is kept if its extractor declares no file types, since we then + * cannot tell whether the checkout contains source files for it. + * + * @param extractorRoots A map from each language to its extractor root. + * @returns The languages that have source files in `sourceRoot`. + */ +export function filterLanguagesWithSourceFiles( + languages: string[], + extractorRoots: Record, + sourceRoot: string, + logger: Logger, +): string[] { + const extensionsByLanguage = new Map(); + for (const language of languages) { + const extractorRoot = extractorRoots[language]; + const extensions = + extractorRoot === undefined + ? undefined + : getExtractorFileExtensions(extractorRoot, logger); + if (extensions !== undefined) { + extensionsByLanguage.set(language, extensions); + } + } + if (extensionsByLanguage.size === 0) { + return languages; + } + + const foundExtensions = findSourceFileExtensions( + sourceRoot, + new Set([...extensionsByLanguage.values()].flat()), + ); + + return languages.filter((language) => { + const extensions = extensionsByLanguage.get(language); + if ( + extensions === undefined || + extensions.some((extension) => foundExtensions.has(extension)) + ) { + return true; + } + logger.info( + `Not analyzing ${language}: the GitHub languages API reported it, but the checkout contains no files with the extensions ${extensions.join(", ")}.`, + ); + return false; + }); +} From 5c00421e37e3bbcfe581e1a45b2cb8042f7504f4 Mon Sep 17 00:00:00 2001 From: therealsamyak Date: Thu, 19 Nov 2026 12:22:14 -0800 Subject: [PATCH 2/3] Add change note --- unreleased-change-notes/skip-languages-without-files.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 unreleased-change-notes/skip-languages-without-files.md diff --git a/unreleased-change-notes/skip-languages-without-files.md b/unreleased-change-notes/skip-languages-without-files.md new file mode 100644 index 0000000000..4d04828810 --- /dev/null +++ b/unreleased-change-notes/skip-languages-without-files.md @@ -0,0 +1 @@ +- When the CodeQL Action autodetects languages, it now skips a language that has no source files in the checkout. Previously, the GitHub languages API could report a language whose last file had been removed, and the analysis for that language failed. [#4335](https://github.com/github/codeql-action/pull/4335) From 8bed040f82cd12da641ac3dedee98c72682e0ea5 Mon Sep 17 00:00:00 2001 From: therealsamyak Date: Thu, 19 Nov 2026 12:28:11 -0800 Subject: [PATCH 3/3] Use getErrorMessage for extractor config read errors --- lib/entry-points.js | 2 +- src/languages/source-files.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/entry-points.js b/lib/entry-points.js index 8d02ec2a44..62de66b4c1 100644 --- a/lib/entry-points.js +++ b/lib/entry-points.js @@ -183599,7 +183599,7 @@ function getExtractorFileExtensions(extractorRoot, logger2) { ); } catch (e) { logger2.debug( - `Could not read file types from ${extractorConfigPath}: ${String(e)}` + `Could not read file types from ${extractorConfigPath}: ${getErrorMessage(e)}` ); return void 0; } diff --git a/src/languages/source-files.ts b/src/languages/source-files.ts index 0b55b953f7..732dd9edc2 100644 --- a/src/languages/source-files.ts +++ b/src/languages/source-files.ts @@ -3,6 +3,7 @@ import * as path from "path"; import * as yaml from "js-yaml"; +import { getErrorMessage } from "../errors"; import type { Logger } from "../logging"; /** The subset of an extractor's `codeql-extractor.yml` file that we read. */ @@ -38,7 +39,7 @@ export function getExtractorFileExtensions( ) as ExtractorFileTypesConfig | undefined; } catch (e) { logger.debug( - `Could not read file types from ${extractorConfigPath}: ${String(e)}`, + `Could not read file types from ${extractorConfigPath}: ${getErrorMessage(e)}`, ); return undefined; }