diff --git a/lib/init-action.js b/lib/init-action.js index 32da921aff..2252278982 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -109538,9 +109538,9 @@ exec ${goBinaryPath} "$@"` } } if (await features.getValue("java_network_debugging" /* JavaNetworkDebugging */)) { - const existingJavaToolOptions = getOptionalEnvVar("JAVA_TOOL_OPTIONS") || ""; + const existingJavaToolOptions = getOptionalEnvVar("JAVA_TOOL_OPTIONS" /* JAVA_TOOL_OPTIONS */) || ""; core13.exportVariable( - "JAVA_TOOL_OPTIONS", + "JAVA_TOOL_OPTIONS" /* JAVA_TOOL_OPTIONS */, `${existingJavaToolOptions} -Djavax.net.debug=all` ); } diff --git a/lib/start-proxy-action.js b/lib/start-proxy-action.js index d9fa13d631..451c0fba3d 100644 --- a/lib/start-proxy-action.js +++ b/lib/start-proxy-action.js @@ -204,7 +204,7 @@ var require_file_command = __commonJS({ exports2.issueFileCommand = issueFileCommand; exports2.prepareKeyValueMessage = prepareKeyValueMessage; var crypto2 = __importStar2(require("crypto")); - var fs2 = __importStar2(require("fs")); + var fs3 = __importStar2(require("fs")); var os2 = __importStar2(require("os")); var utils_1 = require_utils(); function issueFileCommand(command, message) { @@ -212,10 +212,10 @@ var require_file_command = __commonJS({ if (!filePath) { throw new Error(`Unable to find environment variable for file command ${command}`); } - if (!fs2.existsSync(filePath)) { + if (!fs3.existsSync(filePath)) { throw new Error(`Missing file at path: ${filePath}`); } - fs2.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os2.EOL}`, { + fs3.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os2.EOL}`, { encoding: "utf8" }); } @@ -1337,14 +1337,14 @@ var require_util = __commonJS({ } const port = url.port != null ? url.port : url.protocol === "https:" ? 443 : 80; let origin = url.origin != null ? url.origin : `${url.protocol || ""}//${url.hostname || ""}:${port}`; - let path4 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`; + let path5 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`; if (origin[origin.length - 1] === "/") { origin = origin.slice(0, origin.length - 1); } - if (path4 && path4[0] !== "/") { - path4 = `/${path4}`; + if (path5 && path5[0] !== "/") { + path5 = `/${path5}`; } - return new URL(`${origin}${path4}`); + return new URL(`${origin}${path5}`); } if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) { throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); @@ -1795,39 +1795,39 @@ var require_diagnostics = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path4, origin } + request: { method, path: path5, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path4); + debuglog("sending request to %s %s/%s", method, origin, path5); }); diagnosticsChannel.channel("undici:request:headers").subscribe((evt) => { const { - request: { method, path: path4, origin }, + request: { method, path: path5, origin }, response: { statusCode } } = evt; debuglog( "received response to %s %s/%s - HTTP %d", method, origin, - path4, + path5, statusCode ); }); diagnosticsChannel.channel("undici:request:trailers").subscribe((evt) => { const { - request: { method, path: path4, origin } + request: { method, path: path5, origin } } = evt; - debuglog("trailers received from %s %s/%s", method, origin, path4); + debuglog("trailers received from %s %s/%s", method, origin, path5); }); diagnosticsChannel.channel("undici:request:error").subscribe((evt) => { const { - request: { method, path: path4, origin }, + request: { method, path: path5, origin }, error: error3 } = evt; debuglog( "request to %s %s/%s errored - %s", method, origin, - path4, + path5, error3.message ); }); @@ -1876,9 +1876,9 @@ var require_diagnostics = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path4, origin } + request: { method, path: path5, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path4); + debuglog("sending request to %s %s/%s", method, origin, path5); }); } diagnosticsChannel.channel("undici:websocket:open").subscribe((evt) => { @@ -1941,7 +1941,7 @@ var require_request = __commonJS({ var kHandler = /* @__PURE__ */ Symbol("handler"); var Request = class { constructor(origin, { - path: path4, + path: path5, method, body, headers, @@ -1956,11 +1956,11 @@ var require_request = __commonJS({ expectContinue, servername }, handler2) { - if (typeof path4 !== "string") { + if (typeof path5 !== "string") { throw new InvalidArgumentError("path must be a string"); - } else if (path4[0] !== "/" && !(path4.startsWith("http://") || path4.startsWith("https://")) && method !== "CONNECT") { + } else if (path5[0] !== "/" && !(path5.startsWith("http://") || path5.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.test(path4)) { + } else if (invalidPathRegex.test(path5)) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { @@ -2023,7 +2023,7 @@ var require_request = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query ? buildURL(path4, query) : path4; + this.path = query ? buildURL(path5, query) : path5; this.origin = origin; this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; this.blocking = blocking == null ? false : blocking; @@ -6536,7 +6536,7 @@ var require_client_h1 = __commonJS({ return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; } function writeH1(client, request3) { - const { method, path: path4, host, upgrade, blocking, reset } = request3; + const { method, path: path5, 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 (util.isFormDataLike(body)) { @@ -6602,7 +6602,7 @@ var require_client_h1 = __commonJS({ if (blocking) { socket[kBlocking] = true; } - let header = `${method} ${path4} HTTP/1.1\r + let header = `${method} ${path5} HTTP/1.1\r `; if (typeof host === "string") { header += `host: ${host}\r @@ -7128,7 +7128,7 @@ var require_client_h2 = __commonJS({ } function writeH2(client, request3) { const session = client[kHTTP2Session]; - const { method, path: path4, host, upgrade, expectContinue, signal, headers: reqHeaders } = request3; + const { method, path: path5, host, upgrade, expectContinue, signal, headers: reqHeaders } = request3; let { body } = request3; if (upgrade) { util.errorRequest(client, request3, new Error("Upgrade not supported for H2")); @@ -7195,7 +7195,7 @@ var require_client_h2 = __commonJS({ }); return true; } - headers[HTTP2_HEADER_PATH] = path4; + headers[HTTP2_HEADER_PATH] = path5; headers[HTTP2_HEADER_SCHEME] = "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { @@ -7548,9 +7548,9 @@ var require_redirect_handler = __commonJS({ return this.handler.onHeaders(statusCode, headers, resume, statusText); } const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); - const path4 = search ? `${pathname}${search}` : pathname; + const path5 = search ? `${pathname}${search}` : pathname; this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path4; + this.opts.path = path5; this.opts.origin = origin; this.opts.maxRedirections = 0; this.opts.query = null; @@ -8784,10 +8784,10 @@ var require_proxy_agent = __commonJS({ }; const { origin, - path: path4 = "/", + path: path5 = "/", headers = {} } = opts; - opts.path = origin + path4; + opts.path = origin + path5; if (!("host" in headers) && !("Host" in headers)) { const { host } = new URL2(origin); headers.host = host; @@ -10708,20 +10708,20 @@ var require_mock_utils = __commonJS({ } return true; } - function safeUrl(path4) { - if (typeof path4 !== "string") { - return path4; + function safeUrl(path5) { + if (typeof path5 !== "string") { + return path5; } - const pathSegments = path4.split("?"); + const pathSegments = path5.split("?"); if (pathSegments.length !== 2) { - return path4; + return path5; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } - function matchKey(mockDispatch2, { path: path4, method, body, headers }) { - const pathMatch = matchValue(mockDispatch2.path, path4); + function matchKey(mockDispatch2, { path: path5, method, body, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path5); const methodMatch = matchValue(mockDispatch2.method, method); const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true; const headersMatch = matchHeaders(mockDispatch2, headers); @@ -10743,7 +10743,7 @@ var require_mock_utils = __commonJS({ function getMockDispatch(mockDispatches, key) { const basePath = key.query ? buildURL(key.path, key.query) : key.path; const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath; - let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path4 }) => matchValue(safeUrl(path4), resolvedPath)); + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path5 }) => matchValue(safeUrl(path5), resolvedPath)); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); } @@ -10781,9 +10781,9 @@ var require_mock_utils = __commonJS({ } } function buildKey(opts) { - const { path: path4, method, body, headers, query } = opts; + const { path: path5, method, body, headers, query } = opts; return { - path: path4, + path: path5, method, body, headers, @@ -11246,10 +11246,10 @@ var require_pending_interceptors_formatter = __commonJS({ } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( - ({ method, path: path4, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + ({ method, path: path5, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, - Path: path4, + Path: path5, "Status code": statusCode, Persistent: persist ? PERSISTENT : NOT_PERSISTENT, Invocations: timesInvoked, @@ -16130,9 +16130,9 @@ var require_util6 = __commonJS({ } } } - function validateCookiePath(path4) { - for (let i = 0; i < path4.length; ++i) { - const code = path4.charCodeAt(i); + function validateCookiePath(path5) { + for (let i = 0; i < path5.length; ++i) { + const code = path5.charCodeAt(i); if (code < 32 || // exclude CTLs (0-31) code === 127 || // DEL code === 59) { @@ -18726,11 +18726,11 @@ var require_undici = __commonJS({ if (typeof opts.path !== "string") { throw new InvalidArgumentError("invalid opts.path"); } - let path4 = opts.path; + let path5 = opts.path; if (!opts.path.startsWith("/")) { - path4 = `/${path4}`; + path5 = `/${path5}`; } - url = new URL(util.parseOrigin(url).origin + path4); + url = new URL(util.parseOrigin(url).origin + path5); } else { if (!opts) { opts = typeof url === "object" ? url : {}; @@ -20033,7 +20033,7 @@ var require_path_utils = __commonJS({ exports2.toPosixPath = toPosixPath; exports2.toWin32Path = toWin32Path; exports2.toPlatformPath = toPlatformPath; - var path4 = __importStar2(require("path")); + var path5 = __importStar2(require("path")); function toPosixPath(pth) { return pth.replace(/[\\]/g, "/"); } @@ -20041,7 +20041,7 @@ var require_path_utils = __commonJS({ return pth.replace(/[/]/g, "\\"); } function toPlatformPath(pth) { - return pth.replace(/[/\\]/g, path4.sep); + return pth.replace(/[/\\]/g, path5.sep); } } }); @@ -20123,13 +20123,13 @@ var require_io_util = __commonJS({ exports2.isRooted = isRooted; exports2.tryGetExecutablePath = tryGetExecutablePath; exports2.getCmdPath = getCmdPath; - var fs2 = __importStar2(require("fs")); - var path4 = __importStar2(require("path")); - _a = fs2.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; + var fs3 = __importStar2(require("fs")); + var path5 = __importStar2(require("path")); + _a = fs3.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; function readlink(fsPath) { return __awaiter2(this, void 0, void 0, function* () { - const result = yield fs2.promises.readlink(fsPath); + const result = yield fs3.promises.readlink(fsPath); if (exports2.IS_WINDOWS && !result.endsWith("\\")) { return `${result}\\`; } @@ -20137,7 +20137,7 @@ var require_io_util = __commonJS({ }); } exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs2.constants.O_RDONLY; + exports2.READONLY = fs3.constants.O_RDONLY; function exists(fsPath) { return __awaiter2(this, void 0, void 0, function* () { try { @@ -20179,7 +20179,7 @@ var require_io_util = __commonJS({ } if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { - const upperExt = path4.extname(filePath).toUpperCase(); + const upperExt = path5.extname(filePath).toUpperCase(); if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { return filePath; } @@ -20203,11 +20203,11 @@ var require_io_util = __commonJS({ if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { try { - const directory = path4.dirname(filePath); - const upperName = path4.basename(filePath).toUpperCase(); + const directory = path5.dirname(filePath); + const upperName = path5.basename(filePath).toUpperCase(); for (const actualName of yield (0, exports2.readdir)(directory)) { if (upperName === actualName.toUpperCase()) { - filePath = path4.join(directory, actualName); + filePath = path5.join(directory, actualName); break; } } @@ -20316,10 +20316,10 @@ var require_io = __commonJS({ exports2.mv = mv; exports2.rmRF = rmRF; exports2.mkdirP = mkdirP; - exports2.which = which4; + exports2.which = which5; exports2.findInPath = findInPath; var assert_1 = require("assert"); - var path4 = __importStar2(require("path")); + var path5 = __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 = {}) { @@ -20328,7 +20328,7 @@ var require_io = __commonJS({ if (destStat && destStat.isFile() && !force) { return; } - const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path4.join(dest, path4.basename(source)) : dest; + const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path5.join(dest, path5.basename(source)) : dest; if (!(yield ioUtil.exists(source))) { throw new Error(`no such file or directory: ${source}`); } @@ -20340,7 +20340,7 @@ var require_io = __commonJS({ yield cpDirRecursive(source, newDest, 0, force); } } else { - if (path4.relative(source, newDest) === "") { + if (path5.relative(source, newDest) === "") { throw new Error(`'${newDest}' and '${source}' are the same file`); } yield copyFile2(source, newDest, force); @@ -20352,7 +20352,7 @@ var require_io = __commonJS({ if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { - dest = path4.join(dest, path4.basename(source)); + dest = path5.join(dest, path5.basename(source)); destExists = yield ioUtil.exists(dest); } if (destExists) { @@ -20363,7 +20363,7 @@ var require_io = __commonJS({ } } } - yield mkdirP(path4.dirname(dest)); + yield mkdirP(path5.dirname(dest)); yield ioUtil.rename(source, dest); }); } @@ -20392,13 +20392,13 @@ var require_io = __commonJS({ yield ioUtil.mkdir(fsPath, { recursive: true }); }); } - function which4(tool, check) { + function which5(tool, check) { return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } if (check) { - const result = yield which4(tool, false); + const result = yield which5(tool, false); if (!result) { if (ioUtil.IS_WINDOWS) { throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`); @@ -20422,7 +20422,7 @@ var require_io = __commonJS({ } const extensions = []; if (ioUtil.IS_WINDOWS && process.env["PATHEXT"]) { - for (const extension of process.env["PATHEXT"].split(path4.delimiter)) { + for (const extension of process.env["PATHEXT"].split(path5.delimiter)) { if (extension) { extensions.push(extension); } @@ -20435,12 +20435,12 @@ var require_io = __commonJS({ } return []; } - if (tool.includes(path4.sep)) { + if (tool.includes(path5.sep)) { return []; } const directories = []; if (process.env.PATH) { - for (const p of process.env.PATH.split(path4.delimiter)) { + for (const p of process.env.PATH.split(path5.delimiter)) { if (p) { directories.push(p); } @@ -20448,7 +20448,7 @@ var require_io = __commonJS({ } const matches = []; for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path4.join(directory, tool), extensions); + const filePath = yield ioUtil.tryGetExecutablePath(path5.join(directory, tool), extensions); if (filePath) { matches.push(filePath); } @@ -20578,12 +20578,12 @@ var require_toolrunner = __commonJS({ var os2 = __importStar2(require("os")); var events = __importStar2(require("events")); var child = __importStar2(require("child_process")); - var path4 = __importStar2(require("path")); - var io4 = __importStar2(require_io()); + var path5 = __importStar2(require("path")); + var io5 = __importStar2(require_io()); var ioUtil = __importStar2(require_io_util()); var timers_1 = require("timers"); var IS_WINDOWS = process.platform === "win32"; - var ToolRunner3 = class extends events.EventEmitter { + var ToolRunner4 = class extends events.EventEmitter { constructor(toolPath, args, options) { super(); if (!toolPath) { @@ -20793,9 +20793,9 @@ 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 = path4.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + this.toolPath = path5.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } - this.toolPath = yield io4.which(this.toolPath, true); + this.toolPath = yield io5.which(this.toolPath, true); return new Promise((resolve2, reject) => __awaiter2(this, void 0, void 0, function* () { this._debug(`exec tool: ${this.toolPath}`); this._debug("arguments:"); @@ -20892,7 +20892,7 @@ var require_toolrunner = __commonJS({ }); } }; - exports2.ToolRunner = ToolRunner3; + exports2.ToolRunner = ToolRunner4; function argStringToArray(argString) { const args = []; let inQuotes = false; @@ -21330,7 +21330,7 @@ var require_core = __commonJS({ exports2.setOutput = setOutput2; exports2.setCommandEcho = setCommandEcho; exports2.setFailed = setFailed3; - exports2.isDebug = isDebug2; + exports2.isDebug = isDebug3; exports2.debug = debug5; exports2.error = error3; exports2.warning = warning7; @@ -21346,7 +21346,7 @@ var require_core = __commonJS({ var file_command_1 = require_file_command(); var utils_1 = require_utils(); var os2 = __importStar2(require("os")); - var path4 = __importStar2(require("path")); + var path5 = __importStar2(require("path")); var oidc_utils_1 = require_oidc_utils(); var ExitCode; (function(ExitCode2) { @@ -21372,7 +21372,7 @@ var require_core = __commonJS({ } else { (0, command_1.issueCommand)("add-path", {}, inputPath); } - process.env["PATH"] = `${inputPath}${path4.delimiter}${process.env["PATH"]}`; + process.env["PATH"] = `${inputPath}${path5.delimiter}${process.env["PATH"]}`; } function getInput2(name, options) { const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; @@ -21417,7 +21417,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); process.exitCode = ExitCode.Failure; error3(message); } - function isDebug2() { + function isDebug3() { return process.env["RUNNER_DEBUG"] === "1"; } function debug5(message) { @@ -21509,8 +21509,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 path4 = process.env.GITHUB_EVENT_PATH; - process.stdout.write(`GITHUB_EVENT_PATH ${path4} does not exist${os_1.EOL}`); + const path5 = process.env.GITHUB_EVENT_PATH; + process.stdout.write(`GITHUB_EVENT_PATH ${path5} does not exist${os_1.EOL}`); } } this.eventName = process.env.GITHUB_EVENT_NAME; @@ -22335,14 +22335,14 @@ var require_util9 = __commonJS({ } const port = url.port != null ? url.port : url.protocol === "https:" ? 443 : 80; let origin = url.origin != null ? url.origin : `${url.protocol || ""}//${url.hostname || ""}:${port}`; - let path4 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`; + let path5 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`; if (origin[origin.length - 1] === "/") { origin = origin.slice(0, origin.length - 1); } - if (path4 && path4[0] !== "/") { - path4 = `/${path4}`; + if (path5 && path5[0] !== "/") { + path5 = `/${path5}`; } - return new URL(`${origin}${path4}`); + return new URL(`${origin}${path5}`); } if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) { throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); @@ -22793,39 +22793,39 @@ var require_diagnostics2 = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path4, origin } + request: { method, path: path5, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path4); + debuglog("sending request to %s %s/%s", method, origin, path5); }); diagnosticsChannel.channel("undici:request:headers").subscribe((evt) => { const { - request: { method, path: path4, origin }, + request: { method, path: path5, origin }, response: { statusCode } } = evt; debuglog( "received response to %s %s/%s - HTTP %d", method, origin, - path4, + path5, statusCode ); }); diagnosticsChannel.channel("undici:request:trailers").subscribe((evt) => { const { - request: { method, path: path4, origin } + request: { method, path: path5, origin } } = evt; - debuglog("trailers received from %s %s/%s", method, origin, path4); + debuglog("trailers received from %s %s/%s", method, origin, path5); }); diagnosticsChannel.channel("undici:request:error").subscribe((evt) => { const { - request: { method, path: path4, origin }, + request: { method, path: path5, origin }, error: error3 } = evt; debuglog( "request to %s %s/%s errored - %s", method, origin, - path4, + path5, error3.message ); }); @@ -22874,9 +22874,9 @@ var require_diagnostics2 = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path4, origin } + request: { method, path: path5, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path4); + debuglog("sending request to %s %s/%s", method, origin, path5); }); } diagnosticsChannel.channel("undici:websocket:open").subscribe((evt) => { @@ -22939,7 +22939,7 @@ var require_request3 = __commonJS({ var kHandler = /* @__PURE__ */ Symbol("handler"); var Request = class { constructor(origin, { - path: path4, + path: path5, method, body, headers, @@ -22954,11 +22954,11 @@ var require_request3 = __commonJS({ expectContinue, servername }, handler2) { - if (typeof path4 !== "string") { + if (typeof path5 !== "string") { throw new InvalidArgumentError("path must be a string"); - } else if (path4[0] !== "/" && !(path4.startsWith("http://") || path4.startsWith("https://")) && method !== "CONNECT") { + } else if (path5[0] !== "/" && !(path5.startsWith("http://") || path5.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.test(path4)) { + } else if (invalidPathRegex.test(path5)) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { @@ -23021,7 +23021,7 @@ var require_request3 = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query ? buildURL(path4, query) : path4; + this.path = query ? buildURL(path5, query) : path5; this.origin = origin; this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; this.blocking = blocking == null ? false : blocking; @@ -27534,7 +27534,7 @@ var require_client_h12 = __commonJS({ return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; } function writeH1(client, request3) { - const { method, path: path4, host, upgrade, blocking, reset } = request3; + const { method, path: path5, 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 (util.isFormDataLike(body)) { @@ -27600,7 +27600,7 @@ var require_client_h12 = __commonJS({ if (blocking) { socket[kBlocking] = true; } - let header = `${method} ${path4} HTTP/1.1\r + let header = `${method} ${path5} HTTP/1.1\r `; if (typeof host === "string") { header += `host: ${host}\r @@ -28126,7 +28126,7 @@ var require_client_h22 = __commonJS({ } function writeH2(client, request3) { const session = client[kHTTP2Session]; - const { method, path: path4, host, upgrade, expectContinue, signal, headers: reqHeaders } = request3; + const { method, path: path5, host, upgrade, expectContinue, signal, headers: reqHeaders } = request3; let { body } = request3; if (upgrade) { util.errorRequest(client, request3, new Error("Upgrade not supported for H2")); @@ -28193,7 +28193,7 @@ var require_client_h22 = __commonJS({ }); return true; } - headers[HTTP2_HEADER_PATH] = path4; + headers[HTTP2_HEADER_PATH] = path5; headers[HTTP2_HEADER_SCHEME] = "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { @@ -28546,9 +28546,9 @@ var require_redirect_handler2 = __commonJS({ return this.handler.onHeaders(statusCode, headers, resume, statusText); } const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); - const path4 = search ? `${pathname}${search}` : pathname; + const path5 = search ? `${pathname}${search}` : pathname; this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path4; + this.opts.path = path5; this.opts.origin = origin; this.opts.maxRedirections = 0; this.opts.query = null; @@ -29782,10 +29782,10 @@ var require_proxy_agent2 = __commonJS({ }; const { origin, - path: path4 = "/", + path: path5 = "/", headers = {} } = opts; - opts.path = origin + path4; + opts.path = origin + path5; if (!("host" in headers) && !("Host" in headers)) { const { host } = new URL2(origin); headers.host = host; @@ -31706,20 +31706,20 @@ var require_mock_utils2 = __commonJS({ } return true; } - function safeUrl(path4) { - if (typeof path4 !== "string") { - return path4; + function safeUrl(path5) { + if (typeof path5 !== "string") { + return path5; } - const pathSegments = path4.split("?"); + const pathSegments = path5.split("?"); if (pathSegments.length !== 2) { - return path4; + return path5; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } - function matchKey(mockDispatch2, { path: path4, method, body, headers }) { - const pathMatch = matchValue(mockDispatch2.path, path4); + function matchKey(mockDispatch2, { path: path5, method, body, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path5); const methodMatch = matchValue(mockDispatch2.method, method); const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true; const headersMatch = matchHeaders(mockDispatch2, headers); @@ -31741,7 +31741,7 @@ var require_mock_utils2 = __commonJS({ function getMockDispatch(mockDispatches, key) { const basePath = key.query ? buildURL(key.path, key.query) : key.path; const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath; - let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path4 }) => matchValue(safeUrl(path4), resolvedPath)); + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path5 }) => matchValue(safeUrl(path5), resolvedPath)); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); } @@ -31779,9 +31779,9 @@ var require_mock_utils2 = __commonJS({ } } function buildKey(opts) { - const { path: path4, method, body, headers, query } = opts; + const { path: path5, method, body, headers, query } = opts; return { - path: path4, + path: path5, method, body, headers, @@ -32244,10 +32244,10 @@ var require_pending_interceptors_formatter2 = __commonJS({ } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( - ({ method, path: path4, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + ({ method, path: path5, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, - Path: path4, + Path: path5, "Status code": statusCode, Persistent: persist ? PERSISTENT : NOT_PERSISTENT, Invocations: timesInvoked, @@ -37128,9 +37128,9 @@ var require_util14 = __commonJS({ } } } - function validateCookiePath(path4) { - for (let i = 0; i < path4.length; ++i) { - const code = path4.charCodeAt(i); + function validateCookiePath(path5) { + for (let i = 0; i < path5.length; ++i) { + const code = path5.charCodeAt(i); if (code < 32 || // exclude CTLs (0-31) code === 127 || // DEL code === 59) { @@ -39724,11 +39724,11 @@ var require_undici2 = __commonJS({ if (typeof opts.path !== "string") { throw new InvalidArgumentError("invalid opts.path"); } - let path4 = opts.path; + let path5 = opts.path; if (!opts.path.startsWith("/")) { - path4 = `/${path4}`; + path5 = `/${path5}`; } - url = new URL(util.parseOrigin(url).origin + path4); + url = new URL(util.parseOrigin(url).origin + path5); } else { if (!opts) { opts = typeof url === "object" ? url : {}; @@ -47539,7 +47539,7 @@ var require_internal_path_helper = __commonJS({ exports2.hasRoot = hasRoot; exports2.normalizeSeparators = normalizeSeparators; exports2.safeTrimTrailingSeparator = safeTrimTrailingSeparator; - var path4 = __importStar2(require("path")); + var path5 = __importStar2(require("path")); var assert_1 = __importDefault2(require("assert")); var IS_WINDOWS = process.platform === "win32"; function dirname(p) { @@ -47547,7 +47547,7 @@ var require_internal_path_helper = __commonJS({ if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { return p; } - let result = path4.dirname(p); + let result = path5.dirname(p); if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { result = safeTrimTrailingSeparator(result); } @@ -47584,7 +47584,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 += path4.sep; + root += path5.sep; } return root + itemPath; } @@ -47618,10 +47618,10 @@ var require_internal_path_helper = __commonJS({ return ""; } p = normalizeSeparators(p); - if (!p.endsWith(path4.sep)) { + if (!p.endsWith(path5.sep)) { return p; } - if (p === path4.sep) { + if (p === path5.sep) { return p; } if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { @@ -47966,7 +47966,7 @@ var require_minimatch = __commonJS({ "node_modules/minimatch/minimatch.js"(exports2, module2) { module2.exports = minimatch; minimatch.Minimatch = Minimatch; - var path4 = (function() { + var path5 = (function() { try { return require("path"); } catch (e) { @@ -47974,7 +47974,7 @@ var require_minimatch = __commonJS({ })() || { sep: "/" }; - minimatch.sep = path4.sep; + minimatch.sep = path5.sep; var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; var expand2 = require_brace_expansion(); var plTypes = { @@ -48063,8 +48063,8 @@ var require_minimatch = __commonJS({ assertValidPattern(pattern); if (!options) options = {}; pattern = pattern.trim(); - if (!options.allowWindowsEscape && path4.sep !== "/") { - pattern = pattern.split(path4.sep).join("/"); + if (!options.allowWindowsEscape && path5.sep !== "/") { + pattern = pattern.split(path5.sep).join("/"); } this.options = options; this.set = []; @@ -48433,8 +48433,8 @@ var require_minimatch = __commonJS({ if (this.empty) return f === ""; if (f === "/" && partial) return true; var options = this.options; - if (path4.sep !== "/") { - f = f.split(path4.sep).join("/"); + if (path5.sep !== "/") { + f = f.split(path5.sep).join("/"); } f = f.split(slashSplit); this.debug(this.pattern, "split", f); @@ -48580,7 +48580,7 @@ var require_internal_path = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Path = void 0; - var path4 = __importStar2(require("path")); + var path5 = __importStar2(require("path")); var pathHelper = __importStar2(require_internal_path_helper()); var assert_1 = __importDefault2(require("assert")); var IS_WINDOWS = process.platform === "win32"; @@ -48595,12 +48595,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(path4.sep); + this.segments = itemPath.split(path5.sep); } else { let remaining = itemPath; let dir = pathHelper.dirname(remaining); while (dir !== remaining) { - const basename = path4.basename(remaining); + const basename = path5.basename(remaining); this.segments.unshift(basename); remaining = dir; dir = pathHelper.dirname(remaining); @@ -48618,7 +48618,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(path4.sep), `Parameter 'itemPath' contains unexpected path separators`); + (0, assert_1.default)(!segment.includes(path5.sep), `Parameter 'itemPath' contains unexpected path separators`); this.segments.push(segment); } } @@ -48629,12 +48629,12 @@ var require_internal_path = __commonJS({ */ toString() { let result = this.segments[0]; - let skipSlash = result.endsWith(path4.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); + let skipSlash = result.endsWith(path5.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); for (let i = 1; i < this.segments.length; i++) { if (skipSlash) { skipSlash = false; } else { - result += path4.sep; + result += path5.sep; } result += this.segments[i]; } @@ -48692,7 +48692,7 @@ var require_internal_pattern = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Pattern = void 0; var os2 = __importStar2(require("os")); - var path4 = __importStar2(require("path")); + var path5 = __importStar2(require("path")); var pathHelper = __importStar2(require_internal_path_helper()); var assert_1 = __importDefault2(require("assert")); var minimatch_1 = require_minimatch(); @@ -48721,7 +48721,7 @@ var require_internal_pattern = __commonJS({ } pattern = _Pattern.fixupPattern(pattern, homedir); this.segments = new internal_path_1.Path(pattern).segments; - this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path4.sep); + this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path5.sep); pattern = pathHelper.safeTrimTrailingSeparator(pattern); let foundGlob = false; const searchSegments = this.segments.map((x) => _Pattern.getLiteral(x)).filter((x) => !foundGlob && !(foundGlob = x === "")); @@ -48745,8 +48745,8 @@ var require_internal_pattern = __commonJS({ match(itemPath) { if (this.segments[this.segments.length - 1] === "**") { itemPath = pathHelper.normalizeSeparators(itemPath); - if (!itemPath.endsWith(path4.sep) && this.isImplicitPattern === false) { - itemPath = `${itemPath}${path4.sep}`; + if (!itemPath.endsWith(path5.sep) && this.isImplicitPattern === false) { + itemPath = `${itemPath}${path5.sep}`; } } else { itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); @@ -48781,9 +48781,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(`.${path4.sep}`)) { + if (pattern === "." || pattern.startsWith(`.${path5.sep}`)) { pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); - } else if (pattern === "~" || pattern.startsWith(`~${path4.sep}`)) { + } else if (pattern === "~" || pattern.startsWith(`~${path5.sep}`)) { homedir = homedir || os2.homedir(); (0, assert_1.default)(homedir, "Unable to determine HOME directory"); (0, assert_1.default)(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); @@ -48867,8 +48867,8 @@ var require_internal_search_state = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.SearchState = void 0; var SearchState = class { - constructor(path4, level) { - this.path = path4; + constructor(path5, level) { + this.path = path5; this.level = level; } }; @@ -49010,9 +49010,9 @@ var require_internal_globber = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.DefaultGlobber = void 0; var core12 = __importStar2(require_core()); - var fs2 = __importStar2(require("fs")); + var fs3 = __importStar2(require("fs")); var globOptionsHelper = __importStar2(require_internal_glob_options_helper()); - var path4 = __importStar2(require("path")); + var path5 = __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(); @@ -49064,7 +49064,7 @@ var require_internal_globber = __commonJS({ for (const searchPath of patternHelper.getSearchPaths(patterns)) { core12.debug(`Search path '${searchPath}'`); try { - yield __await2(fs2.promises.lstat(searchPath)); + yield __await2(fs3.promises.lstat(searchPath)); } catch (err) { if (err.code === "ENOENT") { continue; @@ -49088,7 +49088,7 @@ var require_internal_globber = __commonJS({ if (!stats) { continue; } - if (options.excludeHiddenFiles && path4.basename(item.path).match(/^\./)) { + if (options.excludeHiddenFiles && path5.basename(item.path).match(/^\./)) { continue; } if (stats.isDirectory()) { @@ -49098,7 +49098,7 @@ var require_internal_globber = __commonJS({ continue; } const childLevel = item.level + 1; - const childItems = (yield __await2(fs2.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path4.join(item.path, x), childLevel)); + const childItems = (yield __await2(fs3.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path5.join(item.path, x), childLevel)); stack.push(...childItems.reverse()); } else if (match & internal_match_kind_1.MatchKind.File) { yield yield __await2(item.path); @@ -49133,7 +49133,7 @@ var require_internal_globber = __commonJS({ let stats; if (options.followSymbolicLinks) { try { - stats = yield fs2.promises.stat(item.path); + stats = yield fs3.promises.stat(item.path); } catch (err) { if (err.code === "ENOENT") { if (options.omitBrokenSymbolicLinks) { @@ -49145,10 +49145,10 @@ var require_internal_globber = __commonJS({ throw err; } } else { - stats = yield fs2.promises.lstat(item.path); + stats = yield fs3.promises.lstat(item.path); } if (stats.isDirectory() && options.followSymbolicLinks) { - const realPath = yield fs2.promises.realpath(item.path); + const realPath = yield fs3.promises.realpath(item.path); while (traversalChain.length >= item.level) { traversalChain.pop(); } @@ -49257,10 +49257,10 @@ var require_internal_hash_files = __commonJS({ exports2.hashFiles = hashFiles; var crypto2 = __importStar2(require("crypto")); var core12 = __importStar2(require_core()); - var fs2 = __importStar2(require("fs")); + var fs3 = __importStar2(require("fs")); var stream = __importStar2(require("stream")); var util = __importStar2(require("util")); - var path4 = __importStar2(require("path")); + var path5 = __importStar2(require("path")); function hashFiles(globber_1, currentWorkspace_1) { return __awaiter2(this, arguments, void 0, function* (globber, currentWorkspace, verbose = false) { var _a, e_1, _b, _c; @@ -49276,17 +49276,17 @@ var require_internal_hash_files = __commonJS({ _e = false; const file = _c; writeDelegate(file); - if (!file.startsWith(`${githubWorkspace}${path4.sep}`)) { + if (!file.startsWith(`${githubWorkspace}${path5.sep}`)) { writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); continue; } - if (fs2.statSync(file).isDirectory()) { + if (fs3.statSync(file).isDirectory()) { writeDelegate(`Skip directory '${file}'.`); continue; } const hash = crypto2.createHash("sha256"); const pipeline = util.promisify(stream.pipeline); - yield pipeline(fs2.createReadStream(file), hash); + yield pipeline(fs3.createReadStream(file), hash); result.write(hash.digest()); count++; if (!hasMatch) { @@ -50659,10 +50659,10 @@ var require_cacheUtils = __commonJS({ var core12 = __importStar2(require_core()); var exec3 = __importStar2(require_exec()); var glob = __importStar2(require_glob()); - var io4 = __importStar2(require_io()); + var io5 = __importStar2(require_io()); var crypto2 = __importStar2(require("crypto")); - var fs2 = __importStar2(require("fs")); - var path4 = __importStar2(require("path")); + var fs3 = __importStar2(require("fs")); + var path5 = __importStar2(require("path")); var semver6 = __importStar2(require_semver3()); var util = __importStar2(require("util")); var constants_1 = require_constants12(); @@ -50682,15 +50682,15 @@ var require_cacheUtils = __commonJS({ baseLocation = "/home"; } } - tempDirectory = path4.join(baseLocation, "actions", "temp"); + tempDirectory = path5.join(baseLocation, "actions", "temp"); } - const dest = path4.join(tempDirectory, crypto2.randomUUID()); - yield io4.mkdirP(dest); + const dest = path5.join(tempDirectory, crypto2.randomUUID()); + yield io5.mkdirP(dest); return dest; }); } function getArchiveFileSizeInBytes(filePath) { - return fs2.statSync(filePath).size; + return fs3.statSync(filePath).size; } function resolvePaths(patterns) { return __awaiter2(this, void 0, void 0, function* () { @@ -50706,7 +50706,7 @@ var require_cacheUtils = __commonJS({ _c = _g.value; _e = false; const file = _c; - const relativeFile = path4.relative(workspace, file).replace(new RegExp(`\\${path4.sep}`, "g"), "/"); + const relativeFile = path5.relative(workspace, file).replace(new RegExp(`\\${path5.sep}`, "g"), "/"); core12.debug(`Matched: ${relativeFile}`); if (relativeFile === "") { paths.push("."); @@ -50728,7 +50728,7 @@ var require_cacheUtils = __commonJS({ } function unlinkFile(filePath) { return __awaiter2(this, void 0, void 0, function* () { - return util.promisify(fs2.unlink)(filePath); + return util.promisify(fs3.unlink)(filePath); }); } function getVersion(app_1) { @@ -50770,11 +50770,11 @@ var require_cacheUtils = __commonJS({ } function getGnuTarPathOnWindows() { return __awaiter2(this, void 0, void 0, function* () { - if (fs2.existsSync(constants_1.GnuTarPathOnWindows)) { + if (fs3.existsSync(constants_1.GnuTarPathOnWindows)) { return constants_1.GnuTarPathOnWindows; } const versionOutput = yield getVersion("tar"); - return versionOutput.toLowerCase().includes("gnu tar") ? io4.which("tar") : ""; + return versionOutput.toLowerCase().includes("gnu tar") ? io5.which("tar") : ""; }); } function assertDefined(name, value) { @@ -51233,13 +51233,13 @@ function __disposeResources(env) { } return next(); } -function __rewriteRelativeImportExtension(path4, preserveJsx) { - if (typeof path4 === "string" && /^\.\.?\//.test(path4)) { - return path4.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { +function __rewriteRelativeImportExtension(path5, preserveJsx) { + if (typeof path5 === "string" && /^\.\.?\//.test(path5)) { + return path5.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; }); } - return path4; + return path5; } var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default; var init_tslib_es6 = __esm({ @@ -55653,8 +55653,8 @@ var require_getClient = __commonJS({ } const { allowInsecureConnection, httpClient } = clientOptions; const endpointUrl = clientOptions.endpoint ?? endpoint2; - const client = (path4, ...args) => { - const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path4, args, { allowInsecureConnection, ...requestOptions }); + const client = (path5, ...args) => { + const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path5, args, { allowInsecureConnection, ...requestOptions }); return { get: (requestOptions = {}) => { return buildOperation("GET", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); @@ -59525,15 +59525,15 @@ var require_urlHelpers2 = __commonJS({ let isAbsolutePath = false; let requestUrl = replaceAll(baseUri, urlReplacements); if (operationSpec.path) { - let path4 = replaceAll(operationSpec.path, urlReplacements); - if (operationSpec.path === "/{nextLink}" && path4.startsWith("/")) { - path4 = path4.substring(1); + let path5 = replaceAll(operationSpec.path, urlReplacements); + if (operationSpec.path === "/{nextLink}" && path5.startsWith("/")) { + path5 = path5.substring(1); } - if (isAbsoluteUrl(path4)) { - requestUrl = path4; + if (isAbsoluteUrl(path5)) { + requestUrl = path5; isAbsolutePath = true; } else { - requestUrl = appendPath(requestUrl, path4); + requestUrl = appendPath(requestUrl, path5); } } const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject); @@ -59579,9 +59579,9 @@ var require_urlHelpers2 = __commonJS({ } const searchStart = pathToAppend.indexOf("?"); if (searchStart !== -1) { - const path4 = pathToAppend.substring(0, searchStart); + const path5 = pathToAppend.substring(0, searchStart); const search = pathToAppend.substring(searchStart + 1); - newPath = newPath + path4; + newPath = newPath + path5; if (search) { parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search; } @@ -61814,10 +61814,10 @@ var require_utils_common = __commonJS({ var constants_js_1 = require_constants15(); function escapeURLPath(url) { const urlParsed = new URL(url); - let path4 = urlParsed.pathname; - path4 = path4 || "/"; - path4 = escape2(path4); - urlParsed.pathname = path4; + let path5 = urlParsed.pathname; + path5 = path5 || "/"; + path5 = escape2(path5); + urlParsed.pathname = path5; return urlParsed.toString(); } function getProxyUriFromDevConnString(connectionString) { @@ -61902,9 +61902,9 @@ var require_utils_common = __commonJS({ } function appendToURLPath(url, name) { const urlParsed = new URL(url); - let path4 = urlParsed.pathname; - path4 = path4 ? path4.endsWith("/") ? `${path4}${name}` : `${path4}/${name}` : name; - urlParsed.pathname = path4; + let path5 = urlParsed.pathname; + path5 = path5 ? path5.endsWith("/") ? `${path5}${name}` : `${path5}/${name}` : name; + urlParsed.pathname = path5; return urlParsed.toString(); } function setURLParameter(url, name, value) { @@ -63131,9 +63131,9 @@ var require_StorageSharedKeyCredentialPolicy = __commonJS({ * @param request - */ getCanonicalizedResourceString(request3) { - const path4 = (0, utils_common_js_1.getURLPath)(request3.url) || "/"; + const path5 = (0, utils_common_js_1.getURLPath)(request3.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path4}`; + canonicalizedResourceString += `/${this.factory.accountName}${path5}`; const queries = (0, utils_common_js_1.getURLQueries)(request3.url); const lowercaseQueries = {}; if (queries) { @@ -63872,10 +63872,10 @@ var require_utils_common2 = __commonJS({ var constants_js_1 = require_constants16(); function escapeURLPath(url) { const urlParsed = new URL(url); - let path4 = urlParsed.pathname; - path4 = path4 || "/"; - path4 = escape2(path4); - urlParsed.pathname = path4; + let path5 = urlParsed.pathname; + path5 = path5 || "/"; + path5 = escape2(path5); + urlParsed.pathname = path5; return urlParsed.toString(); } function getProxyUriFromDevConnString(connectionString) { @@ -63960,9 +63960,9 @@ var require_utils_common2 = __commonJS({ } function appendToURLPath(url, name) { const urlParsed = new URL(url); - let path4 = urlParsed.pathname; - path4 = path4 ? path4.endsWith("/") ? `${path4}${name}` : `${path4}/${name}` : name; - urlParsed.pathname = path4; + let path5 = urlParsed.pathname; + path5 = path5 ? path5.endsWith("/") ? `${path5}${name}` : `${path5}/${name}` : name; + urlParsed.pathname = path5; return urlParsed.toString(); } function setURLParameter(url, name, value) { @@ -64883,9 +64883,9 @@ var require_StorageSharedKeyCredentialPolicy2 = __commonJS({ * @param request - */ getCanonicalizedResourceString(request3) { - const path4 = (0, utils_common_js_1.getURLPath)(request3.url) || "/"; + const path5 = (0, utils_common_js_1.getURLPath)(request3.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path4}`; + canonicalizedResourceString += `/${this.factory.accountName}${path5}`; const queries = (0, utils_common_js_1.getURLQueries)(request3.url); const lowercaseQueries = {}; if (queries) { @@ -65515,9 +65515,9 @@ var require_StorageSharedKeyCredentialPolicyV2 = __commonJS({ return canonicalizedHeadersStringToSign; } function getCanonicalizedResourceString(request3) { - const path4 = (0, utils_common_js_1.getURLPath)(request3.url) || "/"; + const path5 = (0, utils_common_js_1.getURLPath)(request3.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${options.accountName}${path4}`; + canonicalizedResourceString += `/${options.accountName}${path5}`; const queries = (0, utils_common_js_1.getURLQueries)(request3.url); const lowercaseQueries = {}; if (queries) { @@ -65862,9 +65862,9 @@ var require_StorageSharedKeyCredentialPolicyV22 = __commonJS({ return canonicalizedHeadersStringToSign; } function getCanonicalizedResourceString(request3) { - const path4 = (0, utils_common_js_1.getURLPath)(request3.url) || "/"; + const path5 = (0, utils_common_js_1.getURLPath)(request3.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${options.accountName}${path4}`; + canonicalizedResourceString += `/${options.accountName}${path5}`; const queries = (0, utils_common_js_1.getURLQueries)(request3.url); const lowercaseQueries = {}; if (queries) { @@ -87519,8 +87519,8 @@ var require_BlobBatch = __commonJS({ if (this.operationCount >= constants_js_1.BATCH_MAX_REQUEST) { throw new RangeError(`Cannot exceed ${constants_js_1.BATCH_MAX_REQUEST} sub requests in a single batch`); } - const path4 = (0, utils_common_js_1.getURLPath)(subRequest.url); - if (!path4 || path4 === "") { + const path5 = (0, utils_common_js_1.getURLPath)(subRequest.url); + if (!path5 || path5 === "") { throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`); } } @@ -87598,8 +87598,8 @@ var require_BlobBatchClient = __commonJS({ pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); } const storageClientContext = new StorageContextClient_js_1.StorageContextClient(url, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); - const path4 = (0, utils_common_js_1.getURLPath)(url); - if (path4 && path4 !== "/") { + const path5 = (0, utils_common_js_1.getURLPath)(url); + if (path5 && path5 !== "/") { this.serviceOrContainerContext = storageClientContext.container; } else { this.serviceOrContainerContext = storageClientContext.service; @@ -90886,7 +90886,7 @@ var require_downloadUtils = __commonJS({ var http_client_1 = require_lib(); var storage_blob_1 = require_commonjs15(); var buffer = __importStar2(require("buffer")); - var fs2 = __importStar2(require("fs")); + var fs3 = __importStar2(require("fs")); var stream = __importStar2(require("stream")); var util = __importStar2(require("util")); var utils = __importStar2(require_cacheUtils()); @@ -90997,7 +90997,7 @@ var require_downloadUtils = __commonJS({ exports2.DownloadProgress = DownloadProgress; function downloadCacheHttpClient(archiveLocation, archivePath) { return __awaiter2(this, void 0, void 0, function* () { - const writeStream = fs2.createWriteStream(archivePath); + const writeStream = fs3.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); @@ -91022,7 +91022,7 @@ var require_downloadUtils = __commonJS({ function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options) { return __awaiter2(this, void 0, void 0, function* () { var _a; - const archiveDescriptor = yield fs2.promises.open(archivePath, "w"); + const archiveDescriptor = yield fs3.promises.open(archivePath, "w"); const httpClient = new http_client_1.HttpClient("actions/cache", void 0, { socketTimeout: options.timeoutInMs, keepAlive: true @@ -91138,7 +91138,7 @@ var require_downloadUtils = __commonJS({ } else { const maxSegmentSize = Math.min(134217728, buffer.constants.MAX_LENGTH); const downloadProgress = new DownloadProgress(contentLength); - const fd = fs2.openSync(archivePath, "w"); + const fd = fs3.openSync(archivePath, "w"); try { downloadProgress.startDisplayTimer(); const controller = new abort_controller_1.AbortController(); @@ -91156,12 +91156,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)) { - fs2.writeFileSync(fd, result); + fs3.writeFileSync(fd, result); } } } finally { downloadProgress.stopDisplayTimer(); - fs2.closeSync(fd); + fs3.closeSync(fd); } } }); @@ -91483,7 +91483,7 @@ var require_cacheHttpClient = __commonJS({ var core12 = __importStar2(require_core()); var http_client_1 = require_lib(); var auth_1 = require_auth(); - var fs2 = __importStar2(require("fs")); + var fs3 = __importStar2(require("fs")); var url_1 = require("url"); var utils = __importStar2(require_cacheUtils()); var uploadUtils_1 = require_uploadUtils(); @@ -91618,7 +91618,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 = fs2.openSync(archivePath, "r"); + const fd = fs3.openSync(archivePath, "r"); const uploadOptions = (0, options_1.getUploadOptions)(options); const concurrency = utils.assertDefined("uploadConcurrency", uploadOptions.uploadConcurrency); const maxChunkSize = utils.assertDefined("uploadChunkSize", uploadOptions.uploadChunkSize); @@ -91632,7 +91632,7 @@ Other caches with similar key:`); const start = offset; const end = offset + chunkSize - 1; offset += maxChunkSize; - yield uploadChunk(httpClient, resourceUrl, () => fs2.createReadStream(archivePath, { + yield uploadChunk(httpClient, resourceUrl, () => fs3.createReadStream(archivePath, { fd, start, end, @@ -91643,7 +91643,7 @@ Other caches with similar key:`); } }))); } finally { - fs2.closeSync(fd); + fs3.closeSync(fd); } return; }); @@ -96906,9 +96906,9 @@ var require_tar = __commonJS({ exports2.extractTar = extractTar2; exports2.createTar = createTar; var exec_1 = require_exec(); - var io4 = __importStar2(require_io()); + var io5 = __importStar2(require_io()); var fs_1 = require("fs"); - var path4 = __importStar2(require("path")); + var path5 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); var constants_1 = require_constants12(); var IS_WINDOWS = process.platform === "win32"; @@ -96926,12 +96926,12 @@ var require_tar = __commonJS({ break; } case "darwin": { - const gnuTar = yield io4.which("gtar", false); + const gnuTar = yield io5.which("gtar", false); if (gnuTar) { return { path: gnuTar, type: constants_1.ArchiveToolType.GNU }; } else { return { - path: yield io4.which("tar", true), + path: yield io5.which("tar", true), type: constants_1.ArchiveToolType.BSD }; } @@ -96940,7 +96940,7 @@ var require_tar = __commonJS({ break; } return { - path: yield io4.which("tar", true), + path: yield io5.which("tar", true), type: constants_1.ArchiveToolType.GNU }; }); @@ -96954,13 +96954,13 @@ var require_tar = __commonJS({ const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD && compressionMethod !== constants_1.CompressionMethod.Gzip && IS_WINDOWS; switch (type2) { case "create": - args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path4.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path4.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path4.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); + args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path5.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path5.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path5.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); break; case "extract": - args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path4.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path4.sep}`, "g"), "/")); + args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path5.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path5.sep}`, "g"), "/")); break; case "list": - args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path4.sep}`, "g"), "/"), "-P"); + args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path5.sep}`, "g"), "/"), "-P"); break; } if (tarPath.type === constants_1.ArchiveToolType.GNU) { @@ -97006,7 +97006,7 @@ var require_tar = __commonJS({ return BSD_TAR_ZSTD ? [ "zstd -d --long=30 --force -o", constants_1.TarFilename, - archivePath.replace(new RegExp(`\\${path4.sep}`, "g"), "/") + archivePath.replace(new RegExp(`\\${path5.sep}`, "g"), "/") ] : [ "--use-compress-program", IS_WINDOWS ? '"zstd -d --long=30"' : "unzstd --long=30" @@ -97015,7 +97015,7 @@ var require_tar = __commonJS({ return BSD_TAR_ZSTD ? [ "zstd -d --force -o", constants_1.TarFilename, - archivePath.replace(new RegExp(`\\${path4.sep}`, "g"), "/") + archivePath.replace(new RegExp(`\\${path5.sep}`, "g"), "/") ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -d"' : "unzstd"]; default: return ["-z"]; @@ -97030,7 +97030,7 @@ var require_tar = __commonJS({ case constants_1.CompressionMethod.Zstd: return BSD_TAR_ZSTD ? [ "zstd -T0 --long=30 --force -o", - cacheFileName.replace(new RegExp(`\\${path4.sep}`, "g"), "/"), + cacheFileName.replace(new RegExp(`\\${path5.sep}`, "g"), "/"), constants_1.TarFilename ] : [ "--use-compress-program", @@ -97039,7 +97039,7 @@ var require_tar = __commonJS({ case constants_1.CompressionMethod.ZstdWithoutLong: return BSD_TAR_ZSTD ? [ "zstd -T0 --force -o", - cacheFileName.replace(new RegExp(`\\${path4.sep}`, "g"), "/"), + cacheFileName.replace(new RegExp(`\\${path5.sep}`, "g"), "/"), constants_1.TarFilename ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -T0"' : "zstdmt"]; default: @@ -97070,14 +97070,14 @@ var require_tar = __commonJS({ function extractTar2(archivePath, compressionMethod) { return __awaiter2(this, void 0, void 0, function* () { const workingDirectory = getWorkingDirectory(); - yield io4.mkdirP(workingDirectory); + yield io5.mkdirP(workingDirectory); const commands = yield getCommands(compressionMethod, "extract", archivePath); yield execCommands(commands); }); } function createTar(archiveFolder, sourceDirectories, compressionMethod) { return __awaiter2(this, void 0, void 0, function* () { - (0, fs_1.writeFileSync)(path4.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); + (0, fs_1.writeFileSync)(path5.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); const commands = yield getCommands(compressionMethod, "create"); yield execCommands(commands, archiveFolder); }); @@ -97159,7 +97159,7 @@ var require_cache5 = __commonJS({ exports2.restoreCache = restoreCache3; exports2.saveCache = saveCache3; var core12 = __importStar2(require_core()); - var path4 = __importStar2(require("path")); + var path5 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); var cacheHttpClient = __importStar2(require_cacheHttpClient()); var cacheTwirpClient = __importStar2(require_cacheTwirpClient()); @@ -97254,7 +97254,7 @@ var require_cache5 = __commonJS({ core12.info("Lookup only - skipping download"); return cacheEntry.cacheKey; } - archivePath = path4.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + archivePath = path5.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); core12.debug(`Archive Path: ${archivePath}`); yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); if (core12.isDebug()) { @@ -97323,7 +97323,7 @@ var require_cache5 = __commonJS({ core12.info("Lookup only - skipping download"); return response.matchedKey; } - archivePath = path4.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + archivePath = path5.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); core12.debug(`Archive path: ${archivePath}`); core12.debug(`Starting download of archive to: ${archivePath}`); yield cacheHttpClient.downloadCache(response.signedDownloadUrl, archivePath, options); @@ -97385,7 +97385,7 @@ var require_cache5 = __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 = path4.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + const archivePath = path5.join(archiveFolder, utils.getCacheFileName(compressionMethod)); core12.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); @@ -97449,7 +97449,7 @@ var require_cache5 = __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 = path4.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + const archivePath = path5.join(archiveFolder, utils.getCacheFileName(compressionMethod)); core12.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); @@ -97599,7 +97599,7 @@ var require_manifest = __commonJS({ var core_1 = require_core(); var os2 = require("os"); var cp = require("child_process"); - var fs2 = require("fs"); + var fs3 = require("fs"); function _findMatch(versionSpec, stable, candidates, archFilter) { return __awaiter2(this, void 0, void 0, function* () { const platFilter = os2.platform(); @@ -97661,10 +97661,10 @@ var require_manifest = __commonJS({ const lsbReleaseFile = "/etc/lsb-release"; const osReleaseFile = "/etc/os-release"; let contents = ""; - if (fs2.existsSync(lsbReleaseFile)) { - contents = fs2.readFileSync(lsbReleaseFile).toString(); - } else if (fs2.existsSync(osReleaseFile)) { - contents = fs2.readFileSync(osReleaseFile).toString(); + if (fs3.existsSync(lsbReleaseFile)) { + contents = fs3.readFileSync(lsbReleaseFile).toString(); + } else if (fs3.existsSync(osReleaseFile)) { + contents = fs3.readFileSync(osReleaseFile).toString(); } return contents; } @@ -97871,12 +97871,12 @@ var require_tool_cache = __commonJS({ exports2.isExplicitVersion = isExplicitVersion; exports2.evaluateVersions = evaluateVersions; var core12 = __importStar2(require_core()); - var io4 = __importStar2(require_io()); + var io5 = __importStar2(require_io()); var crypto2 = __importStar2(require("crypto")); - var fs2 = __importStar2(require("fs")); + var fs3 = __importStar2(require("fs")); var mm = __importStar2(require_manifest()); var os2 = __importStar2(require("os")); - var path4 = __importStar2(require("path")); + var path5 = __importStar2(require("path")); var httpm = __importStar2(require_lib()); var semver6 = __importStar2(require_semver2()); var stream = __importStar2(require("stream")); @@ -97897,8 +97897,8 @@ var require_tool_cache = __commonJS({ var userAgent2 = "actions/tool-cache"; function downloadTool2(url, dest, auth2, headers) { return __awaiter2(this, void 0, void 0, function* () { - dest = dest || path4.join(_getTempDirectory(), crypto2.randomUUID()); - yield io4.mkdirP(path4.dirname(dest)); + dest = dest || path5.join(_getTempDirectory(), crypto2.randomUUID()); + yield io5.mkdirP(path5.dirname(dest)); core12.debug(`Downloading ${url}`); core12.debug(`Destination ${dest}`); const maxAttempts = 3; @@ -97919,7 +97919,7 @@ var require_tool_cache = __commonJS({ } function downloadToolAttempt(url, dest, auth2, headers) { return __awaiter2(this, void 0, void 0, function* () { - if (fs2.existsSync(dest)) { + if (fs3.existsSync(dest)) { throw new Error(`Destination file path ${dest} already exists`); } const http = new httpm.HttpClient(userAgent2, [], { @@ -97943,7 +97943,7 @@ var require_tool_cache = __commonJS({ const readStream = responseMessageFactory(); let succeeded = false; try { - yield pipeline(readStream, fs2.createWriteStream(dest)); + yield pipeline(readStream, fs3.createWriteStream(dest)); core12.debug("download complete"); succeeded = true; return dest; @@ -97951,7 +97951,7 @@ var require_tool_cache = __commonJS({ if (!succeeded) { core12.debug("download failed"); try { - yield io4.rmRF(dest); + yield io5.rmRF(dest); } catch (err) { core12.debug(`Failed to delete '${dest}'. ${err.message}`); } @@ -97988,7 +97988,7 @@ var require_tool_cache = __commonJS({ process.chdir(originalCwd); } } else { - const escapedScript = path4.join(__dirname, "..", "scripts", "Invoke-7zdec.ps1").replace(/'/g, "''").replace(/"|\n|\r/g, ""); + const escapedScript = path5.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}'`; @@ -98006,7 +98006,7 @@ var require_tool_cache = __commonJS({ silent: true }; try { - const powershellPath = yield io4.which("powershell", true); + const powershellPath = yield io5.which("powershell", true); yield (0, exec_1.exec)(`"${powershellPath}"`, args, options); } finally { process.chdir(originalCwd); @@ -98073,7 +98073,7 @@ var require_tool_cache = __commonJS({ if (core12.isDebug()) { args.push("-v"); } - const xarPath = yield io4.which("xar", true); + const xarPath = yield io5.which("xar", true); yield (0, exec_1.exec)(`"${xarPath}"`, _unique(args)); return dest; }); @@ -98096,7 +98096,7 @@ var require_tool_cache = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ""); const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, ""); - const pwshPath = yield io4.which("pwsh", false); + const pwshPath = yield io5.which("pwsh", false); if (pwshPath) { const pwshCommand = [ `$ErrorActionPreference = 'Stop' ;`, @@ -98132,7 +98132,7 @@ var require_tool_cache = __commonJS({ "-Command", powershellCommand ]; - const powershellPath = yield io4.which("powershell", true); + const powershellPath = yield io5.which("powershell", true); core12.debug(`Using powershell at path: ${powershellPath}`); yield (0, exec_1.exec)(`"${powershellPath}"`, args); } @@ -98140,7 +98140,7 @@ var require_tool_cache = __commonJS({ } function extractZipNix(file, dest) { return __awaiter2(this, void 0, void 0, function* () { - const unzipPath = yield io4.which("unzip", true); + const unzipPath = yield io5.which("unzip", true); const args = [file]; if (!core12.isDebug()) { args.unshift("-q"); @@ -98155,13 +98155,13 @@ var require_tool_cache = __commonJS({ arch = arch || os2.arch(); core12.debug(`Caching tool ${tool} ${version} ${arch}`); core12.debug(`source dir: ${sourceDir}`); - if (!fs2.statSync(sourceDir).isDirectory()) { + if (!fs3.statSync(sourceDir).isDirectory()) { throw new Error("sourceDir is not a directory"); } const destPath = yield _createToolPath(tool, version, arch); - for (const itemName of fs2.readdirSync(sourceDir)) { - const s = path4.join(sourceDir, itemName); - yield io4.cp(s, destPath, { recursive: true }); + for (const itemName of fs3.readdirSync(sourceDir)) { + const s = path5.join(sourceDir, itemName); + yield io5.cp(s, destPath, { recursive: true }); } _completeToolPath(tool, version, arch); return destPath; @@ -98173,13 +98173,13 @@ var require_tool_cache = __commonJS({ arch = arch || os2.arch(); core12.debug(`Caching tool ${tool} ${version} ${arch}`); core12.debug(`source file: ${sourceFile}`); - if (!fs2.statSync(sourceFile).isFile()) { + if (!fs3.statSync(sourceFile).isFile()) { throw new Error("sourceFile is not a file"); } const destFolder = yield _createToolPath(tool, version, arch); - const destPath = path4.join(destFolder, targetFile); + const destPath = path5.join(destFolder, targetFile); core12.debug(`destination file ${destPath}`); - yield io4.cp(sourceFile, destPath); + yield io5.cp(sourceFile, destPath); _completeToolPath(tool, version, arch); return destFolder; }); @@ -98200,9 +98200,9 @@ var require_tool_cache = __commonJS({ let toolPath = ""; if (versionSpec) { versionSpec = semver6.clean(versionSpec) || ""; - const cachePath = path4.join(_getCacheDirectory(), toolName, versionSpec, arch); + const cachePath = path5.join(_getCacheDirectory(), toolName, versionSpec, arch); core12.debug(`checking cache: ${cachePath}`); - if (fs2.existsSync(cachePath) && fs2.existsSync(`${cachePath}.complete`)) { + if (fs3.existsSync(cachePath) && fs3.existsSync(`${cachePath}.complete`)) { core12.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`); toolPath = cachePath; } else { @@ -98214,13 +98214,13 @@ var require_tool_cache = __commonJS({ function findAllVersions(toolName, arch) { const versions = []; arch = arch || os2.arch(); - const toolPath = path4.join(_getCacheDirectory(), toolName); - if (fs2.existsSync(toolPath)) { - const children = fs2.readdirSync(toolPath); + const toolPath = path5.join(_getCacheDirectory(), toolName); + if (fs3.existsSync(toolPath)) { + const children = fs3.readdirSync(toolPath); for (const child of children) { if (isExplicitVersion(child)) { - const fullPath = path4.join(toolPath, child, arch || ""); - if (fs2.existsSync(fullPath) && fs2.existsSync(`${fullPath}.complete`)) { + const fullPath = path5.join(toolPath, child, arch || ""); + if (fs3.existsSync(fullPath) && fs3.existsSync(`${fullPath}.complete`)) { versions.push(child); } } @@ -98271,27 +98271,27 @@ var require_tool_cache = __commonJS({ function _createExtractFolder(dest) { return __awaiter2(this, void 0, void 0, function* () { if (!dest) { - dest = path4.join(_getTempDirectory(), crypto2.randomUUID()); + dest = path5.join(_getTempDirectory(), crypto2.randomUUID()); } - yield io4.mkdirP(dest); + yield io5.mkdirP(dest); return dest; }); } function _createToolPath(tool, version, arch) { return __awaiter2(this, void 0, void 0, function* () { - const folderPath = path4.join(_getCacheDirectory(), tool, semver6.clean(version) || version, arch || ""); + const folderPath = path5.join(_getCacheDirectory(), tool, semver6.clean(version) || version, arch || ""); core12.debug(`destination ${folderPath}`); const markerPath = `${folderPath}.complete`; - yield io4.rmRF(folderPath); - yield io4.rmRF(markerPath); - yield io4.mkdirP(folderPath); + yield io5.rmRF(folderPath); + yield io5.rmRF(markerPath); + yield io5.mkdirP(folderPath); return folderPath; }); } function _completeToolPath(tool, version, arch) { - const folderPath = path4.join(_getCacheDirectory(), tool, semver6.clean(version) || version, arch || ""); + const folderPath = path5.join(_getCacheDirectory(), tool, semver6.clean(version) || version, arch || ""); const markerPath = `${folderPath}.complete`; - fs2.writeFileSync(markerPath, ""); + fs3.writeFileSync(markerPath, ""); core12.debug("finished caching tool"); } function isExplicitVersion(versionSpec) { @@ -98350,14 +98350,14 @@ var require_helpers3 = __commonJS({ "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { "use strict"; var uri = require("url"); - var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path4, name, argument) { - if (Array.isArray(path4)) { - this.path = path4; - this.property = path4.reduce(function(sum, item) { + var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path5, name, argument) { + if (Array.isArray(path5)) { + this.path = path5; + this.property = path5.reduce(function(sum, item) { return sum + makeSuffix(item); }, "instance"); - } else if (path4 !== void 0) { - this.property = path4; + } else if (path5 !== void 0) { + this.property = path5; } if (message) { this.message = message; @@ -98448,16 +98448,16 @@ var require_helpers3 = __commonJS({ name: { value: "SchemaError", enumerable: false } } ); - var SchemaContext = exports2.SchemaContext = function SchemaContext2(schema2, options, path4, base, schemas) { + var SchemaContext = exports2.SchemaContext = function SchemaContext2(schema2, options, path5, base, schemas) { this.schema = schema2; this.options = options; - if (Array.isArray(path4)) { - this.path = path4; - this.propertyPath = path4.reduce(function(sum, item) { + if (Array.isArray(path5)) { + this.path = path5; + this.propertyPath = path5.reduce(function(sum, item) { return sum + makeSuffix(item); }, "instance"); } else { - this.propertyPath = path4; + this.propertyPath = path5; } this.base = base; this.schemas = schemas; @@ -98466,10 +98466,10 @@ var require_helpers3 = __commonJS({ return uri.resolve(this.base, target); }; SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { - var path4 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); + var path5 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); var id = schema2.$id || schema2.id; var base = uri.resolve(this.base, id || ""); - var ctx = new SchemaContext(schema2, this.options, path4, base, Object.create(this.schemas)); + var ctx = new SchemaContext(schema2, this.options, path5, base, Object.create(this.schemas)); if (id && !ctx.schemas[base]) { ctx.schemas[base] = schema2; } @@ -117428,7 +117428,7 @@ var require_lib3 = __commonJS({ // src/start-proxy-action.ts var import_child_process = require("child_process"); -var path3 = __toESM(require("path")); +var path4 = __toESM(require("path")); var core11 = __toESM(require_core()); // src/actions-util.ts @@ -117450,21 +117450,21 @@ async function getFolderSize(itemPath, options) { getFolderSize.loose = async (itemPath, options) => await core(itemPath, options); getFolderSize.strict = async (itemPath, options) => await core(itemPath, options, { strict: true }); async function core(rootItemPath, options = {}, returnType = {}) { - const fs2 = options.fs || await import("node:fs/promises"); + const fs3 = 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 fs2.lstat(itemPath, { bigint: true }) : await fs2.lstat(itemPath, { bigint: true }).catch((error3) => errors.push(error3)); + const stats = returnType.strict ? await fs3.lstat(itemPath, { bigint: true }) : await fs3.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 fs2.readdir(itemPath) : await fs2.readdir(itemPath).catch((error3) => errors.push(error3)); + const directoryItems = returnType.strict ? await fs3.readdir(itemPath) : await fs3.readdir(itemPath).catch((error3) => errors.push(error3)); if (typeof directoryItems !== "object") return; await Promise.all( directoryItems.map( @@ -121813,6 +121813,148 @@ function generateCertificateAuthority(newCertGenFF) { return { cert: pem, key }; } +// src/start-proxy/environment.ts +var fs2 = __toESM(require("fs")); +var path3 = __toESM(require("path")); +var toolrunner3 = __toESM(require_toolrunner()); +var io4 = __toESM(require_io()); +function checkEnvVar(logger, name) { + const value = process.env[name]; + if (isDefined2(value)) { + const url = URL.parse(value); + if (isDefined2(url)) { + url.username = ""; + url.password = ""; + logger.info(`Environment variable '${name}' is set to '${url}'.`); + } else { + logger.info(`Environment variable '${name}' is set to '${value}'.`); + } + return true; + } else { + logger.debug(`Environment variable '${name}' is not set.`); + return false; + } +} +var javaProperties = [ + "http.proxyHost", + "http.proxyPort", + "https.proxyHost", + "https.proxyPort", + "http.nonProxyHosts", + "java.net.useSystemProxies", + "javax.net.ssl.trustStore", + "javax.net.ssl.trustStoreType", + "javax.net.ssl.trustStoreProvider", + "jdk.tls.client.protocols", + "jdk.tls.disabledAlgorithms", + "jdk.security.allowNonCaAnchor", + "https.protocols", + "com.sun.net.ssl.enableAIAcaIssuers", + "com.sun.net.ssl.checkRevocation", + "com.sun.security.enableCRLDP", + "ocsp.enable" +]; +var JAVA_PROXY_ENV_VARS = [ + "JAVA_TOOL_OPTIONS" /* JAVA_TOOL_OPTIONS */, + "JDK_JAVA_OPTIONS" /* JDK_JAVA_OPTIONS */, + "_JAVA_OPTIONS" /* _JAVA_OPTIONS */ +]; +function checkJavaEnvVars(logger) { + for (const envVar of JAVA_PROXY_ENV_VARS) { + checkEnvVar(logger, envVar); + } +} +function discoverActionsJdks() { + const paths = /* @__PURE__ */ new Set(); + const javaHome = process.env["JAVA_HOME" /* JAVA_HOME */]; + if (isDefined2(javaHome)) { + paths.add(javaHome); + } + for (const [envVar, value] of Object.entries(process.env)) { + if (isDefined2(value) && envVar.match(/^JAVA_HOME_\d+_/)) { + paths.add(value); + } + } + return paths; +} +function checkJdkSettings(logger, jdkHome) { + const filesToCheck = [ + // JDK 9+ + path3.join("conf", "net.properties"), + // JDK 8 and below + path3.join("lib", "net.properties") + ]; + for (const fileToCheck of filesToCheck) { + const file = path3.join(jdkHome, fileToCheck); + try { + if (fs2.existsSync(file)) { + logger.debug(`Found '${file}'.`); + const lines = String(fs2.readFileSync(file)).split("\n"); + for (const line of lines) { + for (const property of javaProperties) { + if (line.startsWith(`${property}=`)) { + logger.info(`Found '${line.trimEnd()}' in '${file}'.`); + } + } + } + } else { + logger.debug(`'${file}' does not exist.`); + } + } catch (err) { + logger.debug(`Failed to read '${file}': ${getErrorMessage(err)}`); + } + } +} +async function showJavaSettings(logger) { + try { + const java = await io4.which("java", true); + let output = ""; + await new toolrunner3.ToolRunner( + java, + ["-XshowSettings:all", "-XshowSettings:security:all", "-version"], + { + silent: true, + listeners: { + stdout: (data) => { + output += String(data); + }, + stderr: (data) => { + output += String(data); + } + } + } + ).exec(); + logger.startGroup("Java settings"); + logger.info(output); + logger.endGroup(); + } catch (err) { + logger.debug(`Failed to query java settings: ${getErrorMessage(err)}`); + } +} +var ProxyEnvVars = /* @__PURE__ */ ((ProxyEnvVars2) => { + ProxyEnvVars2["HTTP_PROXY"] = "HTTP_PROXY"; + ProxyEnvVars2["HTTPS_PROXY"] = "HTTPS_PROXY"; + ProxyEnvVars2["ALL_PROXY"] = "ALL_PROXY"; + return ProxyEnvVars2; +})(ProxyEnvVars || {}); +function checkProxyEnvVars(logger) { + for (const envVar of Object.values(ProxyEnvVars)) { + checkEnvVar(logger, envVar); + checkEnvVar(logger, envVar.toLowerCase()); + } +} +async function checkProxyEnvironment(logger, language) { + checkProxyEnvVars(logger); + if (language === void 0 || language === "java" /* java */) { + checkJavaEnvVars(logger); + await showJavaSettings(logger); + const jdks = discoverActionsJdks(); + for (const jdk of jdks) { + checkJdkSettings(logger, jdk); + } + } +} + // src/start-proxy/reachability.ts var https = __toESM(require("https")); var import_https_proxy_agent = __toESM(require_dist2()); @@ -121907,7 +122049,7 @@ async function run(startedAt) { try { persistInputs(); const tempDir = getTemporaryDirectory(); - const proxyLogFilePath = path3.resolve(tempDir, "proxy.log"); + const proxyLogFilePath = path4.resolve(tempDir, "proxy.log"); core11.saveState("proxy-log-file", proxyLogFilePath); const repositoryNwo = getRepositoryNwo(); const gitHubVersion = await getGitHubVersion(); @@ -121933,6 +122075,15 @@ async function run(startedAt) { `Credentials loaded for the following registries: ${credentials.map((c) => credentialToStr(c)).join("\n")}` ); + if (core11.isDebug() || isInTestMode()) { + try { + await checkProxyEnvironment(logger, language); + } catch (err) { + logger.debug( + `Unable to inspect runner environment: ${getErrorMessage(err)}` + ); + } + } const ca = generateCertificateAuthority( await features.getValue("improved_proxy_certificates" /* ImprovedProxyCertificates */) ); diff --git a/src/init-action.ts b/src/init-action.ts index 5abaee7669..3df778fffb 100644 --- a/src/init-action.ts +++ b/src/init-action.ts @@ -52,7 +52,7 @@ import { initConfig, runDatabaseInitCluster, } from "./init"; -import { KnownLanguage } from "./languages"; +import { JavaEnvVars, KnownLanguage } from "./languages"; import { getActionsLogger, Logger } from "./logging"; import { downloadOverlayBaseDatabaseFromCache, @@ -756,13 +756,13 @@ async function run(startedAt: Date) { // Enable Java network debugging if the FF is enabled. if (await features.getValue(Feature.JavaNetworkDebugging)) { - // Get the existing value of `JAVA_OPTS`, if any. + // Get the existing value of `JAVA_TOOL_OPTIONS`, if any. const existingJavaToolOptions = - getOptionalEnvVar("JAVA_TOOL_OPTIONS") || ""; + getOptionalEnvVar(JavaEnvVars.JAVA_TOOL_OPTIONS) || ""; // Add the network debugging options. core.exportVariable( - "JAVA_TOOL_OPTIONS", + JavaEnvVars.JAVA_TOOL_OPTIONS, `${existingJavaToolOptions} -Djavax.net.debug=all`, ); } diff --git a/src/languages.ts b/src/languages.ts index 8be4f32ddf..0723b89eb4 100644 --- a/src/languages.ts +++ b/src/languages.ts @@ -19,3 +19,11 @@ export enum KnownLanguage { rust = "rust", swift = "swift", } + +/** Java-specific environment variable names that we may care about. */ +export enum JavaEnvVars { + JAVA_HOME = "JAVA_HOME", + JAVA_TOOL_OPTIONS = "JAVA_TOOL_OPTIONS", + JDK_JAVA_OPTIONS = "JDK_JAVA_OPTIONS", + _JAVA_OPTIONS = "_JAVA_OPTIONS", +} diff --git a/src/start-proxy-action.ts b/src/start-proxy-action.ts index b4e65b1578..3ee44a409d 100644 --- a/src/start-proxy-action.ts +++ b/src/start-proxy-action.ts @@ -22,6 +22,7 @@ import { ProxyConfig, } from "./start-proxy"; import { generateCertificateAuthority } from "./start-proxy/ca"; +import { checkProxyEnvironment } from "./start-proxy/environment"; import { checkConnections } from "./start-proxy/reachability"; import { ActionName, sendUnhandledErrorStatusReport } from "./status-report"; import * as util from "./util"; @@ -76,6 +77,19 @@ async function run(startedAt: Date) { .join("\n")}`, ); + // Check the environment for any configurations which may affect the proxy. + // This is a best effort process to give us insights into potential factors + // which may affect the operation of our proxy. + if (core.isDebug() || util.isInTestMode()) { + try { + await checkProxyEnvironment(logger, language); + } catch (err) { + logger.debug( + `Unable to inspect runner environment: ${util.getErrorMessage(err)}`, + ); + } + } + const ca = generateCertificateAuthority( await features.getValue(Feature.ImprovedProxyCertificates), ); diff --git a/src/start-proxy/environment.test.ts b/src/start-proxy/environment.test.ts new file mode 100644 index 0000000000..8dcb4c7b29 --- /dev/null +++ b/src/start-proxy/environment.test.ts @@ -0,0 +1,213 @@ +import * as fs from "fs"; +import * as os from "os"; +import path from "path"; + +import * as toolrunner from "@actions/exec/lib/toolrunner"; +import * as io from "@actions/io"; +import test, { ExecutionContext } from "ava"; +import sinon from "sinon"; + +import { JavaEnvVars, KnownLanguage } from "../languages"; +import { + checkExpectedLogMessages, + getRecordingLogger, + LoggedMessage, + setupTests, +} from "../testing-utils"; +import { withTmpDir } from "../util"; + +import { + checkJavaEnvVars, + checkJdkSettings, + checkProxyEnvironment, + checkProxyEnvVars, + discoverActionsJdks, + JAVA_PROXY_ENV_VARS, + ProxyEnvVars, +} from "./environment"; + +setupTests(test); + +function stubToolrunner() { + sinon.stub(io, "which").throws(new Error("Java not installed")); + sinon.stub(toolrunner, "ToolRunner").returns({ + exec: async () => { + return 0; + }, + }); +} + +function assertEnvVarLogMessages( + t: ExecutionContext, + envVars: string[], + messages: LoggedMessage[], + expectSet: boolean | string, +) { + const template = (envVar: string) => { + if (typeof expectSet === "string") { + return `Environment variable '${envVar}' is set to '${expectSet}'`; + } + return expectSet + ? `Environment variable '${envVar}' is set to '${envVar}'` + : `Environment variable '${envVar}' is not set`; + }; + + const expected: string[] = []; + + for (const envVar of envVars) { + expected.push(template(envVar)); + } + + checkExpectedLogMessages(t, messages, expected); +} + +test("checkJavaEnvironment - none set", (t) => { + const messages: LoggedMessage[] = []; + const logger = getRecordingLogger(messages); + + checkJavaEnvVars(logger); + assertEnvVarLogMessages(t, JAVA_PROXY_ENV_VARS, messages, false); +}); + +test("checkJavaEnvironment - logs values when variables are set", (t) => { + const messages: LoggedMessage[] = []; + const logger = getRecordingLogger(messages); + + for (const envVar of Object.values(JavaEnvVars)) { + process.env[envVar] = envVar; + } + + checkJavaEnvVars(logger); + assertEnvVarLogMessages(t, JAVA_PROXY_ENV_VARS, messages, true); +}); + +test("discoverActionsJdks - discovers JDK paths", (t) => { + // Clear GHA variables that may interfere with this test in CI. + for (const envVar of Object.keys(process.env)) { + if (envVar.startsWith("JAVA_HOME_")) { + delete process.env[envVar]; + } + } + + const jdk8 = "/usr/lib/jvm/temurin-8-jdk-amd64"; + const jdk17 = "/usr/lib/jvm/temurin-17-jdk-amd64"; + const jdk21 = "/usr/lib/jvm/temurin-21-jdk-amd64"; + + process.env[JavaEnvVars.JAVA_HOME] = jdk17; + process.env["JAVA_HOME_8_X64"] = jdk8; + process.env["JAVA_HOME_17_X64"] = jdk17; + process.env["JAVA_HOME_21_X64"] = jdk21; + + const results = discoverActionsJdks(); + t.is(results.size, 3); + t.true(results.has(jdk8)); + t.true(results.has(jdk17)); + t.true(results.has(jdk21)); +}); + +test("checkJdkSettings - does not throw for an empty directory", async (t) => { + const messages: LoggedMessage[] = []; + const logger = getRecordingLogger(messages); + + await withTmpDir(async (tmpDir) => { + t.notThrows(() => checkJdkSettings(logger, tmpDir)); + }); +}); + +test("checkJdkSettings - finds files and logs relevant properties", async (t) => { + const messages: LoggedMessage[] = []; + const logger = getRecordingLogger(messages); + + await withTmpDir(async (tmpDir) => { + const dir = path.join(tmpDir, "conf"); + fs.mkdirSync(dir); + + const file = path.join(dir, "net.properties"); + fs.writeFileSync( + file, + [ + "irrelevant.property=foo", + "http.proxyHost=proxy.example.com", + "http.unrelated=bar", + ].join(os.EOL), + {}, + ); + checkJdkSettings(logger, tmpDir); + + checkExpectedLogMessages(t, messages, [ + `Found '${file}'.`, + `Found 'http.proxyHost=proxy.example.com' in '${file}'`, + ]); + }); +}); + +test("checkProxyEnvVars - none set", (t) => { + const messages: LoggedMessage[] = []; + const logger = getRecordingLogger(messages); + + checkProxyEnvVars(logger); + assertEnvVarLogMessages(t, Object.values(ProxyEnvVars), messages, false); +}); + +test("checkProxyEnvVars - logs values when variables are set", (t) => { + const messages: LoggedMessage[] = []; + const logger = getRecordingLogger(messages); + + for (const envVar of Object.values(ProxyEnvVars)) { + process.env[envVar] = envVar; + } + + checkProxyEnvVars(logger); + assertEnvVarLogMessages(t, Object.values(ProxyEnvVars), messages, true); +}); + +test("checkProxyEnvVars - credentials are removed from URLs", (t) => { + const messages: LoggedMessage[] = []; + const logger = getRecordingLogger(messages); + + for (const envVar of Object.values(ProxyEnvVars)) { + process.env[envVar] = "https://secret:password@proxy.local"; + } + + checkProxyEnvVars(logger); + assertEnvVarLogMessages( + t, + Object.values(ProxyEnvVars), + messages, + "https://proxy.local/", + ); +}); + +test("checkProxyEnvironment - includes base checks for all known languages", async (t) => { + stubToolrunner(); + + for (const language of Object.values(KnownLanguage)) { + const messages: LoggedMessage[] = []; + const logger = getRecordingLogger(messages); + + await checkProxyEnvironment(logger, language); + assertEnvVarLogMessages(t, Object.keys(ProxyEnvVars), messages, false); + } +}); + +test("checkProxyEnvironment - includes Java checks for Java", async (t) => { + const messages: LoggedMessage[] = []; + const logger = getRecordingLogger(messages); + + stubToolrunner(); + + await checkProxyEnvironment(logger, KnownLanguage.java); + assertEnvVarLogMessages(t, Object.keys(ProxyEnvVars), messages, false); + assertEnvVarLogMessages(t, JAVA_PROXY_ENV_VARS, messages, false); +}); + +test("checkProxyEnvironment - includes language-specific checks if the language is undefined", async (t) => { + const messages: LoggedMessage[] = []; + const logger = getRecordingLogger(messages); + + stubToolrunner(); + + await checkProxyEnvironment(logger, undefined); + assertEnvVarLogMessages(t, Object.keys(ProxyEnvVars), messages, false); + assertEnvVarLogMessages(t, JAVA_PROXY_ENV_VARS, messages, false); +}); diff --git a/src/start-proxy/environment.ts b/src/start-proxy/environment.ts new file mode 100644 index 0000000000..13eb121901 --- /dev/null +++ b/src/start-proxy/environment.ts @@ -0,0 +1,209 @@ +import * as fs from "fs"; +import * as path from "path"; + +import * as toolrunner from "@actions/exec/lib/toolrunner"; +import * as io from "@actions/io"; + +import { JavaEnvVars, KnownLanguage, Language } from "../languages"; +import { Logger } from "../logging"; +import { getErrorMessage, isDefined } from "../util"; + +/** + * Checks whether an environment variable named `name` is set and logs its value if set. + * + * @param logger The logger to use. + * @param name The name of the environment variable. + * @returns True if set or false otherwise. + */ +function checkEnvVar(logger: Logger, name: string): boolean { + const value = process.env[name]; + if (isDefined(value)) { + const url = URL.parse(value); + if (isDefined(url)) { + url.username = ""; + url.password = ""; + logger.info(`Environment variable '${name}' is set to '${url}'.`); + } else { + logger.info(`Environment variable '${name}' is set to '${value}'.`); + } + return true; + } else { + logger.debug(`Environment variable '${name}' is not set.`); + return false; + } +} + +// The JRE properties that may affect the proxy. +const javaProperties = [ + "http.proxyHost", + "http.proxyPort", + "https.proxyHost", + "https.proxyPort", + "http.nonProxyHosts", + "java.net.useSystemProxies", + "javax.net.ssl.trustStore", + "javax.net.ssl.trustStoreType", + "javax.net.ssl.trustStoreProvider", + "jdk.tls.client.protocols", + "jdk.tls.disabledAlgorithms", + "jdk.security.allowNonCaAnchor", + "https.protocols", + "com.sun.net.ssl.enableAIAcaIssuers", + "com.sun.net.ssl.checkRevocation", + "com.sun.security.enableCRLDP", + "ocsp.enable", +]; + +/** Java-specific environment variables which may contain information about proxy settings. */ +export const JAVA_PROXY_ENV_VARS: JavaEnvVars[] = [ + JavaEnvVars.JAVA_TOOL_OPTIONS, + JavaEnvVars.JDK_JAVA_OPTIONS, + JavaEnvVars._JAVA_OPTIONS, +]; + +/** + * Checks whether any Java-specific environment variables which may contain proxy + * configurations are set and logs their values if so. + */ +export function checkJavaEnvVars(logger: Logger) { + for (const envVar of JAVA_PROXY_ENV_VARS) { + checkEnvVar(logger, envVar); + } +} + +/** + * Discovers paths to JDK directories based on JAVA_HOME and GHA-specific environment variables. + * @returns A set of JDK paths. + */ +export function discoverActionsJdks(): Set { + const paths: Set = new Set(); + + // Check whether JAVA_HOME is set. + const javaHome = process.env[JavaEnvVars.JAVA_HOME]; + if (isDefined(javaHome)) { + paths.add(javaHome); + } + + for (const [envVar, value] of Object.entries(process.env)) { + if (isDefined(value) && envVar.match(/^JAVA_HOME_\d+_/)) { + paths.add(value); + } + } + + return paths; +} + +/** + * Tries to inspect JDK configuration files for the specified JDK path which may contain proxy settings. + * + * @param logger The logger to use. + * @param jdkHome The JDK home directory. + */ +export function checkJdkSettings(logger: Logger, jdkHome: string) { + const filesToCheck = [ + // JDK 9+ + path.join("conf", "net.properties"), + // JDK 8 and below + path.join("lib", "net.properties"), + ]; + + for (const fileToCheck of filesToCheck) { + const file = path.join(jdkHome, fileToCheck); + + try { + if (fs.existsSync(file)) { + logger.debug(`Found '${file}'.`); + + const lines = String(fs.readFileSync(file)).split("\n"); + for (const line of lines) { + for (const property of javaProperties) { + if (line.startsWith(`${property}=`)) { + logger.info(`Found '${line.trimEnd()}' in '${file}'.`); + } + } + } + } else { + logger.debug(`'${file}' does not exist.`); + } + } catch (err) { + logger.debug(`Failed to read '${file}': ${getErrorMessage(err)}`); + } + } +} + +/** Invokes `java` to get it to show us the active configuration. */ +async function showJavaSettings(logger: Logger): Promise { + try { + const java = await io.which("java", true); + + let output = ""; + await new toolrunner.ToolRunner( + java, + ["-XshowSettings:all", "-XshowSettings:security:all", "-version"], + { + silent: true, + listeners: { + stdout: (data) => { + output += String(data); + }, + stderr: (data) => { + output += String(data); + }, + }, + }, + ).exec(); + + logger.startGroup("Java settings"); + logger.info(output); + logger.endGroup(); + } catch (err) { + logger.debug(`Failed to query java settings: ${getErrorMessage(err)}`); + } +} + +/** Enumerates environment variable names which may contain information about proxy settings. */ +export enum ProxyEnvVars { + HTTP_PROXY = "HTTP_PROXY", + HTTPS_PROXY = "HTTPS_PROXY", + ALL_PROXY = "ALL_PROXY", +} + +/** + * Checks whether any proxy-related environment variables are set and logs their values if so. + */ +export function checkProxyEnvVars(logger: Logger) { + // Both upper-case and lower-case variants of these environment variables are used. + for (const envVar of Object.values(ProxyEnvVars)) { + checkEnvVar(logger, envVar); + checkEnvVar(logger, envVar.toLowerCase()); + } +} + +/** + * Inspects environment variables and other configurations on the runner to determine whether + * any settings that may affect the operation of the proxy are present. All relevant information + * is written to the log. + * + * @param logger The logger to use. + * @param language The enabled language, if known. + */ +export async function checkProxyEnvironment( + logger: Logger, + language: Language | undefined, +): Promise { + // Determine whether there is an existing proxy configured. + checkProxyEnvVars(logger); + + // Check language-specific configurations. If we don't know the language, + // then we perform all checks. + if (language === undefined || language === KnownLanguage.java) { + checkJavaEnvVars(logger); + + await showJavaSettings(logger); + + const jdks = discoverActionsJdks(); + for (const jdk of jdks) { + checkJdkSettings(logger, jdk); + } + } +} diff --git a/src/testing-utils.ts b/src/testing-utils.ts index b34e75fd09..8765738e4e 100644 --- a/src/testing-utils.ts +++ b/src/testing-utils.ts @@ -271,6 +271,8 @@ export function checkExpectedLogMessages( t.fail( `Expected\n\n${listify(missingMessages)}\n\nin the logger output, but didn't find it in:\n\n${messages.map((m) => ` - '${m.message}'`).join("\n")}`, ); + } else { + t.pass(); } }