diff --git a/lib/start-proxy-action.js b/lib/start-proxy-action.js index ba02187c60..be46a7c32b 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 fs = __importStar2(require("fs")); + var fs2 = __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 (!fs.existsSync(filePath)) { + if (!fs2.existsSync(filePath)) { throw new Error(`Missing file at path: ${filePath}`); } - fs.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os2.EOL}`, { + fs2.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os2.EOL}`, { encoding: "utf8" }); } @@ -1015,14 +1015,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 path2 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`; + let path3 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`; if (origin.endsWith("/")) { origin = origin.substring(0, origin.length - 1); } - if (path2 && !path2.startsWith("/")) { - path2 = `/${path2}`; + if (path3 && !path3.startsWith("/")) { + path3 = `/${path3}`; } - url = new URL(origin + path2); + url = new URL(origin + path3); } return url; } @@ -2636,20 +2636,20 @@ var require_parseParams = __commonJS({ var require_basename = __commonJS({ "node_modules/@fastify/busboy/lib/utils/basename.js"(exports2, module2) { "use strict"; - module2.exports = function basename(path2) { - if (typeof path2 !== "string") { + module2.exports = function basename(path3) { + if (typeof path3 !== "string") { return ""; } - for (var i = path2.length - 1; i >= 0; --i) { - switch (path2.charCodeAt(i)) { + for (var i = path3.length - 1; i >= 0; --i) { + switch (path3.charCodeAt(i)) { case 47: // '/' case 92: - path2 = path2.slice(i + 1); - return path2 === ".." || path2 === "." ? "" : path2; + path3 = path3.slice(i + 1); + return path3 === ".." || path3 === "." ? "" : path3; } } - return path2 === ".." || path2 === "." ? "" : path2; + return path3 === ".." || path3 === "." ? "" : path3; }; } }); @@ -5679,7 +5679,7 @@ var require_request = __commonJS({ } var Request = class _Request { constructor(origin, { - path: path2, + path: path3, method, body, headers, @@ -5693,11 +5693,11 @@ var require_request = __commonJS({ throwOnError, expectContinue }, handler2) { - if (typeof path2 !== "string") { + if (typeof path3 !== "string") { throw new InvalidArgumentError("path must be a string"); - } else if (path2[0] !== "/" && !(path2.startsWith("http://") || path2.startsWith("https://")) && method !== "CONNECT") { + } else if (path3[0] !== "/" && !(path3.startsWith("http://") || path3.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.exec(path2) !== null) { + } else if (invalidPathRegex.exec(path3) !== null) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { @@ -5760,7 +5760,7 @@ var require_request = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query ? util.buildURL(path2, query) : path2; + this.path = query ? util.buildURL(path3, query) : path3; this.origin = origin; this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; this.blocking = blocking == null ? false : blocking; @@ -6768,9 +6768,9 @@ var require_RedirectHandler = __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 path2 = search ? `${pathname}${search}` : pathname; + const path3 = search ? `${pathname}${search}` : pathname; this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path2; + this.opts.path = path3; this.opts.origin = origin; this.opts.maxRedirections = 0; this.opts.query = null; @@ -8010,7 +8010,7 @@ var require_client = __commonJS({ writeH2(client, client[kHTTP2Session], request2); return; } - const { body, method, path: path2, host, upgrade, headers, blocking, reset } = request2; + const { body, method, path: path3, host, upgrade, headers, blocking, reset } = request2; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { body.read(0); @@ -8060,7 +8060,7 @@ var require_client = __commonJS({ if (blocking) { socket[kBlocking] = true; } - let header = `${method} ${path2} HTTP/1.1\r + let header = `${method} ${path3} HTTP/1.1\r `; if (typeof host === "string") { header += `host: ${host}\r @@ -8123,7 +8123,7 @@ upgrade: ${upgrade}\r return true; } function writeH2(client, session, request2) { - const { body, method, path: path2, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; + const { body, method, path: path3, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; let headers; if (typeof reqHeaders === "string") headers = Request[kHTTP2CopyHeaders](reqHeaders.trim()); else headers = reqHeaders; @@ -8166,7 +8166,7 @@ upgrade: ${upgrade}\r }); return true; } - headers[HTTP2_HEADER_PATH] = path2; + headers[HTTP2_HEADER_PATH] = path3; headers[HTTP2_HEADER_SCHEME] = "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { @@ -10406,20 +10406,20 @@ var require_mock_utils = __commonJS({ } return true; } - function safeUrl(path2) { - if (typeof path2 !== "string") { - return path2; + function safeUrl(path3) { + if (typeof path3 !== "string") { + return path3; } - const pathSegments = path2.split("?"); + const pathSegments = path3.split("?"); if (pathSegments.length !== 2) { - return path2; + return path3; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } - function matchKey(mockDispatch2, { path: path2, method, body, headers }) { - const pathMatch = matchValue(mockDispatch2.path, path2); + function matchKey(mockDispatch2, { path: path3, method, body, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path3); const methodMatch = matchValue(mockDispatch2.method, method); const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true; const headersMatch = matchHeaders(mockDispatch2, headers); @@ -10437,7 +10437,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: path2 }) => matchValue(safeUrl(path2), resolvedPath)); + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path3 }) => matchValue(safeUrl(path3), resolvedPath)); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); } @@ -10474,9 +10474,9 @@ var require_mock_utils = __commonJS({ } } function buildKey(opts) { - const { path: path2, method, body, headers, query } = opts; + const { path: path3, method, body, headers, query } = opts; return { - path: path2, + path: path3, method, body, headers, @@ -10925,10 +10925,10 @@ var require_pending_interceptors_formatter = __commonJS({ } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( - ({ method, path: path2, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + ({ method, path: path3, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, - Path: path2, + Path: path3, "Status code": statusCode, Persistent: persist ? "\u2705" : "\u274C", Invocations: timesInvoked, @@ -15548,8 +15548,8 @@ var require_util6 = __commonJS({ } } } - function validateCookiePath(path2) { - for (const char of path2) { + function validateCookiePath(path3) { + for (const char of path3) { const code = char.charCodeAt(0); if (code < 33 || char === ";") { throw new Error("Invalid cookie path"); @@ -17229,11 +17229,11 @@ var require_undici = __commonJS({ if (typeof opts.path !== "string") { throw new InvalidArgumentError("invalid opts.path"); } - let path2 = opts.path; + let path3 = opts.path; if (!opts.path.startsWith("/")) { - path2 = `/${path2}`; + path3 = `/${path3}`; } - url = new URL(util.parseOrigin(url).origin + path2); + url = new URL(util.parseOrigin(url).origin + path3); } else { if (!opts) { opts = typeof url === "object" ? url : {}; @@ -18540,7 +18540,7 @@ var require_path_utils = __commonJS({ exports2.toPosixPath = toPosixPath; exports2.toWin32Path = toWin32Path; exports2.toPlatformPath = toPlatformPath; - var path2 = __importStar2(require("path")); + var path3 = __importStar2(require("path")); function toPosixPath(pth) { return pth.replace(/[\\]/g, "/"); } @@ -18548,7 +18548,7 @@ var require_path_utils = __commonJS({ return pth.replace(/[/]/g, "\\"); } function toPlatformPath(pth) { - return pth.replace(/[/\\]/g, path2.sep); + return pth.replace(/[/\\]/g, path3.sep); } } }); @@ -18630,13 +18630,13 @@ var require_io_util = __commonJS({ exports2.isRooted = isRooted; exports2.tryGetExecutablePath = tryGetExecutablePath; exports2.getCmdPath = getCmdPath; - var fs = __importStar2(require("fs")); - var path2 = __importStar2(require("path")); - _a = fs.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 fs2 = __importStar2(require("fs")); + var path3 = __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; exports2.IS_WINDOWS = process.platform === "win32"; function readlink(fsPath) { return __awaiter2(this, void 0, void 0, function* () { - const result = yield fs.promises.readlink(fsPath); + const result = yield fs2.promises.readlink(fsPath); if (exports2.IS_WINDOWS && !result.endsWith("\\")) { return `${result}\\`; } @@ -18644,7 +18644,7 @@ var require_io_util = __commonJS({ }); } exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs.constants.O_RDONLY; + exports2.READONLY = fs2.constants.O_RDONLY; function exists(fsPath) { return __awaiter2(this, void 0, void 0, function* () { try { @@ -18686,7 +18686,7 @@ var require_io_util = __commonJS({ } if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { - const upperExt = path2.extname(filePath).toUpperCase(); + const upperExt = path3.extname(filePath).toUpperCase(); if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { return filePath; } @@ -18710,11 +18710,11 @@ var require_io_util = __commonJS({ if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { try { - const directory = path2.dirname(filePath); - const upperName = path2.basename(filePath).toUpperCase(); + const directory = path3.dirname(filePath); + const upperName = path3.basename(filePath).toUpperCase(); for (const actualName of yield (0, exports2.readdir)(directory)) { if (upperName === actualName.toUpperCase()) { - filePath = path2.join(directory, actualName); + filePath = path3.join(directory, actualName); break; } } @@ -18826,7 +18826,7 @@ var require_io = __commonJS({ exports2.which = which4; exports2.findInPath = findInPath; var assert_1 = require("assert"); - var path2 = __importStar2(require("path")); + var path3 = __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 = {}) { @@ -18835,7 +18835,7 @@ var require_io = __commonJS({ if (destStat && destStat.isFile() && !force) { return; } - const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path2.join(dest, path2.basename(source)) : dest; + const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path3.join(dest, path3.basename(source)) : dest; if (!(yield ioUtil.exists(source))) { throw new Error(`no such file or directory: ${source}`); } @@ -18847,7 +18847,7 @@ var require_io = __commonJS({ yield cpDirRecursive(source, newDest, 0, force); } } else { - if (path2.relative(source, newDest) === "") { + if (path3.relative(source, newDest) === "") { throw new Error(`'${newDest}' and '${source}' are the same file`); } yield copyFile2(source, newDest, force); @@ -18859,7 +18859,7 @@ var require_io = __commonJS({ if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { - dest = path2.join(dest, path2.basename(source)); + dest = path3.join(dest, path3.basename(source)); destExists = yield ioUtil.exists(dest); } if (destExists) { @@ -18870,7 +18870,7 @@ var require_io = __commonJS({ } } } - yield mkdirP(path2.dirname(dest)); + yield mkdirP(path3.dirname(dest)); yield ioUtil.rename(source, dest); }); } @@ -18929,7 +18929,7 @@ var require_io = __commonJS({ } const extensions = []; if (ioUtil.IS_WINDOWS && process.env["PATHEXT"]) { - for (const extension of process.env["PATHEXT"].split(path2.delimiter)) { + for (const extension of process.env["PATHEXT"].split(path3.delimiter)) { if (extension) { extensions.push(extension); } @@ -18942,12 +18942,12 @@ var require_io = __commonJS({ } return []; } - if (tool.includes(path2.sep)) { + if (tool.includes(path3.sep)) { return []; } const directories = []; if (process.env.PATH) { - for (const p of process.env.PATH.split(path2.delimiter)) { + for (const p of process.env.PATH.split(path3.delimiter)) { if (p) { directories.push(p); } @@ -18955,7 +18955,7 @@ var require_io = __commonJS({ } const matches = []; for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path2.join(directory, tool), extensions); + const filePath = yield ioUtil.tryGetExecutablePath(path3.join(directory, tool), extensions); if (filePath) { matches.push(filePath); } @@ -19085,7 +19085,7 @@ var require_toolrunner = __commonJS({ var os2 = __importStar2(require("os")); var events = __importStar2(require("events")); var child = __importStar2(require("child_process")); - var path2 = __importStar2(require("path")); + var path3 = __importStar2(require("path")); var io4 = __importStar2(require_io()); var ioUtil = __importStar2(require_io_util()); var timers_1 = require("timers"); @@ -19300,7 +19300,7 @@ var require_toolrunner = __commonJS({ exec() { return __awaiter2(this, void 0, void 0, function* () { if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { - this.toolPath = path2.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + this.toolPath = path3.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } this.toolPath = yield io4.which(this.toolPath, true); return new Promise((resolve2, reject) => __awaiter2(this, void 0, void 0, function* () { @@ -19853,7 +19853,7 @@ var require_core = __commonJS({ var file_command_1 = require_file_command(); var utils_1 = require_utils(); var os2 = __importStar2(require("os")); - var path2 = __importStar2(require("path")); + var path3 = __importStar2(require("path")); var oidc_utils_1 = require_oidc_utils(); var ExitCode; (function(ExitCode2) { @@ -19879,7 +19879,7 @@ var require_core = __commonJS({ } else { (0, command_1.issueCommand)("add-path", {}, inputPath); } - process.env["PATH"] = `${inputPath}${path2.delimiter}${process.env["PATH"]}`; + process.env["PATH"] = `${inputPath}${path3.delimiter}${process.env["PATH"]}`; } function getInput2(name, options) { const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; @@ -22003,7 +22003,7 @@ var require_manifest = __commonJS({ var core_1 = require_core(); var os2 = require("os"); var cp = require("child_process"); - var fs = require("fs"); + var fs2 = require("fs"); function _findMatch(versionSpec, stable, candidates, archFilter) { return __awaiter2(this, void 0, void 0, function* () { const platFilter = os2.platform(); @@ -22065,10 +22065,10 @@ var require_manifest = __commonJS({ const lsbReleaseFile = "/etc/lsb-release"; const osReleaseFile = "/etc/os-release"; let contents = ""; - if (fs.existsSync(lsbReleaseFile)) { - contents = fs.readFileSync(lsbReleaseFile).toString(); - } else if (fs.existsSync(osReleaseFile)) { - contents = fs.readFileSync(osReleaseFile).toString(); + if (fs2.existsSync(lsbReleaseFile)) { + contents = fs2.readFileSync(lsbReleaseFile).toString(); + } else if (fs2.existsSync(osReleaseFile)) { + contents = fs2.readFileSync(osReleaseFile).toString(); } return contents; } @@ -22277,10 +22277,10 @@ var require_tool_cache = __commonJS({ var core12 = __importStar2(require_core()); var io4 = __importStar2(require_io()); var crypto2 = __importStar2(require("crypto")); - var fs = __importStar2(require("fs")); + var fs2 = __importStar2(require("fs")); var mm = __importStar2(require_manifest()); var os2 = __importStar2(require("os")); - var path2 = __importStar2(require("path")); + var path3 = __importStar2(require("path")); var httpm = __importStar2(require_lib()); var semver6 = __importStar2(require_semver2()); var stream = __importStar2(require("stream")); @@ -22301,8 +22301,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 || path2.join(_getTempDirectory(), crypto2.randomUUID()); - yield io4.mkdirP(path2.dirname(dest)); + dest = dest || path3.join(_getTempDirectory(), crypto2.randomUUID()); + yield io4.mkdirP(path3.dirname(dest)); core12.debug(`Downloading ${url}`); core12.debug(`Destination ${dest}`); const maxAttempts = 3; @@ -22323,7 +22323,7 @@ var require_tool_cache = __commonJS({ } function downloadToolAttempt(url, dest, auth2, headers) { return __awaiter2(this, void 0, void 0, function* () { - if (fs.existsSync(dest)) { + if (fs2.existsSync(dest)) { throw new Error(`Destination file path ${dest} already exists`); } const http = new httpm.HttpClient(userAgent2, [], { @@ -22347,7 +22347,7 @@ var require_tool_cache = __commonJS({ const readStream = responseMessageFactory(); let succeeded = false; try { - yield pipeline(readStream, fs.createWriteStream(dest)); + yield pipeline(readStream, fs2.createWriteStream(dest)); core12.debug("download complete"); succeeded = true; return dest; @@ -22392,7 +22392,7 @@ var require_tool_cache = __commonJS({ process.chdir(originalCwd); } } else { - const escapedScript = path2.join(__dirname, "..", "scripts", "Invoke-7zdec.ps1").replace(/'/g, "''").replace(/"|\n|\r/g, ""); + const escapedScript = path3.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}'`; @@ -22559,12 +22559,12 @@ var require_tool_cache = __commonJS({ arch = arch || os2.arch(); core12.debug(`Caching tool ${tool} ${version} ${arch}`); core12.debug(`source dir: ${sourceDir}`); - if (!fs.statSync(sourceDir).isDirectory()) { + if (!fs2.statSync(sourceDir).isDirectory()) { throw new Error("sourceDir is not a directory"); } const destPath = yield _createToolPath(tool, version, arch); - for (const itemName of fs.readdirSync(sourceDir)) { - const s = path2.join(sourceDir, itemName); + for (const itemName of fs2.readdirSync(sourceDir)) { + const s = path3.join(sourceDir, itemName); yield io4.cp(s, destPath, { recursive: true }); } _completeToolPath(tool, version, arch); @@ -22577,11 +22577,11 @@ var require_tool_cache = __commonJS({ arch = arch || os2.arch(); core12.debug(`Caching tool ${tool} ${version} ${arch}`); core12.debug(`source file: ${sourceFile}`); - if (!fs.statSync(sourceFile).isFile()) { + if (!fs2.statSync(sourceFile).isFile()) { throw new Error("sourceFile is not a file"); } const destFolder = yield _createToolPath(tool, version, arch); - const destPath = path2.join(destFolder, targetFile); + const destPath = path3.join(destFolder, targetFile); core12.debug(`destination file ${destPath}`); yield io4.cp(sourceFile, destPath); _completeToolPath(tool, version, arch); @@ -22604,9 +22604,9 @@ var require_tool_cache = __commonJS({ let toolPath = ""; if (versionSpec) { versionSpec = semver6.clean(versionSpec) || ""; - const cachePath = path2.join(_getCacheDirectory(), toolName, versionSpec, arch); + const cachePath = path3.join(_getCacheDirectory(), toolName, versionSpec, arch); core12.debug(`checking cache: ${cachePath}`); - if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) { + if (fs2.existsSync(cachePath) && fs2.existsSync(`${cachePath}.complete`)) { core12.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`); toolPath = cachePath; } else { @@ -22618,13 +22618,13 @@ var require_tool_cache = __commonJS({ function findAllVersions(toolName, arch) { const versions = []; arch = arch || os2.arch(); - const toolPath = path2.join(_getCacheDirectory(), toolName); - if (fs.existsSync(toolPath)) { - const children = fs.readdirSync(toolPath); + const toolPath = path3.join(_getCacheDirectory(), toolName); + if (fs2.existsSync(toolPath)) { + const children = fs2.readdirSync(toolPath); for (const child of children) { if (isExplicitVersion(child)) { - const fullPath = path2.join(toolPath, child, arch || ""); - if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) { + const fullPath = path3.join(toolPath, child, arch || ""); + if (fs2.existsSync(fullPath) && fs2.existsSync(`${fullPath}.complete`)) { versions.push(child); } } @@ -22675,7 +22675,7 @@ var require_tool_cache = __commonJS({ function _createExtractFolder(dest) { return __awaiter2(this, void 0, void 0, function* () { if (!dest) { - dest = path2.join(_getTempDirectory(), crypto2.randomUUID()); + dest = path3.join(_getTempDirectory(), crypto2.randomUUID()); } yield io4.mkdirP(dest); return dest; @@ -22683,7 +22683,7 @@ var require_tool_cache = __commonJS({ } function _createToolPath(tool, version, arch) { return __awaiter2(this, void 0, void 0, function* () { - const folderPath = path2.join(_getCacheDirectory(), tool, semver6.clean(version) || version, arch || ""); + const folderPath = path3.join(_getCacheDirectory(), tool, semver6.clean(version) || version, arch || ""); core12.debug(`destination ${folderPath}`); const markerPath = `${folderPath}.complete`; yield io4.rmRF(folderPath); @@ -22693,9 +22693,9 @@ var require_tool_cache = __commonJS({ }); } function _completeToolPath(tool, version, arch) { - const folderPath = path2.join(_getCacheDirectory(), tool, semver6.clean(version) || version, arch || ""); + const folderPath = path3.join(_getCacheDirectory(), tool, semver6.clean(version) || version, arch || ""); const markerPath = `${folderPath}.complete`; - fs.writeFileSync(markerPath, ""); + fs2.writeFileSync(markerPath, ""); core12.debug("finished caching tool"); } function isExplicitVersion(versionSpec) { @@ -40552,8 +40552,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 path2 = process.env.GITHUB_EVENT_PATH; - process.stdout.write(`GITHUB_EVENT_PATH ${path2} does not exist${os_1.EOL}`); + const path3 = process.env.GITHUB_EVENT_PATH; + process.stdout.write(`GITHUB_EVENT_PATH ${path3} does not exist${os_1.EOL}`); } } this.eventName = process.env.GITHUB_EVENT_NAME; @@ -46276,14 +46276,14 @@ var require_helpers = __commonJS({ "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { "use strict"; var uri = require("url"); - var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path2, name, argument) { - if (Array.isArray(path2)) { - this.path = path2; - this.property = path2.reduce(function(sum, item) { + var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path3, name, argument) { + if (Array.isArray(path3)) { + this.path = path3; + this.property = path3.reduce(function(sum, item) { return sum + makeSuffix(item); }, "instance"); - } else if (path2 !== void 0) { - this.property = path2; + } else if (path3 !== void 0) { + this.property = path3; } if (message) { this.message = message; @@ -46374,16 +46374,16 @@ var require_helpers = __commonJS({ name: { value: "SchemaError", enumerable: false } } ); - var SchemaContext = exports2.SchemaContext = function SchemaContext2(schema2, options, path2, base, schemas) { + var SchemaContext = exports2.SchemaContext = function SchemaContext2(schema2, options, path3, base, schemas) { this.schema = schema2; this.options = options; - if (Array.isArray(path2)) { - this.path = path2; - this.propertyPath = path2.reduce(function(sum, item) { + if (Array.isArray(path3)) { + this.path = path3; + this.propertyPath = path3.reduce(function(sum, item) { return sum + makeSuffix(item); }, "instance"); } else { - this.propertyPath = path2; + this.propertyPath = path3; } this.base = base; this.schemas = schemas; @@ -46392,10 +46392,10 @@ var require_helpers = __commonJS({ return uri.resolve(this.base, target); }; SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { - var path2 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); + var path3 = 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, path2, base, Object.create(this.schemas)); + var ctx = new SchemaContext(schema2, this.options, path3, base, Object.create(this.schemas)); if (id && !ctx.schemas[base]) { ctx.schemas[base] = schema2; } @@ -47720,7 +47720,7 @@ var require_file_command2 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0; var crypto2 = __importStar2(require("crypto")); - var fs = __importStar2(require("fs")); + var fs2 = __importStar2(require("fs")); var os2 = __importStar2(require("os")); var utils_1 = require_utils5(); function issueFileCommand(command, message) { @@ -47728,10 +47728,10 @@ var require_file_command2 = __commonJS({ if (!filePath) { throw new Error(`Unable to find environment variable for file command ${command}`); } - if (!fs.existsSync(filePath)) { + if (!fs2.existsSync(filePath)) { throw new Error(`Missing file at path: ${filePath}`); } - fs.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os2.EOL}`, { + fs2.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os2.EOL}`, { encoding: "utf8" }); } @@ -48981,7 +48981,7 @@ var require_path_utils2 = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; - var path2 = __importStar2(require("path")); + var path3 = __importStar2(require("path")); function toPosixPath(pth) { return pth.replace(/[\\]/g, "/"); } @@ -48991,7 +48991,7 @@ var require_path_utils2 = __commonJS({ } exports2.toWin32Path = toWin32Path; function toPlatformPath(pth) { - return pth.replace(/[/\\]/g, path2.sep); + return pth.replace(/[/\\]/g, path3.sep); } exports2.toPlatformPath = toPlatformPath; } @@ -49054,12 +49054,12 @@ var require_io_util2 = __commonJS({ var _a; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getCmdPath = exports2.tryGetExecutablePath = exports2.isRooted = exports2.isDirectory = exports2.exists = exports2.READONLY = exports2.UV_FS_O_EXLOCK = exports2.IS_WINDOWS = exports2.unlink = exports2.symlink = exports2.stat = exports2.rmdir = exports2.rm = exports2.rename = exports2.readlink = exports2.readdir = exports2.open = exports2.mkdir = exports2.lstat = exports2.copyFile = exports2.chmod = void 0; - var fs = __importStar2(require("fs")); - var path2 = __importStar2(require("path")); - _a = fs.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.readlink = _a.readlink, 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 fs2 = __importStar2(require("fs")); + var path3 = __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.readlink = _a.readlink, 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"; exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs.constants.O_RDONLY; + exports2.READONLY = fs2.constants.O_RDONLY; function exists(fsPath) { return __awaiter2(this, void 0, void 0, function* () { try { @@ -49104,7 +49104,7 @@ var require_io_util2 = __commonJS({ } if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { - const upperExt = path2.extname(filePath).toUpperCase(); + const upperExt = path3.extname(filePath).toUpperCase(); if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { return filePath; } @@ -49128,11 +49128,11 @@ var require_io_util2 = __commonJS({ if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { try { - const directory = path2.dirname(filePath); - const upperName = path2.basename(filePath).toUpperCase(); + const directory = path3.dirname(filePath); + const upperName = path3.basename(filePath).toUpperCase(); for (const actualName of yield exports2.readdir(directory)) { if (upperName === actualName.toUpperCase()) { - filePath = path2.join(directory, actualName); + filePath = path3.join(directory, actualName); break; } } @@ -49227,7 +49227,7 @@ var require_io2 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.findInPath = exports2.which = exports2.mkdirP = exports2.rmRF = exports2.mv = exports2.cp = void 0; var assert_1 = require("assert"); - var path2 = __importStar2(require("path")); + var path3 = __importStar2(require("path")); var ioUtil = __importStar2(require_io_util2()); function cp(source, dest, options = {}) { return __awaiter2(this, void 0, void 0, function* () { @@ -49236,7 +49236,7 @@ var require_io2 = __commonJS({ if (destStat && destStat.isFile() && !force) { return; } - const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path2.join(dest, path2.basename(source)) : dest; + const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path3.join(dest, path3.basename(source)) : dest; if (!(yield ioUtil.exists(source))) { throw new Error(`no such file or directory: ${source}`); } @@ -49248,7 +49248,7 @@ var require_io2 = __commonJS({ yield cpDirRecursive(source, newDest, 0, force); } } else { - if (path2.relative(source, newDest) === "") { + if (path3.relative(source, newDest) === "") { throw new Error(`'${newDest}' and '${source}' are the same file`); } yield copyFile2(source, newDest, force); @@ -49261,7 +49261,7 @@ var require_io2 = __commonJS({ if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { - dest = path2.join(dest, path2.basename(source)); + dest = path3.join(dest, path3.basename(source)); destExists = yield ioUtil.exists(dest); } if (destExists) { @@ -49272,7 +49272,7 @@ var require_io2 = __commonJS({ } } } - yield mkdirP(path2.dirname(dest)); + yield mkdirP(path3.dirname(dest)); yield ioUtil.rename(source, dest); }); } @@ -49335,7 +49335,7 @@ var require_io2 = __commonJS({ } const extensions = []; if (ioUtil.IS_WINDOWS && process.env["PATHEXT"]) { - for (const extension of process.env["PATHEXT"].split(path2.delimiter)) { + for (const extension of process.env["PATHEXT"].split(path3.delimiter)) { if (extension) { extensions.push(extension); } @@ -49348,12 +49348,12 @@ var require_io2 = __commonJS({ } return []; } - if (tool.includes(path2.sep)) { + if (tool.includes(path3.sep)) { return []; } const directories = []; if (process.env.PATH) { - for (const p of process.env.PATH.split(path2.delimiter)) { + for (const p of process.env.PATH.split(path3.delimiter)) { if (p) { directories.push(p); } @@ -49361,7 +49361,7 @@ var require_io2 = __commonJS({ } const matches = []; for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path2.join(directory, tool), extensions); + const filePath = yield ioUtil.tryGetExecutablePath(path3.join(directory, tool), extensions); if (filePath) { matches.push(filePath); } @@ -49477,7 +49477,7 @@ var require_toolrunner2 = __commonJS({ var os2 = __importStar2(require("os")); var events = __importStar2(require("events")); var child = __importStar2(require("child_process")); - var path2 = __importStar2(require("path")); + var path3 = __importStar2(require("path")); var io4 = __importStar2(require_io2()); var ioUtil = __importStar2(require_io_util2()); var timers_1 = require("timers"); @@ -49692,7 +49692,7 @@ var require_toolrunner2 = __commonJS({ exec() { return __awaiter2(this, void 0, void 0, function* () { if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { - this.toolPath = path2.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + this.toolPath = path3.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } this.toolPath = yield io4.which(this.toolPath, true); return new Promise((resolve2, reject) => __awaiter2(this, void 0, void 0, function* () { @@ -50192,7 +50192,7 @@ var require_core2 = __commonJS({ var file_command_1 = require_file_command2(); var utils_1 = require_utils5(); var os2 = __importStar2(require("os")); - var path2 = __importStar2(require("path")); + var path3 = __importStar2(require("path")); var oidc_utils_1 = require_oidc_utils2(); var ExitCode; (function(ExitCode2) { @@ -50220,7 +50220,7 @@ var require_core2 = __commonJS({ } else { (0, command_1.issueCommand)("add-path", {}, inputPath); } - process.env["PATH"] = `${inputPath}${path2.delimiter}${process.env["PATH"]}`; + process.env["PATH"] = `${inputPath}${path3.delimiter}${process.env["PATH"]}`; } exports2.addPath = addPath; function getInput2(name, options) { @@ -50463,7 +50463,7 @@ var require_internal_path_helper = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; - var path2 = __importStar2(require("path")); + var path3 = __importStar2(require("path")); var assert_1 = __importDefault2(require("assert")); var IS_WINDOWS = process.platform === "win32"; function dirname(p) { @@ -50471,7 +50471,7 @@ var require_internal_path_helper = __commonJS({ if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { return p; } - let result = path2.dirname(p); + let result = path3.dirname(p); if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { result = safeTrimTrailingSeparator(result); } @@ -50509,7 +50509,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 += path2.sep; + root += path3.sep; } return root + itemPath; } @@ -50547,10 +50547,10 @@ var require_internal_path_helper = __commonJS({ return ""; } p = normalizeSeparators(p); - if (!p.endsWith(path2.sep)) { + if (!p.endsWith(path3.sep)) { return p; } - if (p === path2.sep) { + if (p === path3.sep) { return p; } if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { @@ -50887,7 +50887,7 @@ var require_minimatch = __commonJS({ "node_modules/minimatch/minimatch.js"(exports2, module2) { module2.exports = minimatch; minimatch.Minimatch = Minimatch; - var path2 = (function() { + var path3 = (function() { try { return require("path"); } catch (e) { @@ -50895,7 +50895,7 @@ var require_minimatch = __commonJS({ })() || { sep: "/" }; - minimatch.sep = path2.sep; + minimatch.sep = path3.sep; var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; var expand2 = require_brace_expansion(); var plTypes = { @@ -50984,8 +50984,8 @@ var require_minimatch = __commonJS({ assertValidPattern(pattern); if (!options) options = {}; pattern = pattern.trim(); - if (!options.allowWindowsEscape && path2.sep !== "/") { - pattern = pattern.split(path2.sep).join("/"); + if (!options.allowWindowsEscape && path3.sep !== "/") { + pattern = pattern.split(path3.sep).join("/"); } this.options = options; this.set = []; @@ -51354,8 +51354,8 @@ var require_minimatch = __commonJS({ if (this.empty) return f === ""; if (f === "/" && partial) return true; var options = this.options; - if (path2.sep !== "/") { - f = f.split(path2.sep).join("/"); + if (path3.sep !== "/") { + f = f.split(path3.sep).join("/"); } f = f.split(slashSplit); this.debug(this.pattern, "split", f); @@ -51491,7 +51491,7 @@ var require_internal_path = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Path = void 0; - var path2 = __importStar2(require("path")); + var path3 = __importStar2(require("path")); var pathHelper = __importStar2(require_internal_path_helper()); var assert_1 = __importDefault2(require("assert")); var IS_WINDOWS = process.platform === "win32"; @@ -51506,12 +51506,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(path2.sep); + this.segments = itemPath.split(path3.sep); } else { let remaining = itemPath; let dir = pathHelper.dirname(remaining); while (dir !== remaining) { - const basename = path2.basename(remaining); + const basename = path3.basename(remaining); this.segments.unshift(basename); remaining = dir; dir = pathHelper.dirname(remaining); @@ -51529,7 +51529,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(path2.sep), `Parameter 'itemPath' contains unexpected path separators`); + (0, assert_1.default)(!segment.includes(path3.sep), `Parameter 'itemPath' contains unexpected path separators`); this.segments.push(segment); } } @@ -51540,12 +51540,12 @@ var require_internal_path = __commonJS({ */ toString() { let result = this.segments[0]; - let skipSlash = result.endsWith(path2.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); + let skipSlash = result.endsWith(path3.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); for (let i = 1; i < this.segments.length; i++) { if (skipSlash) { skipSlash = false; } else { - result += path2.sep; + result += path3.sep; } result += this.segments[i]; } @@ -51593,7 +51593,7 @@ var require_internal_pattern = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Pattern = void 0; var os2 = __importStar2(require("os")); - var path2 = __importStar2(require("path")); + var path3 = __importStar2(require("path")); var pathHelper = __importStar2(require_internal_path_helper()); var assert_1 = __importDefault2(require("assert")); var minimatch_1 = require_minimatch(); @@ -51622,7 +51622,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(path2.sep); + this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path3.sep); pattern = pathHelper.safeTrimTrailingSeparator(pattern); let foundGlob = false; const searchSegments = this.segments.map((x) => _Pattern.getLiteral(x)).filter((x) => !foundGlob && !(foundGlob = x === "")); @@ -51646,8 +51646,8 @@ var require_internal_pattern = __commonJS({ match(itemPath) { if (this.segments[this.segments.length - 1] === "**") { itemPath = pathHelper.normalizeSeparators(itemPath); - if (!itemPath.endsWith(path2.sep) && this.isImplicitPattern === false) { - itemPath = `${itemPath}${path2.sep}`; + if (!itemPath.endsWith(path3.sep) && this.isImplicitPattern === false) { + itemPath = `${itemPath}${path3.sep}`; } } else { itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); @@ -51682,9 +51682,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(`.${path2.sep}`)) { + if (pattern === "." || pattern.startsWith(`.${path3.sep}`)) { pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); - } else if (pattern === "~" || pattern.startsWith(`~${path2.sep}`)) { + } else if (pattern === "~" || pattern.startsWith(`~${path3.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}'`); @@ -51768,8 +51768,8 @@ var require_internal_search_state = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.SearchState = void 0; var SearchState = class { - constructor(path2, level) { - this.path = path2; + constructor(path3, level) { + this.path = path3; this.level = level; } }; @@ -51893,9 +51893,9 @@ var require_internal_globber = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.DefaultGlobber = void 0; var core12 = __importStar2(require_core2()); - var fs = __importStar2(require("fs")); + var fs2 = __importStar2(require("fs")); var globOptionsHelper = __importStar2(require_internal_glob_options_helper()); - var path2 = __importStar2(require("path")); + var path3 = __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(); @@ -51947,7 +51947,7 @@ var require_internal_globber = __commonJS({ for (const searchPath of patternHelper.getSearchPaths(patterns)) { core12.debug(`Search path '${searchPath}'`); try { - yield __await2(fs.promises.lstat(searchPath)); + yield __await2(fs2.promises.lstat(searchPath)); } catch (err) { if (err.code === "ENOENT") { continue; @@ -51971,7 +51971,7 @@ var require_internal_globber = __commonJS({ if (!stats) { continue; } - if (options.excludeHiddenFiles && path2.basename(item.path).match(/^\./)) { + if (options.excludeHiddenFiles && path3.basename(item.path).match(/^\./)) { continue; } if (stats.isDirectory()) { @@ -51981,7 +51981,7 @@ var require_internal_globber = __commonJS({ continue; } const childLevel = item.level + 1; - const childItems = (yield __await2(fs.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path2.join(item.path, x), childLevel)); + const childItems = (yield __await2(fs2.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path3.join(item.path, x), childLevel)); stack.push(...childItems.reverse()); } else if (match & internal_match_kind_1.MatchKind.File) { yield yield __await2(item.path); @@ -52016,7 +52016,7 @@ var require_internal_globber = __commonJS({ let stats; if (options.followSymbolicLinks) { try { - stats = yield fs.promises.stat(item.path); + stats = yield fs2.promises.stat(item.path); } catch (err) { if (err.code === "ENOENT") { if (options.omitBrokenSymbolicLinks) { @@ -52028,10 +52028,10 @@ var require_internal_globber = __commonJS({ throw err; } } else { - stats = yield fs.promises.lstat(item.path); + stats = yield fs2.promises.lstat(item.path); } if (stats.isDirectory() && options.followSymbolicLinks) { - const realPath = yield fs.promises.realpath(item.path); + const realPath = yield fs2.promises.realpath(item.path); while (traversalChain.length >= item.level) { traversalChain.pop(); } @@ -52130,10 +52130,10 @@ var require_internal_hash_files = __commonJS({ exports2.hashFiles = void 0; var crypto2 = __importStar2(require("crypto")); var core12 = __importStar2(require_core2()); - var fs = __importStar2(require("fs")); + var fs2 = __importStar2(require("fs")); var stream = __importStar2(require("stream")); var util = __importStar2(require("util")); - var path2 = __importStar2(require("path")); + var path3 = __importStar2(require("path")); function hashFiles(globber, currentWorkspace, verbose = false) { var _a, e_1, _b, _c; var _d; @@ -52149,17 +52149,17 @@ var require_internal_hash_files = __commonJS({ _e = false; const file = _c; writeDelegate(file); - if (!file.startsWith(`${githubWorkspace}${path2.sep}`)) { + if (!file.startsWith(`${githubWorkspace}${path3.sep}`)) { writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); continue; } - if (fs.statSync(file).isDirectory()) { + if (fs2.statSync(file).isDirectory()) { writeDelegate(`Skip directory '${file}'.`); continue; } const hash = crypto2.createHash("sha256"); const pipeline = util.promisify(stream.pipeline); - yield pipeline(fs.createReadStream(file), hash); + yield pipeline(fs2.createReadStream(file), hash); result.write(hash.digest()); count++; if (!hasMatch) { @@ -53536,8 +53536,8 @@ var require_cacheUtils = __commonJS({ var glob = __importStar2(require_glob()); var io4 = __importStar2(require_io()); var crypto2 = __importStar2(require("crypto")); - var fs = __importStar2(require("fs")); - var path2 = __importStar2(require("path")); + var fs2 = __importStar2(require("fs")); + var path3 = __importStar2(require("path")); var semver6 = __importStar2(require_semver3()); var util = __importStar2(require("util")); var constants_1 = require_constants7(); @@ -53557,15 +53557,15 @@ var require_cacheUtils = __commonJS({ baseLocation = "/home"; } } - tempDirectory = path2.join(baseLocation, "actions", "temp"); + tempDirectory = path3.join(baseLocation, "actions", "temp"); } - const dest = path2.join(tempDirectory, crypto2.randomUUID()); + const dest = path3.join(tempDirectory, crypto2.randomUUID()); yield io4.mkdirP(dest); return dest; }); } function getArchiveFileSizeInBytes(filePath) { - return fs.statSync(filePath).size; + return fs2.statSync(filePath).size; } function resolvePaths(patterns) { return __awaiter2(this, void 0, void 0, function* () { @@ -53581,7 +53581,7 @@ var require_cacheUtils = __commonJS({ _c = _g.value; _e = false; const file = _c; - const relativeFile = path2.relative(workspace, file).replace(new RegExp(`\\${path2.sep}`, "g"), "/"); + const relativeFile = path3.relative(workspace, file).replace(new RegExp(`\\${path3.sep}`, "g"), "/"); core12.debug(`Matched: ${relativeFile}`); if (relativeFile === "") { paths.push("."); @@ -53603,7 +53603,7 @@ var require_cacheUtils = __commonJS({ } function unlinkFile(filePath) { return __awaiter2(this, void 0, void 0, function* () { - return util.promisify(fs.unlink)(filePath); + return util.promisify(fs2.unlink)(filePath); }); } function getVersion(app_1) { @@ -53645,7 +53645,7 @@ var require_cacheUtils = __commonJS({ } function getGnuTarPathOnWindows() { return __awaiter2(this, void 0, void 0, function* () { - if (fs.existsSync(constants_1.GnuTarPathOnWindows)) { + if (fs2.existsSync(constants_1.GnuTarPathOnWindows)) { return constants_1.GnuTarPathOnWindows; } const versionOutput = yield getVersion("tar"); @@ -54108,13 +54108,13 @@ function __disposeResources(env) { } return next(); } -function __rewriteRelativeImportExtension(path2, preserveJsx) { - if (typeof path2 === "string" && /^\.\.?\//.test(path2)) { - return path2.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { +function __rewriteRelativeImportExtension(path3, preserveJsx) { + if (typeof path3 === "string" && /^\.\.?\//.test(path3)) { + return path3.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 path2; + return path3; } var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default; var init_tslib_es6 = __esm({ @@ -58528,8 +58528,8 @@ var require_getClient = __commonJS({ } const { allowInsecureConnection, httpClient } = clientOptions; const endpointUrl = clientOptions.endpoint ?? endpoint2; - const client = (path2, ...args) => { - const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path2, args, { allowInsecureConnection, ...requestOptions }); + const client = (path3, ...args) => { + const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path3, args, { allowInsecureConnection, ...requestOptions }); return { get: (requestOptions = {}) => { return buildOperation("GET", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); @@ -62400,15 +62400,15 @@ var require_urlHelpers2 = __commonJS({ let isAbsolutePath = false; let requestUrl = replaceAll(baseUri, urlReplacements); if (operationSpec.path) { - let path2 = replaceAll(operationSpec.path, urlReplacements); - if (operationSpec.path === "/{nextLink}" && path2.startsWith("/")) { - path2 = path2.substring(1); + let path3 = replaceAll(operationSpec.path, urlReplacements); + if (operationSpec.path === "/{nextLink}" && path3.startsWith("/")) { + path3 = path3.substring(1); } - if (isAbsoluteUrl(path2)) { - requestUrl = path2; + if (isAbsoluteUrl(path3)) { + requestUrl = path3; isAbsolutePath = true; } else { - requestUrl = appendPath(requestUrl, path2); + requestUrl = appendPath(requestUrl, path3); } } const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject); @@ -62454,9 +62454,9 @@ var require_urlHelpers2 = __commonJS({ } const searchStart = pathToAppend.indexOf("?"); if (searchStart !== -1) { - const path2 = pathToAppend.substring(0, searchStart); + const path3 = pathToAppend.substring(0, searchStart); const search = pathToAppend.substring(searchStart + 1); - newPath = newPath + path2; + newPath = newPath + path3; if (search) { parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search; } @@ -64685,10 +64685,10 @@ var require_utils_common = __commonJS({ var constants_js_1 = require_constants10(); function escapeURLPath(url) { const urlParsed = new URL(url); - let path2 = urlParsed.pathname; - path2 = path2 || "/"; - path2 = escape2(path2); - urlParsed.pathname = path2; + let path3 = urlParsed.pathname; + path3 = path3 || "/"; + path3 = escape2(path3); + urlParsed.pathname = path3; return urlParsed.toString(); } function getProxyUriFromDevConnString(connectionString) { @@ -64773,9 +64773,9 @@ var require_utils_common = __commonJS({ } function appendToURLPath(url, name) { const urlParsed = new URL(url); - let path2 = urlParsed.pathname; - path2 = path2 ? path2.endsWith("/") ? `${path2}${name}` : `${path2}/${name}` : name; - urlParsed.pathname = path2; + let path3 = urlParsed.pathname; + path3 = path3 ? path3.endsWith("/") ? `${path3}${name}` : `${path3}/${name}` : name; + urlParsed.pathname = path3; return urlParsed.toString(); } function setURLParameter(url, name, value) { @@ -66002,9 +66002,9 @@ var require_StorageSharedKeyCredentialPolicy = __commonJS({ * @param request - */ getCanonicalizedResourceString(request2) { - const path2 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; + const path3 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path2}`; + canonicalizedResourceString += `/${this.factory.accountName}${path3}`; const queries = (0, utils_common_js_1.getURLQueries)(request2.url); const lowercaseQueries = {}; if (queries) { @@ -66743,10 +66743,10 @@ var require_utils_common2 = __commonJS({ var constants_js_1 = require_constants11(); function escapeURLPath(url) { const urlParsed = new URL(url); - let path2 = urlParsed.pathname; - path2 = path2 || "/"; - path2 = escape2(path2); - urlParsed.pathname = path2; + let path3 = urlParsed.pathname; + path3 = path3 || "/"; + path3 = escape2(path3); + urlParsed.pathname = path3; return urlParsed.toString(); } function getProxyUriFromDevConnString(connectionString) { @@ -66831,9 +66831,9 @@ var require_utils_common2 = __commonJS({ } function appendToURLPath(url, name) { const urlParsed = new URL(url); - let path2 = urlParsed.pathname; - path2 = path2 ? path2.endsWith("/") ? `${path2}${name}` : `${path2}/${name}` : name; - urlParsed.pathname = path2; + let path3 = urlParsed.pathname; + path3 = path3 ? path3.endsWith("/") ? `${path3}${name}` : `${path3}/${name}` : name; + urlParsed.pathname = path3; return urlParsed.toString(); } function setURLParameter(url, name, value) { @@ -67754,9 +67754,9 @@ var require_StorageSharedKeyCredentialPolicy2 = __commonJS({ * @param request - */ getCanonicalizedResourceString(request2) { - const path2 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; + const path3 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path2}`; + canonicalizedResourceString += `/${this.factory.accountName}${path3}`; const queries = (0, utils_common_js_1.getURLQueries)(request2.url); const lowercaseQueries = {}; if (queries) { @@ -68386,9 +68386,9 @@ var require_StorageSharedKeyCredentialPolicyV2 = __commonJS({ return canonicalizedHeadersStringToSign; } function getCanonicalizedResourceString(request2) { - const path2 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; + const path3 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${options.accountName}${path2}`; + canonicalizedResourceString += `/${options.accountName}${path3}`; const queries = (0, utils_common_js_1.getURLQueries)(request2.url); const lowercaseQueries = {}; if (queries) { @@ -68733,9 +68733,9 @@ var require_StorageSharedKeyCredentialPolicyV22 = __commonJS({ return canonicalizedHeadersStringToSign; } function getCanonicalizedResourceString(request2) { - const path2 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; + const path3 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${options.accountName}${path2}`; + canonicalizedResourceString += `/${options.accountName}${path3}`; const queries = (0, utils_common_js_1.getURLQueries)(request2.url); const lowercaseQueries = {}; if (queries) { @@ -90390,8 +90390,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 path2 = (0, utils_common_js_1.getURLPath)(subRequest.url); - if (!path2 || path2 === "") { + const path3 = (0, utils_common_js_1.getURLPath)(subRequest.url); + if (!path3 || path3 === "") { throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`); } } @@ -90469,8 +90469,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 path2 = (0, utils_common_js_1.getURLPath)(url); - if (path2 && path2 !== "/") { + const path3 = (0, utils_common_js_1.getURLPath)(url); + if (path3 && path3 !== "/") { this.serviceOrContainerContext = storageClientContext.container; } else { this.serviceOrContainerContext = storageClientContext.service; @@ -93757,7 +93757,7 @@ var require_downloadUtils = __commonJS({ var http_client_1 = require_lib(); var storage_blob_1 = require_commonjs15(); var buffer = __importStar2(require("buffer")); - var fs = __importStar2(require("fs")); + var fs2 = __importStar2(require("fs")); var stream = __importStar2(require("stream")); var util = __importStar2(require("util")); var utils = __importStar2(require_cacheUtils()); @@ -93868,7 +93868,7 @@ var require_downloadUtils = __commonJS({ exports2.DownloadProgress = DownloadProgress; function downloadCacheHttpClient(archiveLocation, archivePath) { return __awaiter2(this, void 0, void 0, function* () { - const writeStream = fs.createWriteStream(archivePath); + const writeStream = fs2.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); @@ -93893,7 +93893,7 @@ var require_downloadUtils = __commonJS({ function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options) { return __awaiter2(this, void 0, void 0, function* () { var _a; - const archiveDescriptor = yield fs.promises.open(archivePath, "w"); + const archiveDescriptor = yield fs2.promises.open(archivePath, "w"); const httpClient = new http_client_1.HttpClient("actions/cache", void 0, { socketTimeout: options.timeoutInMs, keepAlive: true @@ -94009,7 +94009,7 @@ var require_downloadUtils = __commonJS({ } else { const maxSegmentSize = Math.min(134217728, buffer.constants.MAX_LENGTH); const downloadProgress = new DownloadProgress(contentLength); - const fd = fs.openSync(archivePath, "w"); + const fd = fs2.openSync(archivePath, "w"); try { downloadProgress.startDisplayTimer(); const controller = new abort_controller_1.AbortController(); @@ -94027,12 +94027,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)) { - fs.writeFileSync(fd, result); + fs2.writeFileSync(fd, result); } } } finally { downloadProgress.stopDisplayTimer(); - fs.closeSync(fd); + fs2.closeSync(fd); } } }); @@ -94354,7 +94354,7 @@ var require_cacheHttpClient = __commonJS({ var core12 = __importStar2(require_core()); var http_client_1 = require_lib(); var auth_1 = require_auth(); - var fs = __importStar2(require("fs")); + var fs2 = __importStar2(require("fs")); var url_1 = require("url"); var utils = __importStar2(require_cacheUtils()); var uploadUtils_1 = require_uploadUtils(); @@ -94489,7 +94489,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 = fs.openSync(archivePath, "r"); + const fd = fs2.openSync(archivePath, "r"); const uploadOptions = (0, options_1.getUploadOptions)(options); const concurrency = utils.assertDefined("uploadConcurrency", uploadOptions.uploadConcurrency); const maxChunkSize = utils.assertDefined("uploadChunkSize", uploadOptions.uploadChunkSize); @@ -94503,7 +94503,7 @@ Other caches with similar key:`); const start = offset; const end = offset + chunkSize - 1; offset += maxChunkSize; - yield uploadChunk(httpClient, resourceUrl, () => fs.createReadStream(archivePath, { + yield uploadChunk(httpClient, resourceUrl, () => fs2.createReadStream(archivePath, { fd, start, end, @@ -94514,7 +94514,7 @@ Other caches with similar key:`); } }))); } finally { - fs.closeSync(fd); + fs2.closeSync(fd); } return; }); @@ -99779,7 +99779,7 @@ var require_tar = __commonJS({ var exec_1 = require_exec(); var io4 = __importStar2(require_io()); var fs_1 = require("fs"); - var path2 = __importStar2(require("path")); + var path3 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); var constants_1 = require_constants7(); var IS_WINDOWS = process.platform === "win32"; @@ -99825,13 +99825,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(`\\${path2.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path2.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path2.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); + args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path3.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path3.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path3.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); break; case "extract": - args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path2.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path2.sep}`, "g"), "/")); + args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path3.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path3.sep}`, "g"), "/")); break; case "list": - args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path2.sep}`, "g"), "/"), "-P"); + args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path3.sep}`, "g"), "/"), "-P"); break; } if (tarPath.type === constants_1.ArchiveToolType.GNU) { @@ -99877,7 +99877,7 @@ var require_tar = __commonJS({ return BSD_TAR_ZSTD ? [ "zstd -d --long=30 --force -o", constants_1.TarFilename, - archivePath.replace(new RegExp(`\\${path2.sep}`, "g"), "/") + archivePath.replace(new RegExp(`\\${path3.sep}`, "g"), "/") ] : [ "--use-compress-program", IS_WINDOWS ? '"zstd -d --long=30"' : "unzstd --long=30" @@ -99886,7 +99886,7 @@ var require_tar = __commonJS({ return BSD_TAR_ZSTD ? [ "zstd -d --force -o", constants_1.TarFilename, - archivePath.replace(new RegExp(`\\${path2.sep}`, "g"), "/") + archivePath.replace(new RegExp(`\\${path3.sep}`, "g"), "/") ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -d"' : "unzstd"]; default: return ["-z"]; @@ -99901,7 +99901,7 @@ var require_tar = __commonJS({ case constants_1.CompressionMethod.Zstd: return BSD_TAR_ZSTD ? [ "zstd -T0 --long=30 --force -o", - cacheFileName.replace(new RegExp(`\\${path2.sep}`, "g"), "/"), + cacheFileName.replace(new RegExp(`\\${path3.sep}`, "g"), "/"), constants_1.TarFilename ] : [ "--use-compress-program", @@ -99910,7 +99910,7 @@ var require_tar = __commonJS({ case constants_1.CompressionMethod.ZstdWithoutLong: return BSD_TAR_ZSTD ? [ "zstd -T0 --force -o", - cacheFileName.replace(new RegExp(`\\${path2.sep}`, "g"), "/"), + cacheFileName.replace(new RegExp(`\\${path3.sep}`, "g"), "/"), constants_1.TarFilename ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -T0"' : "zstdmt"]; default: @@ -99948,7 +99948,7 @@ var require_tar = __commonJS({ } function createTar(archiveFolder, sourceDirectories, compressionMethod) { return __awaiter2(this, void 0, void 0, function* () { - (0, fs_1.writeFileSync)(path2.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); + (0, fs_1.writeFileSync)(path3.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); const commands = yield getCommands(compressionMethod, "create"); yield execCommands(commands, archiveFolder); }); @@ -100030,7 +100030,7 @@ var require_cache4 = __commonJS({ exports2.restoreCache = restoreCache3; exports2.saveCache = saveCache3; var core12 = __importStar2(require_core()); - var path2 = __importStar2(require("path")); + var path3 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); var cacheHttpClient = __importStar2(require_cacheHttpClient()); var cacheTwirpClient = __importStar2(require_cacheTwirpClient()); @@ -100125,7 +100125,7 @@ var require_cache4 = __commonJS({ core12.info("Lookup only - skipping download"); return cacheEntry.cacheKey; } - archivePath = path2.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + archivePath = path3.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); core12.debug(`Archive Path: ${archivePath}`); yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); if (core12.isDebug()) { @@ -100194,7 +100194,7 @@ var require_cache4 = __commonJS({ core12.info("Lookup only - skipping download"); return response.matchedKey; } - archivePath = path2.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + archivePath = path3.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); @@ -100256,7 +100256,7 @@ var require_cache4 = __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 = path2.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + const archivePath = path3.join(archiveFolder, utils.getCacheFileName(compressionMethod)); core12.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); @@ -100320,7 +100320,7 @@ var require_cache4 = __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 = path2.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + const archivePath = path3.join(archiveFolder, utils.getCacheFileName(compressionMethod)); core12.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); @@ -100396,7 +100396,7 @@ var require_cache4 = __commonJS({ // src/start-proxy-action.ts var import_child_process = require("child_process"); -var path = __toESM(require("path")); +var path2 = __toESM(require("path")); var core11 = __toESM(require_core()); var toolcache = __toESM(require_tool_cache()); var import_node_forge = __toESM(require_lib2()); @@ -100420,21 +100420,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 fs = options.fs || await import("node:fs/promises"); + const fs2 = 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 fs.lstat(itemPath, { bigint: true }) : await fs.lstat(itemPath, { bigint: true }).catch((error3) => errors.push(error3)); + const stats = returnType.strict ? await fs2.lstat(itemPath, { bigint: true }) : await fs2.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 fs.readdir(itemPath) : await fs.readdir(itemPath).catch((error3) => errors.push(error3)); + const directoryItems = returnType.strict ? await fs2.readdir(itemPath) : await fs2.readdir(itemPath).catch((error3) => errors.push(error3)); if (typeof directoryItems !== "object") return; await Promise.all( directoryItems.map( @@ -103205,6 +103205,62 @@ function getWorkflowRunAttempt() { function isSelfHostedRunner() { return process.env.RUNNER_ENVIRONMENT === "self-hosted"; } +function prettyPrintInvocation(cmd, args) { + return [cmd, ...args].map((x) => x.includes(" ") ? `'${x}'` : x).join(" "); +} +var CommandInvocationError = class extends Error { + constructor(cmd, args, exitCode, stderr, stdout = "") { + const prettyCommand = prettyPrintInvocation(cmd, args); + const lastLine = ensureEndsInPeriod( + stderr.trim().split("\n").pop()?.trim() || "n/a" + ); + super( + `Failed to run "${prettyCommand}". Exit code was ${exitCode} and last log line was: ${lastLine} See the logs for more details.` + ); + this.cmd = cmd; + this.args = args; + this.exitCode = exitCode; + this.stderr = stderr; + this.stdout = stdout; + } +}; +function ensureEndsInPeriod(text) { + return text[text.length - 1] === "." ? text : `${text}.`; +} +var MAX_STDERR_BUFFER_SIZE = 2e4; +async function runTool(cmd, args = [], opts = {}) { + let stdout = ""; + let stderr = ""; + if (!opts.noStreamStdout) { + process.stdout.write(`[command]${cmd} ${args.join(" ")} +`); + } + const exitCode = await new toolrunner.ToolRunner(cmd, args, { + ignoreReturnCode: true, + listeners: { + stdout: (data) => { + stdout += data.toString("utf8"); + if (!opts.noStreamStdout) { + process.stdout.write(data); + } + }, + stderr: (data) => { + let readStartIndex = 0; + if (data.length - MAX_STDERR_BUFFER_SIZE > 0) { + readStartIndex = data.length - MAX_STDERR_BUFFER_SIZE + 1; + } + stderr += data.toString("utf8", readStartIndex); + process.stdout.write(data); + } + }, + silent: true, + ...opts.stdin ? { input: Buffer.from(opts.stdin || "") } : {} + }).exec(); + if (exitCode !== 0) { + throw new CommandInvocationError(cmd, args, exitCode, stderr, stdout); + } + return stdout; +} var persistedInputsKey = "persisted_inputs"; var persistInputs = function() { const inputEnvironmentVariables = Object.entries(process.env).filter( @@ -103394,6 +103450,8 @@ function getActionsLogger() { } // src/start-proxy.ts +var fs = __toESM(require("fs")); +var path = __toESM(require("path")); var core7 = __toESM(require_core()); // src/defaults.json @@ -103555,6 +103613,31 @@ async function getDownloadUrl(logger) { version: UPDATEJOB_PROXY_VERSION }; } +var certPath = "/usr/local/share/ca-certificates/"; +async function installProxyCertificate(logger, cert) { + if (process.platform === "linux" && !isSelfHostedRunner()) { + try { + if (!fs.existsSync(certPath)) { + logger.debug( + "Certificate path does not exist in the expected location." + ); + return; + } + const certSubPath = path.join(certPath, "codeql-action"); + fs.mkdirSync(certSubPath); + const certFilePath = path.join(certSubPath, "proxy.crt"); + fs.writeFileSync(certFilePath, cert); + await runTool("sudo", ["update-ca-certificates"]); + logger.info( + `Successfully installed proxy certificate to ${certFilePath}` + ); + } catch (e) { + logger.info( + `Unable to install proxy certificate system-wide: ${getErrorMessage(e)}` + ); + } + } +} // src/status-report.ts var os = __toESM(require("os")); @@ -104197,7 +104280,7 @@ async function run(startedAt) { try { persistInputs(); const tempDir = getTemporaryDirectory(); - const proxyLogFilePath = path.resolve(tempDir, "proxy.log"); + const proxyLogFilePath = path2.resolve(tempDir, "proxy.log"); core11.saveState("proxy-log-file", proxyLogFilePath); const languageInput = getOptionalInput("language"); language = languageInput ? parseLanguage(languageInput) : void 0; @@ -104271,6 +104354,7 @@ async function startProxy(binPath, config, logFilePath, logger) { let tries = 5; let subprocessError = void 0; while (tries-- > 0 && !subprocess && !subprocessError) { + logger.info(`Attempting to start proxy on ${host}:${port}...`); subprocess = (0, import_child_process.spawn)( binPath, ["-addr", `${host}:${port}`, "-config", "-", "-logfile", logFilePath], @@ -104308,6 +104392,7 @@ async function startProxy(binPath, config, logFilePath, logger) { url: credential.url })); core11.setOutput("proxy_urls", JSON.stringify(registry_urls)); + await installProxyCertificate(logger, config.ca.cert); } async function getProxyBinaryPath(logger) { const proxyFileName = process.platform === "win32" ? `${UPDATEJOB_PROXY}.exe` : UPDATEJOB_PROXY; @@ -104335,7 +104420,7 @@ async function getProxyBinaryPath(logger) { proxyInfo.version ); } - proxyBin = path.join(proxyBin, proxyFileName); + proxyBin = path2.join(proxyBin, proxyFileName); return proxyBin; } function credentialToStr(c) { diff --git a/src/start-proxy-action.ts b/src/start-proxy-action.ts index b682d07d30..747076698b 100644 --- a/src/start-proxy-action.ts +++ b/src/start-proxy-action.ts @@ -14,6 +14,7 @@ import { Credential, getCredentials, getDownloadUrl, + installProxyCertificate, parseLanguage, UPDATEJOB_PROXY, } from "./start-proxy"; @@ -220,6 +221,15 @@ async function runWrapper() { } } +/** + * Starts the proxy process with the binary at `binPath` using `config` on a random + * port (but always starting with 49152). + * + * @param binPath The path to the proxy binary. + * @param config The configuration for the proxy. + * @param logFilePath The path for the proxy log file. + * @param logger The logger to use. + */ async function startProxy( binPath: string, config: ProxyConfig, @@ -232,6 +242,7 @@ async function startProxy( let tries = 5; let subprocessError: Error | undefined = undefined; while (tries-- > 0 && !subprocess && !subprocessError) { + logger.info(`Attempting to start proxy on ${host}:${port}...`); subprocess = spawn( binPath, ["-addr", `${host}:${port}`, "-config", "-", "-logfile", logFilePath], @@ -275,6 +286,8 @@ async function startProxy( url: credential.url, })); core.setOutput("proxy_urls", JSON.stringify(registry_urls)); + + await installProxyCertificate(logger, config.ca.cert); } async function getProxyBinaryPath(logger: Logger): Promise { diff --git a/src/start-proxy.ts b/src/start-proxy.ts index 2a082ed628..6f441710e1 100644 --- a/src/start-proxy.ts +++ b/src/start-proxy.ts @@ -1,5 +1,9 @@ +import * as fs from "fs"; +import * as path from "path"; + import * as core from "@actions/core"; +import { isSelfHostedRunner, runTool } from "./actions-util"; import { getApiClient } from "./api-client"; import * as defaults from "./defaults.json"; import { KnownLanguage } from "./languages"; @@ -256,3 +260,49 @@ export async function getDownloadUrl( version: UPDATEJOB_PROXY_VERSION, }; } + +// The standard path for certificates on Ubuntu. +const certPath = "/usr/local/share/ca-certificates/"; + +/** + * If we are running on a GitHub-hosted Ubuntu runner, this function attempts to + * install the `cert` into the system-wide certificate store. + * + * This function does nothing on other platforms. + * + * @param logger The logger to use. + * @param cert The certificate to install. + */ +export async function installProxyCertificate(logger: Logger, cert: string) { + // On GitHub-hosted linux runners, install the certificate system-wide. + if (process.platform === "linux" && !isSelfHostedRunner()) { + try { + // Don't continue if the certificate path doesn't already exist in the expected location. + if (!fs.existsSync(certPath)) { + logger.debug( + "Certificate path does not exist in the expected location.", + ); + return; + } + + // Create a sub-directory for our certificates. + const certSubPath = path.join(certPath, "codeql-action"); + fs.mkdirSync(certSubPath); + + // Write the certificate + const certFilePath = path.join(certSubPath, "proxy.crt"); + fs.writeFileSync(certFilePath, cert); + + // Update the certificates. + await runTool("sudo", ["update-ca-certificates"]); + + logger.info( + `Successfully installed proxy certificate to ${certFilePath}`, + ); + } catch (e) { + logger.info( + `Unable to install proxy certificate system-wide: ${getErrorMessage(e)}`, + ); + } + } +}