diff --git a/build/main.js b/build/main.js index 5b36ab9..32977a9 100644 --- a/build/main.js +++ b/build/main.js @@ -33,6 +33,287 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge mod )); +// node_modules/@actions/core/lib/utils.js +var require_utils = __commonJS({ + "node_modules/@actions/core/lib/utils.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.toCommandValue = toCommandValue; + exports.toCommandProperties = toCommandProperties; + function toCommandValue(input) { + if (input === null || input === void 0) { + return ""; + } else if (typeof input === "string" || input instanceof String) { + return input; + } + return JSON.stringify(input); + } + function toCommandProperties(annotationProperties) { + if (!Object.keys(annotationProperties).length) { + return {}; + } + return { + title: annotationProperties.title, + file: annotationProperties.file, + line: annotationProperties.startLine, + endLine: annotationProperties.endLine, + col: annotationProperties.startColumn, + endColumn: annotationProperties.endColumn + }; + } + } +}); + +// node_modules/@actions/core/lib/command.js +var require_command = __commonJS({ + "node_modules/@actions/core/lib/command.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); + }) : (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + })); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = exports && exports.__importStar || /* @__PURE__ */ (function() { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function(o2) { + var ar = []; + for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + } + __setModuleDefault(result, mod); + return result; + }; + })(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.issueCommand = issueCommand; + exports.issue = issue; + var os = __importStar(__require("os")); + var utils_1 = require_utils(); + function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os.EOL); + } + function issue(name, message = "") { + issueCommand(name, {}, message); + } + var CMD_STRING = "::"; + var Command = class { + constructor(command, properties, message) { + if (!command) { + command = "missing.command"; + } + this.command = command; + this.properties = properties; + this.message = message; + } + toString() { + let cmdStr = CMD_STRING + this.command; + if (this.properties && Object.keys(this.properties).length > 0) { + cmdStr += " "; + let first = true; + for (const key in this.properties) { + if (this.properties.hasOwnProperty(key)) { + const val = this.properties[key]; + if (val) { + if (first) { + first = false; + } else { + cmdStr += ","; + } + cmdStr += `${key}=${escapeProperty(val)}`; + } + } + } + } + cmdStr += `${CMD_STRING}${escapeData(this.message)}`; + return cmdStr; + } + }; + function escapeData(s) { + return (0, utils_1.toCommandValue)(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A"); + } + function escapeProperty(s) { + return (0, utils_1.toCommandValue)(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/:/g, "%3A").replace(/,/g, "%2C"); + } + } +}); + +// node_modules/@actions/core/lib/file-command.js +var require_file_command = __commonJS({ + "node_modules/@actions/core/lib/file-command.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); + }) : (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + })); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = exports && exports.__importStar || /* @__PURE__ */ (function() { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function(o2) { + var ar = []; + for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + } + __setModuleDefault(result, mod); + return result; + }; + })(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.issueFileCommand = issueFileCommand; + exports.prepareKeyValueMessage = prepareKeyValueMessage; + var crypto = __importStar(__require("crypto")); + var fs2 = __importStar(__require("fs")); + var os = __importStar(__require("os")); + var utils_1 = require_utils(); + function issueFileCommand(command, message) { + const filePath = process.env[`GITHUB_${command}`]; + if (!filePath) { + throw new Error(`Unable to find environment variable for file command ${command}`); + } + if (!fs2.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); + } + fs2.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os.EOL}`, { + encoding: "utf8" + }); + } + function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${crypto.randomUUID()}`; + const convertedValue = (0, utils_1.toCommandValue)(value); + if (key.includes(delimiter)) { + throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); + } + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); + } + return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`; + } + } +}); + +// node_modules/@actions/http-client/lib/proxy.js +var require_proxy = __commonJS({ + "node_modules/@actions/http-client/lib/proxy.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getProxyUrl = getProxyUrl; + exports.checkBypass = checkBypass; + function getProxyUrl(reqUrl) { + const usingSsl = reqUrl.protocol === "https:"; + if (checkBypass(reqUrl)) { + return void 0; + } + const proxyVar = (() => { + if (usingSsl) { + return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; + } else { + return process.env["http_proxy"] || process.env["HTTP_PROXY"]; + } + })(); + if (proxyVar) { + try { + return new DecodedURL(proxyVar); + } catch (_a) { + if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) + return new DecodedURL(`http://${proxyVar}`); + } + } else { + return void 0; + } + } + function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; + } + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; + } + const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; + if (!noProxy) { + return false; + } + let reqPort; + if (reqUrl.port) { + reqPort = Number(reqUrl.port); + } else if (reqUrl.protocol === "http:") { + reqPort = 80; + } else if (reqUrl.protocol === "https:") { + reqPort = 443; + } + const upperReqHosts = [reqUrl.hostname.toUpperCase()]; + if (typeof reqPort === "number") { + upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + } + for (const upperNoProxyItem of noProxy.split(",").map((x) => x.trim().toUpperCase()).filter((x) => x)) { + if (upperNoProxyItem === "*" || upperReqHosts.some((x) => x === upperNoProxyItem || x.endsWith(`.${upperNoProxyItem}`) || upperNoProxyItem.startsWith(".") && x.endsWith(`${upperNoProxyItem}`))) { + return true; + } + } + return false; + } + function isLoopbackAddress(host) { + const hostLower = host.toLowerCase(); + return hostLower === "localhost" || hostLower.startsWith("127.") || hostLower.startsWith("[::1]") || hostLower.startsWith("[0:0:0:0:0:0:0:1]"); + } + var DecodedURL = class extends URL { + constructor(url, base) { + super(url, base); + this._decodedUsername = decodeURIComponent(super.username); + this._decodedPassword = decodeURIComponent(super.password); + } + get username() { + return this._decodedUsername; + } + get password() { + return this._decodedPassword; + } + }; + } +}); + // node_modules/tunnel/lib/tunnel.js var require_tunnel = __commonJS({ "node_modules/tunnel/lib/tunnel.js"(exports) { @@ -44,28 +325,28 @@ var require_tunnel = __commonJS({ var events = __require("events"); var assert = __require("assert"); var util = __require("util"); - exports.httpOverHttp = httpOverHttp2; - exports.httpsOverHttp = httpsOverHttp2; - exports.httpOverHttps = httpOverHttps2; - exports.httpsOverHttps = httpsOverHttps2; - function httpOverHttp2(options) { + exports.httpOverHttp = httpOverHttp; + exports.httpsOverHttp = httpsOverHttp; + exports.httpOverHttps = httpOverHttps; + exports.httpsOverHttps = httpsOverHttps; + function httpOverHttp(options) { var agent = new TunnelingAgent(options); agent.request = http.request; return agent; } - function httpsOverHttp2(options) { + function httpsOverHttp(options) { var agent = new TunnelingAgent(options); agent.request = http.request; agent.createSocket = createSecureSocket; agent.defaultPort = 443; return agent; } - function httpOverHttps2(options) { + function httpOverHttps(options) { var agent = new TunnelingAgent(options); agent.request = https.request; return agent; } - function httpsOverHttps2(options) { + function httpsOverHttps(options) { var agent = new TunnelingAgent(options); agent.request = https.request; agent.createSocket = createSecureSocket; @@ -136,7 +417,7 @@ var require_tunnel = __commonJS({ connectOptions.headers = connectOptions.headers || {}; connectOptions.headers["Proxy-Authorization"] = "Basic " + new Buffer(connectOptions.proxyAuth).toString("base64"); } - debug2("making CONNECT request"); + debug("making CONNECT request"); var connectReq = self.request(connectOptions); connectReq.useChunkedEncodingByDefault = false; connectReq.once("response", onResponse); @@ -156,40 +437,40 @@ var require_tunnel = __commonJS({ connectReq.removeAllListeners(); socket.removeAllListeners(); if (res.statusCode !== 200) { - debug2( + debug( "tunneling socket could not be established, statusCode=%d", res.statusCode ); socket.destroy(); - var error2 = new Error("tunneling socket could not be established, statusCode=" + res.statusCode); - error2.code = "ECONNRESET"; - options.request.emit("error", error2); + var error3 = new Error("tunneling socket could not be established, statusCode=" + res.statusCode); + error3.code = "ECONNRESET"; + options.request.emit("error", error3); self.removeSocket(placeholder); return; } if (head.length > 0) { - debug2("got illegal response body from proxy"); + debug("got illegal response body from proxy"); socket.destroy(); - var error2 = new Error("got illegal response body from proxy"); - error2.code = "ECONNRESET"; - options.request.emit("error", error2); + var error3 = new Error("got illegal response body from proxy"); + error3.code = "ECONNRESET"; + options.request.emit("error", error3); self.removeSocket(placeholder); return; } - debug2("tunneling connection has established"); + debug("tunneling connection has established"); self.sockets[self.sockets.indexOf(placeholder)] = socket; return cb(socket); } function onError(cause) { connectReq.removeAllListeners(); - debug2( + debug( "tunneling socket could not be established, cause=%s\n", cause.message, cause.stack ); - var error2 = new Error("tunneling socket could not be established, cause=" + cause.message); - error2.code = "ECONNRESET"; - options.request.emit("error", error2); + var error3 = new Error("tunneling socket could not be established, cause=" + cause.message); + error3.code = "ECONNRESET"; + options.request.emit("error", error3); self.removeSocket(placeholder); } }; @@ -244,9 +525,9 @@ var require_tunnel = __commonJS({ } return target; } - var debug2; + var debug; if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { - debug2 = function() { + debug = function() { var args = Array.prototype.slice.call(arguments); if (typeof args[0] === "string") { args[0] = "TUNNEL: " + args[0]; @@ -256,10 +537,10 @@ var require_tunnel = __commonJS({ console.error.apply(console, args); }; } else { - debug2 = function() { + debug = function() { }; } - exports.debug = debug2; + exports.debug = debug; } }); @@ -1502,14 +1783,14 @@ var require_diagnostics = __commonJS({ diagnosticsChannel.channel("undici:client:connectError").subscribe((evt) => { const { connectParams: { version, protocol, port, host }, - error: error2 + error: error3 } = evt; debuglog( "connection to %s using %s%s errored - %s", `${host}${port ? `:${port}` : ""}`, protocol, version, - error2.message + error3.message ); }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { @@ -1540,14 +1821,14 @@ var require_diagnostics = __commonJS({ diagnosticsChannel.channel("undici:request:error").subscribe((evt) => { const { request: { method, path: path2, origin }, - error: error2 + error: error3 } = evt; debuglog( "request to %s %s/%s errored - %s", method, origin, path2, - error2.message + error3.message ); }); isClientSet = true; @@ -1582,7 +1863,7 @@ var require_diagnostics = __commonJS({ diagnosticsChannel.channel("undici:client:connectError").subscribe((evt) => { const { connectParams: { version, protocol, port, host }, - error: error2 + error: error3 } = evt; debuglog( "connection to %s%s using %s%s errored - %s", @@ -1590,7 +1871,7 @@ var require_diagnostics = __commonJS({ port ? `:${port}` : "", protocol, version, - error2.message + error3.message ); }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { @@ -1857,16 +2138,16 @@ var require_request = __commonJS({ this.onError(err); } } - onError(error2) { + onError(error3) { this.onFinally(); if (channels.error.hasSubscribers) { - channels.error.publish({ request: this, error: error2 }); + channels.error.publish({ request: this, error: error3 }); } if (this.aborted) { return; } this.aborted = true; - return this[kHandler].onError(error2); + return this[kHandler].onError(error3); } onFinally() { if (this.errorHandler) { @@ -2583,7 +2864,7 @@ var require_connect = __commonJS({ }); // node_modules/undici/lib/llhttp/utils.js -var require_utils = __commonJS({ +var require_utils2 = __commonJS({ "node_modules/undici/lib/llhttp/utils.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -2608,7 +2889,7 @@ var require_constants2 = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0; - var utils_1 = require_utils(); + var utils_1 = require_utils2(); var ERROR; (function(ERROR2) { ERROR2[ERROR2["OK"] = 0] = "OK"; @@ -5583,7 +5864,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r } throwIfAborted(object[kState]); const promise = createDeferredPromise(); - const errorSteps = (error2) => promise.reject(error2); + const errorSteps = (error3) => promise.reject(error3); const successSteps = (data) => { try { promise.resolve(convertBytesToJSValue(data)); @@ -5678,7 +5959,7 @@ var require_client_h1 = __commonJS({ kResume, kHTTPContext } = require_symbols(); - var constants3 = require_constants2(); + var constants = require_constants2(); var EMPTY_BUF = Buffer.alloc(0); var FastBuffer = Buffer[Symbol.species]; var addListener = util.addListener; @@ -5750,7 +6031,7 @@ var require_client_h1 = __commonJS({ constructor(client, socket, { exports: exports2 }) { assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0); this.llhttp = exports2; - this.ptr = this.llhttp.llhttp_alloc(constants3.TYPE.RESPONSE); + this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE); this.client = client; this.socket = socket; this.timeout = null; @@ -5845,19 +6126,19 @@ var require_client_h1 = __commonJS({ currentBufferRef = null; } const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr; - if (ret === constants3.ERROR.PAUSED_UPGRADE) { + if (ret === constants.ERROR.PAUSED_UPGRADE) { this.onUpgrade(data.slice(offset)); - } else if (ret === constants3.ERROR.PAUSED) { + } else if (ret === constants.ERROR.PAUSED) { this.paused = true; socket.unshift(data.slice(offset)); - } else if (ret !== constants3.ERROR.OK) { + } else if (ret !== constants.ERROR.OK) { const ptr = llhttp.llhttp_get_error_reason(this.ptr); let message = ""; if (ptr) { const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0); message = "Response does not match the HTTP/1.1 protocol (" + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + ")"; } - throw new HTTPParserError(message, constants3.ERROR[ret], data.slice(offset)); + throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset)); } } catch (err) { util.destroy(socket, err); @@ -6032,7 +6313,7 @@ var require_client_h1 = __commonJS({ socket[kBlocking] = false; client[kResume](); } - return pause ? constants3.ERROR.PAUSED : 0; + return pause ? constants.ERROR.PAUSED : 0; } onBody(buf) { const { client, socket, statusCode, maxResponseSize } = this; @@ -6054,7 +6335,7 @@ var require_client_h1 = __commonJS({ } this.bytesRead += buf.length; if (request2.onData(buf) === false) { - return constants3.ERROR.PAUSED; + return constants.ERROR.PAUSED; } } onMessageComplete() { @@ -6089,13 +6370,13 @@ var require_client_h1 = __commonJS({ if (socket[kWriting]) { assert(client[kRunning] === 0); util.destroy(socket, new InformationalError("reset")); - return constants3.ERROR.PAUSED; + return constants.ERROR.PAUSED; } else if (!shouldKeepAlive) { util.destroy(socket, new InformationalError("reset")); - return constants3.ERROR.PAUSED; + return constants.ERROR.PAUSED; } else if (socket[kReset] && client[kRunning] === 0) { util.destroy(socket, new InformationalError("reset")); - return constants3.ERROR.PAUSED; + return constants.ERROR.PAUSED; } else if (client[kPipelining] == null || client[kPipelining] === 1) { setImmediate(() => client[kResume]()); } else { @@ -7091,8 +7372,8 @@ var require_client_h2 = __commonJS({ } request2.onRequestSent(); client[kResume](); - } catch (error2) { - abort(error2); + } catch (error3) { + abort(error3); } } function writeStream(abort, socket, expectsPayload, h2stream, body, client, request2, contentLength) { @@ -7247,8 +7528,8 @@ var require_redirect_handler = __commonJS({ onUpgrade(statusCode, headers, socket) { this.handler.onUpgrade(statusCode, headers, socket); } - onError(error2) { - this.handler.onError(error2); + onError(error3) { + this.handler.onError(error3); } onHeaders(statusCode, headers, resume, statusText) { this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers); @@ -8176,7 +8457,7 @@ var require_pool = __commonJS({ this[kOptions] = { ...util.deepClone(options), connect, allowH2 }; this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; this[kFactory] = factory; - this.on("connectionError", (origin2, targets, error2) => { + this.on("connectionError", (origin2, targets, error3) => { for (const target of targets) { const idx = this[kClients].indexOf(target); if (idx !== -1) { @@ -8521,7 +8802,7 @@ var require_proxy_agent = __commonJS({ return this.#client.destroy(err); } }; - var ProxyAgent2 = class extends DispatcherBase { + var ProxyAgent = class extends DispatcherBase { constructor(opts) { super(); if (!opts || typeof opts === "object" && !(opts instanceof URL2) && !opts.uri) { @@ -8662,7 +8943,7 @@ var require_proxy_agent = __commonJS({ throw new InvalidArgumentError("Proxy-Authorization should be sent in ProxyAgent constructor"); } } - module.exports = ProxyAgent2; + module.exports = ProxyAgent; } }); @@ -8672,7 +8953,7 @@ var require_env_http_proxy_agent = __commonJS({ "use strict"; var DispatcherBase = require_dispatcher_base(); var { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = require_symbols(); - var ProxyAgent2 = require_proxy_agent(); + var ProxyAgent = require_proxy_agent(); var Agent = require_agent(); var DEFAULT_PORTS = { "http:": 80, @@ -8696,13 +8977,13 @@ var require_env_http_proxy_agent = __commonJS({ this[kNoProxyAgent] = new Agent(agentOpts); const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY; if (HTTP_PROXY) { - this[kHttpProxyAgent] = new ProxyAgent2({ ...agentOpts, uri: HTTP_PROXY }); + this[kHttpProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTP_PROXY }); } else { this[kHttpProxyAgent] = this[kNoProxyAgent]; } const HTTPS_PROXY = httpsProxy ?? process.env.https_proxy ?? process.env.HTTPS_PROXY; if (HTTPS_PROXY) { - this[kHttpsProxyAgent] = new ProxyAgent2({ ...agentOpts, uri: HTTPS_PROXY }); + this[kHttpsProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTPS_PROXY }); } else { this[kHttpsProxyAgent] = this[kHttpProxyAgent]; } @@ -10543,13 +10824,13 @@ var require_mock_utils = __commonJS({ if (mockDispatch2.data.callback) { mockDispatch2.data = { ...mockDispatch2.data, ...mockDispatch2.data.callback(opts) }; } - const { data: { statusCode, data, headers, trailers, error: error2 }, delay, persist } = mockDispatch2; + const { data: { statusCode, data, headers, trailers, error: error3 }, delay, persist } = mockDispatch2; const { timesInvoked, times } = mockDispatch2; mockDispatch2.consumed = !persist && timesInvoked >= times; mockDispatch2.pending = timesInvoked < times; - if (error2 !== null) { + if (error3 !== null) { deleteMockDispatch(this[kDispatches], key); - handler2.onError(error2); + handler2.onError(error3); return true; } if (typeof delay === "number" && delay > 0) { @@ -10587,19 +10868,19 @@ var require_mock_utils = __commonJS({ if (agent.isMockActive) { try { mockDispatch.call(this, opts, handler2); - } catch (error2) { - if (error2 instanceof MockNotMatchedError) { + } catch (error3) { + if (error3 instanceof MockNotMatchedError) { const netConnect = agent[kGetNetConnect](); if (netConnect === false) { - throw new MockNotMatchedError(`${error2.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); + throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); } if (checkNetConnect(netConnect, origin)) { originalDispatch.call(this, opts, handler2); } else { - throw new MockNotMatchedError(`${error2.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); + throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); } } else { - throw error2; + throw error3; } } } else { @@ -10764,11 +11045,11 @@ var require_mock_interceptor = __commonJS({ /** * Mock an undici request with a defined error. */ - replyWithError(error2) { - if (typeof error2 === "undefined") { + replyWithError(error3) { + if (typeof error3 === "undefined") { throw new InvalidArgumentError("error must be defined"); } - const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error2 }); + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error3 }); return new MockScope(newMockDispatch); } /** @@ -11729,12 +12010,12 @@ var require_headers = __commonJS({ append(name, value, isLowerCase) { this[kHeadersSortedMap] = null; const lowercaseName = isLowerCase ? name : name.toLowerCase(); - const exists2 = this[kHeadersMap].get(lowercaseName); - if (exists2) { + const exists = this[kHeadersMap].get(lowercaseName); + if (exists) { const delimiter = lowercaseName === "cookie" ? "; " : ", "; this[kHeadersMap].set(lowercaseName, { - name: exists2.name, - value: `${exists2.value}${delimiter}${value}` + name: exists.name, + value: `${exists.value}${delimiter}${value}` }); } else { this[kHeadersMap].set(lowercaseName, { name, value }); @@ -11859,7 +12140,7 @@ var require_headers = __commonJS({ } } }; - var Headers2 = class _Headers { + var Headers = class _Headers { #guard; #headersList; constructor(init = void 0) { @@ -12009,13 +12290,13 @@ var require_headers = __commonJS({ o.#headersList = list; } }; - var { getHeadersGuard, setHeadersGuard, getHeadersList, setHeadersList } = Headers2; - Reflect.deleteProperty(Headers2, "getHeadersGuard"); - Reflect.deleteProperty(Headers2, "setHeadersGuard"); - Reflect.deleteProperty(Headers2, "getHeadersList"); - Reflect.deleteProperty(Headers2, "setHeadersList"); - iteratorMixin("Headers", Headers2, kHeadersSortedMap, 0, 1); - Object.defineProperties(Headers2.prototype, { + var { getHeadersGuard, setHeadersGuard, getHeadersList, setHeadersList } = Headers; + Reflect.deleteProperty(Headers, "getHeadersGuard"); + Reflect.deleteProperty(Headers, "setHeadersGuard"); + Reflect.deleteProperty(Headers, "getHeadersList"); + Reflect.deleteProperty(Headers, "setHeadersList"); + iteratorMixin("Headers", Headers, kHeadersSortedMap, 0, 1); + Object.defineProperties(Headers.prototype, { append: kEnumerableProperty, delete: kEnumerableProperty, get: kEnumerableProperty, @@ -12033,7 +12314,7 @@ var require_headers = __commonJS({ webidl.converters.HeadersInit = function(V, prefix, argument) { if (webidl.util.Type(V) === "Object") { const iterator2 = Reflect.get(V, Symbol.iterator); - if (!util.types.isProxy(V) && iterator2 === Headers2.prototype.entries) { + if (!util.types.isProxy(V) && iterator2 === Headers.prototype.entries) { try { return getHeadersList(V).entriesList; } catch { @@ -12054,7 +12335,7 @@ var require_headers = __commonJS({ fill, // for test. compareHeaderName, - Headers: Headers2, + Headers, HeadersList, getHeadersGuard, setHeadersGuard, @@ -12068,7 +12349,7 @@ var require_headers = __commonJS({ var require_response = __commonJS({ "node_modules/undici/lib/web/fetch/response.js"(exports, module) { "use strict"; - var { Headers: Headers2, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = require_headers(); + var { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = require_headers(); var { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = require_body(); var util = require_util(); var nodeUtil = __require("node:util"); @@ -12146,7 +12427,7 @@ var require_response = __commonJS({ } init = webidl.converters.ResponseInit(init); this[kState] = makeResponse({}); - this[kHeaders] = new Headers2(kConstruct); + this[kHeaders] = new Headers(kConstruct); setHeadersGuard(this[kHeaders], "response"); setHeadersList(this[kHeaders], this[kState].headersList); let bodyWithType = null; @@ -12390,7 +12671,7 @@ var require_response = __commonJS({ function fromInnerResponse(innerResponse, guard) { const response = new Response(kConstruct); response[kState] = innerResponse; - response[kHeaders] = new Headers2(kConstruct); + response[kHeaders] = new Headers(kConstruct); setHeadersList(response[kHeaders], innerResponse.headersList); setHeadersGuard(response[kHeaders], guard); if (hasFinalizationRegistry && innerResponse.body?.stream) { @@ -12510,7 +12791,7 @@ var require_request2 = __commonJS({ "node_modules/undici/lib/web/fetch/request.js"(exports, module) { "use strict"; var { extractBody, mixinBody, cloneBody, bodyUnusable } = require_body(); - var { Headers: Headers2, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = require_headers(); + var { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = require_headers(); var { FinalizationRegistry: FinalizationRegistry2 } = require_dispatcher_weakref()(); var util = require_util(); var nodeUtil = __require("node:util"); @@ -12778,7 +13059,7 @@ var require_request2 = __commonJS({ requestFinalizer.register(ac, { signal, abort }, abort); } } - this[kHeaders] = new Headers2(kConstruct); + this[kHeaders] = new Headers(kConstruct); setHeadersList(this[kHeaders], request2.headersList); setHeadersGuard(this[kHeaders], "request"); if (mode === "no-cors") { @@ -13067,7 +13348,7 @@ var require_request2 = __commonJS({ const request2 = new Request(kConstruct); request2[kState] = innerRequest; request2[kSignal] = signal; - request2[kHeaders] = new Headers2(kConstruct); + request2[kHeaders] = new Headers(kConstruct); setHeadersList(request2[kHeaders], innerRequest.headersList); setHeadersGuard(request2[kHeaders], guard); return request2; @@ -13286,17 +13567,17 @@ var require_fetch = __commonJS({ this.emit("terminated", reason); } // https://fetch.spec.whatwg.org/#fetch-controller-abort - abort(error2) { + abort(error3) { if (this.state !== "ongoing") { return; } this.state = "aborted"; - if (!error2) { - error2 = new DOMException("The operation was aborted.", "AbortError"); + if (!error3) { + error3 = new DOMException("The operation was aborted.", "AbortError"); } - this.serializedAbortReason = error2; - this.connection?.destroy(error2); - this.emit("terminated", error2); + this.serializedAbortReason = error3; + this.connection?.destroy(error3); + this.emit("terminated", error3); } }; function handleFetchDone(response) { @@ -13392,12 +13673,12 @@ var require_fetch = __commonJS({ ); } var markResourceTiming = performance.markResourceTiming; - function abortFetch(p, request2, responseObject, error2) { + function abortFetch(p, request2, responseObject, error3) { if (p) { - p.reject(error2); + p.reject(error3); } if (request2.body != null && isReadable(request2.body?.stream)) { - request2.body.stream.cancel(error2).catch((err) => { + request2.body.stream.cancel(error3).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -13409,7 +13690,7 @@ var require_fetch = __commonJS({ } const response = responseObject[kState]; if (response.body != null && isReadable(response.body?.stream)) { - response.body.stream.cancel(error2).catch((err) => { + response.body.stream.cancel(error3).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -14230,13 +14511,13 @@ var require_fetch = __commonJS({ fetchParams.controller.ended = true; this.body.push(null); }, - onError(error2) { + onError(error3) { if (this.abort) { fetchParams.controller.off("terminated", this.abort); } - this.body?.destroy(error2); - fetchParams.controller.terminate(error2); - reject(error2); + this.body?.destroy(error3); + fetchParams.controller.terminate(error3); + reject(error3); }, onUpgrade(status, rawHeaders, socket) { if (status !== 101) { @@ -14699,8 +14980,8 @@ var require_util4 = __commonJS({ } fr[kResult] = result; fireAProgressEvent("load", fr); - } catch (error2) { - fr[kError] = error2; + } catch (error3) { + fr[kError] = error3; fireAProgressEvent("error", fr); } if (fr[kState] !== "loading") { @@ -14709,13 +14990,13 @@ var require_util4 = __commonJS({ }); break; } - } catch (error2) { + } catch (error3) { if (fr[kAborted]) { return; } queueMicrotask(() => { fr[kState] = "done"; - fr[kError] = error2; + fr[kError] = error3; fireAProgressEvent("error", fr); if (fr[kState] !== "loading") { fireAProgressEvent("loadend", fr); @@ -16105,10 +16386,10 @@ var require_cookies = __commonJS({ var { parseSetCookie } = require_parse(); var { stringify } = require_util6(); var { webidl } = require_webidl(); - var { Headers: Headers2 } = require_headers(); + var { Headers } = require_headers(); function getCookies(headers) { webidl.argumentLengthCheck(arguments, 1, "getCookies"); - webidl.brandCheck(headers, Headers2, { strict: false }); + webidl.brandCheck(headers, Headers, { strict: false }); const cookie = headers.get("cookie"); const out = {}; if (!cookie) { @@ -16121,7 +16402,7 @@ var require_cookies = __commonJS({ return out; } function deleteCookie(headers, name, attributes) { - webidl.brandCheck(headers, Headers2, { strict: false }); + webidl.brandCheck(headers, Headers, { strict: false }); const prefix = "deleteCookie"; webidl.argumentLengthCheck(arguments, 2, prefix); name = webidl.converters.DOMString(name, prefix, "name"); @@ -16135,7 +16416,7 @@ var require_cookies = __commonJS({ } function getSetCookies(headers) { webidl.argumentLengthCheck(arguments, 1, "getSetCookies"); - webidl.brandCheck(headers, Headers2, { strict: false }); + webidl.brandCheck(headers, Headers, { strict: false }); const cookies = headers.getSetCookie(); if (!cookies) { return []; @@ -16144,7 +16425,7 @@ var require_cookies = __commonJS({ } function setCookie(headers, cookie) { webidl.argumentLengthCheck(arguments, 2, "setCookie"); - webidl.brandCheck(headers, Headers2, { strict: false }); + webidl.brandCheck(headers, Headers, { strict: false }); cookie = webidl.converters.Cookie(cookie); const str = stringify(cookie); if (str) { @@ -16830,7 +17111,7 @@ var require_connection = __commonJS({ var { CloseEvent } = require_events(); var { makeRequest } = require_request2(); var { fetching } = require_fetch(); - var { Headers: Headers2, getHeadersList } = require_headers(); + var { Headers, getHeadersList } = require_headers(); var { getDecodeSplit } = require_util2(); var { WebsocketFrameSend } = require_frame(); var crypto; @@ -16852,7 +17133,7 @@ var require_connection = __commonJS({ redirect: "error" }); if (options.headers) { - const headersList = getHeadersList(new Headers2(options.headers)); + const headersList = getHeadersList(new Headers(options.headers)); request2.headersList = headersList; } const keyValue = crypto.randomBytes(16).toString("base64"); @@ -16983,11 +17264,11 @@ var require_connection = __commonJS({ }); } } - function onSocketError(error2) { + function onSocketError(error3) { const { ws } = this; ws[kReadyState] = states.CLOSING; if (channels.socketError.hasSubscribers) { - channels.socketError.publish(error2); + channels.socketError.publish(error3); } this.destroy(); } @@ -17212,9 +17493,9 @@ var require_receiver = __commonJS({ } this.#state = parserStates.INFO; } else { - this.#extensions.get("permessage-deflate").decompress(body, this.#info.fin, (error2, data) => { - if (error2) { - closeWebSocketConnection(this.ws, 1007, error2.message, error2.message.length); + this.#extensions.get("permessage-deflate").decompress(body, this.#info.fin, (error3, data) => { + if (error3) { + closeWebSocketConnection(this.ws, 1007, error3.message, error3.message.length); return; } this.#fragments.push(data); @@ -18246,8 +18527,8 @@ var require_eventsource = __commonJS({ pipeline2( response.body.stream, eventSourceStream, - (error2) => { - if (error2?.aborted === false) { + (error3) => { + if (error3?.aborted === false) { this.close(); this.dispatchEvent(new Event("error")); } @@ -18387,7 +18668,7 @@ var require_undici = __commonJS({ var Pool = require_pool(); var BalancedPool = require_balanced_pool(); var Agent = require_agent(); - var ProxyAgent2 = require_proxy_agent(); + var ProxyAgent = require_proxy_agent(); var EnvHttpProxyAgent = require_env_http_proxy_agent(); var RetryAgent = require_retry_agent(); var errors = require_errors(); @@ -18410,7 +18691,7 @@ var require_undici = __commonJS({ module.exports.Pool = Pool; module.exports.BalancedPool = BalancedPool; module.exports.Agent = Agent; - module.exports.ProxyAgent = ProxyAgent2; + module.exports.ProxyAgent = ProxyAgent; module.exports.EnvHttpProxyAgent = EnvHttpProxyAgent; module.exports.RetryAgent = RetryAgent; module.exports.RetryHandler = RetryHandler; @@ -18520,129 +18801,48 @@ var require_undici = __commonJS({ } }); -// node_modules/@actions/http-client/lib/proxy.js -var require_proxy = __commonJS({ - "node_modules/@actions/http-client/lib/proxy.js"(exports) { +// node_modules/@actions/http-client/lib/index.js +var require_lib = __commonJS({ + "node_modules/@actions/http-client/lib/index.js"(exports) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getProxyUrl = getProxyUrl2; - exports.checkBypass = checkBypass; - function getProxyUrl2(reqUrl) { - const usingSsl = reqUrl.protocol === "https:"; - if (checkBypass(reqUrl)) { - return void 0; + var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; } - const proxyVar = (() => { - if (usingSsl) { - return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; - } else { - return process.env["http_proxy"] || process.env["HTTP_PROXY"]; - } - })(); - if (proxyVar) { - try { - return new DecodedURL(proxyVar); - } catch (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); - } - } else { - return void 0; - } - } - function checkBypass(reqUrl) { - if (!reqUrl.hostname) { - return false; - } - const reqHost = reqUrl.hostname; - if (isLoopbackAddress(reqHost)) { - return true; - } - const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; - if (!noProxy) { - return false; - } - let reqPort; - if (reqUrl.port) { - reqPort = Number(reqUrl.port); - } else if (reqUrl.protocol === "http:") { - reqPort = 80; - } else if (reqUrl.protocol === "https:") { - reqPort = 443; - } - const upperReqHosts = [reqUrl.hostname.toUpperCase()]; - if (typeof reqPort === "number") { - upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); - } - for (const upperNoProxyItem of noProxy.split(",").map((x) => x.trim().toUpperCase()).filter((x) => x)) { - if (upperNoProxyItem === "*" || upperReqHosts.some((x) => x === upperNoProxyItem || x.endsWith(`.${upperNoProxyItem}`) || upperNoProxyItem.startsWith(".") && x.endsWith(`${upperNoProxyItem}`))) { - return true; - } - } - return false; - } - function isLoopbackAddress(host) { - const hostLower = host.toLowerCase(); - return hostLower === "localhost" || hostLower.startsWith("127.") || hostLower.startsWith("[::1]") || hostLower.startsWith("[0:0:0:0:0:0:0:1]"); - } - var DecodedURL = class extends URL { - constructor(url, base) { - super(url, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); - } - get username() { - return this._decodedUsername; - } - get password() { - return this._decodedPassword; - } - }; - } -}); - -// node_modules/@actions/http-client/lib/index.js -var require_lib = __commonJS({ - "node_modules/@actions/http-client/lib/index.js"(exports) { - "use strict"; - var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar = exports && exports.__importStar || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { - var ar = []; - for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) { - for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + Object.defineProperty(o, k2, desc); + }) : (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + })); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = exports && exports.__importStar || /* @__PURE__ */ (function() { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function(o2) { + var ar = []; + for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); } __setModuleDefault(result, mod); return result; }; })(); - var __awaiter3 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve) { resolve(value); @@ -18671,67 +18871,67 @@ var require_lib = __commonJS({ }; Object.defineProperty(exports, "__esModule", { value: true }); exports.HttpClient = exports.HttpClientResponse = exports.HttpClientError = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; - exports.getProxyUrl = getProxyUrl2; + exports.getProxyUrl = getProxyUrl; exports.isHttps = isHttps; var http = __importStar(__require("http")); var https = __importStar(__require("https")); var pm = __importStar(require_proxy()); - var tunnel2 = __importStar(require_tunnel2()); + var tunnel = __importStar(require_tunnel2()); var undici_1 = require_undici(); - var HttpCodes2; - (function(HttpCodes3) { - HttpCodes3[HttpCodes3["OK"] = 200] = "OK"; - HttpCodes3[HttpCodes3["MultipleChoices"] = 300] = "MultipleChoices"; - HttpCodes3[HttpCodes3["MovedPermanently"] = 301] = "MovedPermanently"; - HttpCodes3[HttpCodes3["ResourceMoved"] = 302] = "ResourceMoved"; - HttpCodes3[HttpCodes3["SeeOther"] = 303] = "SeeOther"; - HttpCodes3[HttpCodes3["NotModified"] = 304] = "NotModified"; - HttpCodes3[HttpCodes3["UseProxy"] = 305] = "UseProxy"; - HttpCodes3[HttpCodes3["SwitchProxy"] = 306] = "SwitchProxy"; - HttpCodes3[HttpCodes3["TemporaryRedirect"] = 307] = "TemporaryRedirect"; - HttpCodes3[HttpCodes3["PermanentRedirect"] = 308] = "PermanentRedirect"; - HttpCodes3[HttpCodes3["BadRequest"] = 400] = "BadRequest"; - HttpCodes3[HttpCodes3["Unauthorized"] = 401] = "Unauthorized"; - HttpCodes3[HttpCodes3["PaymentRequired"] = 402] = "PaymentRequired"; - HttpCodes3[HttpCodes3["Forbidden"] = 403] = "Forbidden"; - HttpCodes3[HttpCodes3["NotFound"] = 404] = "NotFound"; - HttpCodes3[HttpCodes3["MethodNotAllowed"] = 405] = "MethodNotAllowed"; - HttpCodes3[HttpCodes3["NotAcceptable"] = 406] = "NotAcceptable"; - HttpCodes3[HttpCodes3["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; - HttpCodes3[HttpCodes3["RequestTimeout"] = 408] = "RequestTimeout"; - HttpCodes3[HttpCodes3["Conflict"] = 409] = "Conflict"; - HttpCodes3[HttpCodes3["Gone"] = 410] = "Gone"; - HttpCodes3[HttpCodes3["TooManyRequests"] = 429] = "TooManyRequests"; - HttpCodes3[HttpCodes3["InternalServerError"] = 500] = "InternalServerError"; - HttpCodes3[HttpCodes3["NotImplemented"] = 501] = "NotImplemented"; - HttpCodes3[HttpCodes3["BadGateway"] = 502] = "BadGateway"; - HttpCodes3[HttpCodes3["ServiceUnavailable"] = 503] = "ServiceUnavailable"; - HttpCodes3[HttpCodes3["GatewayTimeout"] = 504] = "GatewayTimeout"; - })(HttpCodes2 || (exports.HttpCodes = HttpCodes2 = {})); - var Headers2; - (function(Headers3) { - Headers3["Accept"] = "accept"; - Headers3["ContentType"] = "content-type"; - })(Headers2 || (exports.Headers = Headers2 = {})); - var MediaTypes2; - (function(MediaTypes3) { - MediaTypes3["ApplicationJson"] = "application/json"; - })(MediaTypes2 || (exports.MediaTypes = MediaTypes2 = {})); - function getProxyUrl2(serverUrl) { + var HttpCodes; + (function(HttpCodes2) { + HttpCodes2[HttpCodes2["OK"] = 200] = "OK"; + HttpCodes2[HttpCodes2["MultipleChoices"] = 300] = "MultipleChoices"; + HttpCodes2[HttpCodes2["MovedPermanently"] = 301] = "MovedPermanently"; + HttpCodes2[HttpCodes2["ResourceMoved"] = 302] = "ResourceMoved"; + HttpCodes2[HttpCodes2["SeeOther"] = 303] = "SeeOther"; + HttpCodes2[HttpCodes2["NotModified"] = 304] = "NotModified"; + HttpCodes2[HttpCodes2["UseProxy"] = 305] = "UseProxy"; + HttpCodes2[HttpCodes2["SwitchProxy"] = 306] = "SwitchProxy"; + HttpCodes2[HttpCodes2["TemporaryRedirect"] = 307] = "TemporaryRedirect"; + HttpCodes2[HttpCodes2["PermanentRedirect"] = 308] = "PermanentRedirect"; + HttpCodes2[HttpCodes2["BadRequest"] = 400] = "BadRequest"; + HttpCodes2[HttpCodes2["Unauthorized"] = 401] = "Unauthorized"; + HttpCodes2[HttpCodes2["PaymentRequired"] = 402] = "PaymentRequired"; + HttpCodes2[HttpCodes2["Forbidden"] = 403] = "Forbidden"; + HttpCodes2[HttpCodes2["NotFound"] = 404] = "NotFound"; + HttpCodes2[HttpCodes2["MethodNotAllowed"] = 405] = "MethodNotAllowed"; + HttpCodes2[HttpCodes2["NotAcceptable"] = 406] = "NotAcceptable"; + HttpCodes2[HttpCodes2["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; + HttpCodes2[HttpCodes2["RequestTimeout"] = 408] = "RequestTimeout"; + HttpCodes2[HttpCodes2["Conflict"] = 409] = "Conflict"; + HttpCodes2[HttpCodes2["Gone"] = 410] = "Gone"; + HttpCodes2[HttpCodes2["TooManyRequests"] = 429] = "TooManyRequests"; + HttpCodes2[HttpCodes2["InternalServerError"] = 500] = "InternalServerError"; + HttpCodes2[HttpCodes2["NotImplemented"] = 501] = "NotImplemented"; + HttpCodes2[HttpCodes2["BadGateway"] = 502] = "BadGateway"; + HttpCodes2[HttpCodes2["ServiceUnavailable"] = 503] = "ServiceUnavailable"; + HttpCodes2[HttpCodes2["GatewayTimeout"] = 504] = "GatewayTimeout"; + })(HttpCodes || (exports.HttpCodes = HttpCodes = {})); + var Headers; + (function(Headers2) { + Headers2["Accept"] = "accept"; + Headers2["ContentType"] = "content-type"; + })(Headers || (exports.Headers = Headers = {})); + var MediaTypes; + (function(MediaTypes2) { + MediaTypes2["ApplicationJson"] = "application/json"; + })(MediaTypes || (exports.MediaTypes = MediaTypes = {})); + function getProxyUrl(serverUrl) { const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); return proxyUrl ? proxyUrl.href : ""; } - var HttpRedirectCodes2 = [ - HttpCodes2.MovedPermanently, - HttpCodes2.ResourceMoved, - HttpCodes2.SeeOther, - HttpCodes2.TemporaryRedirect, - HttpCodes2.PermanentRedirect + var HttpRedirectCodes = [ + HttpCodes.MovedPermanently, + HttpCodes.ResourceMoved, + HttpCodes.SeeOther, + HttpCodes.TemporaryRedirect, + HttpCodes.PermanentRedirect ]; - var HttpResponseRetryCodes2 = [ - HttpCodes2.BadGateway, - HttpCodes2.ServiceUnavailable, - HttpCodes2.GatewayTimeout + var HttpResponseRetryCodes = [ + HttpCodes.BadGateway, + HttpCodes.ServiceUnavailable, + HttpCodes.GatewayTimeout ]; var RetryableHttpVerbs = ["OPTIONS", "GET", "DELETE", "HEAD"]; var ExponentialBackoffCeiling = 10; @@ -18750,8 +18950,8 @@ var require_lib = __commonJS({ this.message = message; } readBody() { - return __awaiter3(this, void 0, void 0, function* () { - return new Promise((resolve) => __awaiter3(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve) => __awaiter2(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on("data", (chunk) => { output = Buffer.concat([output, chunk]); @@ -18763,8 +18963,8 @@ var require_lib = __commonJS({ }); } readBodyBuffer() { - return __awaiter3(this, void 0, void 0, function* () { - return new Promise((resolve) => __awaiter3(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve) => __awaiter2(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); @@ -18781,7 +18981,7 @@ var require_lib = __commonJS({ const parsedUrl = new URL(requestUrl); return parsedUrl.protocol === "https:"; } - var HttpClient3 = class { + var HttpClient2 = class { constructor(userAgent2, handlers, requestOptions) { this._ignoreSslError = false; this._allowRedirects = true; @@ -18820,42 +19020,42 @@ var require_lib = __commonJS({ } } options(requestUrl, additionalHeaders) { - return __awaiter3(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } get(requestUrl, additionalHeaders) { - return __awaiter3(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("GET", requestUrl, null, additionalHeaders || {}); }); } del(requestUrl, additionalHeaders) { - return __awaiter3(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("DELETE", requestUrl, null, additionalHeaders || {}); }); } post(requestUrl, data, additionalHeaders) { - return __awaiter3(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } patch(requestUrl, data, additionalHeaders) { - return __awaiter3(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PATCH", requestUrl, data, additionalHeaders || {}); }); } put(requestUrl, data, additionalHeaders) { - return __awaiter3(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PUT", requestUrl, data, additionalHeaders || {}); }); } head(requestUrl, additionalHeaders) { - return __awaiter3(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter3(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream, additionalHeaders); }); } @@ -18864,35 +19064,35 @@ var require_lib = __commonJS({ * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise */ getJson(requestUrl_1) { - return __awaiter3(this, arguments, void 0, function* (requestUrl, additionalHeaders = {}) { - additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes2.ApplicationJson); + return __awaiter2(this, arguments, void 0, function* (requestUrl, additionalHeaders = {}) { + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); const res = yield this.get(requestUrl, additionalHeaders); return this._processResponse(res, this.requestOptions); }); } postJson(requestUrl_1, obj_1) { - return __awaiter3(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { + return __awaiter2(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes2.ApplicationJson); - additionalHeaders[Headers2.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes2.ApplicationJson); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); const res = yield this.post(requestUrl, data, additionalHeaders); return this._processResponse(res, this.requestOptions); }); } putJson(requestUrl_1, obj_1) { - return __awaiter3(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { + return __awaiter2(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes2.ApplicationJson); - additionalHeaders[Headers2.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes2.ApplicationJson); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); const res = yield this.put(requestUrl, data, additionalHeaders); return this._processResponse(res, this.requestOptions); }); } patchJson(requestUrl_1, obj_1) { - return __awaiter3(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { + return __awaiter2(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes2.ApplicationJson); - additionalHeaders[Headers2.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes2.ApplicationJson); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); const res = yield this.patch(requestUrl, data, additionalHeaders); return this._processResponse(res, this.requestOptions); }); @@ -18903,18 +19103,18 @@ var require_lib = __commonJS({ * Prefer get, del, post and patch */ request(verb, requestUrl, data, headers) { - return __awaiter3(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._disposed) { throw new Error("Client has already been disposed."); } const parsedUrl = new URL(requestUrl); - let info2 = this._prepareRequest(verb, parsedUrl, headers); + let info7 = this._prepareRequest(verb, parsedUrl, headers); const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) ? this._maxRetries + 1 : 1; let numTries = 0; let response; do { - response = yield this.requestRaw(info2, data); - if (response && response.message && response.message.statusCode === HttpCodes2.Unauthorized) { + response = yield this.requestRaw(info7, data); + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { let authenticationHandler; for (const handler2 of this.handlers) { if (handler2.canHandleAuthentication(response)) { @@ -18923,13 +19123,13 @@ var require_lib = __commonJS({ } } if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info2, data); + return authenticationHandler.handleAuthentication(this, info7, data); } else { return response; } } let redirectsRemaining = this._maxRedirects; - while (response.message.statusCode && HttpRedirectCodes2.includes(response.message.statusCode) && this._allowRedirects && redirectsRemaining > 0) { + while (response.message.statusCode && HttpRedirectCodes.includes(response.message.statusCode) && this._allowRedirects && redirectsRemaining > 0) { const redirectUrl = response.message.headers["location"]; if (!redirectUrl) { break; @@ -18946,11 +19146,11 @@ var require_lib = __commonJS({ } } } - info2 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info2, data); + info7 = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info7, data); redirectsRemaining--; } - if (!response.message.statusCode || !HttpResponseRetryCodes2.includes(response.message.statusCode)) { + if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) { return response; } numTries += 1; @@ -18976,8 +19176,8 @@ var require_lib = __commonJS({ * @param info * @param data */ - requestRaw(info2, data) { - return __awaiter3(this, void 0, void 0, function* () { + requestRaw(info7, data) { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve, reject) => { function callbackForResult(err, res) { if (err) { @@ -18988,7 +19188,7 @@ var require_lib = __commonJS({ resolve(res); } } - this.requestRawWithCallback(info2, data, callbackForResult); + this.requestRawWithCallback(info7, data, callbackForResult); }); }); } @@ -18998,12 +19198,12 @@ var require_lib = __commonJS({ * @param data * @param onResult */ - requestRawWithCallback(info2, data, onResult) { + requestRawWithCallback(info7, data, onResult) { if (typeof data === "string") { - if (!info2.options.headers) { - info2.options.headers = {}; + if (!info7.options.headers) { + info7.options.headers = {}; } - info2.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); } let callbackCalled = false; function handleResult(err, res) { @@ -19012,7 +19212,7 @@ var require_lib = __commonJS({ onResult(err, res); } } - const req = info2.httpModule.request(info2.options, (msg) => { + const req = info7.httpModule.request(info7.options, (msg) => { const res = new HttpClientResponse(msg); handleResult(void 0, res); }); @@ -19024,7 +19224,7 @@ var require_lib = __commonJS({ if (socket) { socket.end(); } - handleResult(new Error(`Request timeout: ${info2.options.path}`)); + handleResult(new Error(`Request timeout: ${info7.options.path}`)); }); req.on("error", function(err) { handleResult(err); @@ -19060,27 +19260,27 @@ var require_lib = __commonJS({ return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); } _prepareRequest(method, requestUrl, headers) { - const info2 = {}; - info2.parsedUrl = requestUrl; - const usingSsl = info2.parsedUrl.protocol === "https:"; - info2.httpModule = usingSsl ? https : http; + const info7 = {}; + info7.parsedUrl = requestUrl; + const usingSsl = info7.parsedUrl.protocol === "https:"; + info7.httpModule = usingSsl ? https : http; const defaultPort = usingSsl ? 443 : 80; - info2.options = {}; - info2.options.host = info2.parsedUrl.hostname; - info2.options.port = info2.parsedUrl.port ? parseInt(info2.parsedUrl.port) : defaultPort; - info2.options.path = (info2.parsedUrl.pathname || "") + (info2.parsedUrl.search || ""); - info2.options.method = method; - info2.options.headers = this._mergeHeaders(headers); + info7.options = {}; + info7.options.host = info7.parsedUrl.hostname; + info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort; + info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || ""); + info7.options.method = method; + info7.options.headers = this._mergeHeaders(headers); if (this.userAgent != null) { - info2.options.headers["user-agent"] = this.userAgent; + info7.options.headers["user-agent"] = this.userAgent; } - info2.options.agent = this._getAgent(info2.parsedUrl); + info7.options.agent = this._getAgent(info7.parsedUrl); if (this.handlers) { for (const handler2 of this.handlers) { - handler2.prepareRequest(info2.options); + handler2.prepareRequest(info7.options); } } - return info2; + return info7; } _mergeHeaders(headers) { if (this.requestOptions && this.requestOptions.headers) { @@ -19122,7 +19322,7 @@ var require_lib = __commonJS({ _getExistingOrDefaultContentTypeHeader(additionalHeaders, _default) { let clientHeader; if (this.requestOptions && this.requestOptions.headers) { - const headerValue = lowercaseKeys2(this.requestOptions.headers)[Headers2.ContentType]; + const headerValue = lowercaseKeys2(this.requestOptions.headers)[Headers.ContentType]; if (headerValue) { if (typeof headerValue === "number") { clientHeader = String(headerValue); @@ -19133,7 +19333,7 @@ var require_lib = __commonJS({ } } } - const additionalValue = additionalHeaders[Headers2.ContentType]; + const additionalValue = additionalHeaders[Headers.ContentType]; if (additionalValue !== void 0) { if (typeof additionalValue === "number") { return String(additionalValue); @@ -19177,9 +19377,9 @@ var require_lib = __commonJS({ let tunnelAgent; const overHttps = proxyUrl.protocol === "https:"; if (usingSsl) { - tunnelAgent = overHttps ? tunnel2.httpsOverHttps : tunnel2.httpsOverHttp; + tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; } else { - tunnelAgent = overHttps ? tunnel2.httpOverHttps : tunnel2.httpOverHttp; + tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; } agent = tunnelAgent(agentOptions); this._proxyAgent = agent; @@ -19226,22 +19426,22 @@ var require_lib = __commonJS({ return baseUserAgent; } _performExponentialBackoff(retryNumber) { - return __awaiter3(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); return new Promise((resolve) => setTimeout(() => resolve(), ms)); }); } _processResponse(res, options) { - return __awaiter3(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter3(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter2(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, result: null, headers: {} }; - if (statusCode === HttpCodes2.NotFound) { + if (statusCode === HttpCodes.NotFound) { resolve(response); } function dateTimeDeserializer(key, value) { @@ -19287,8 +19487,2006 @@ var require_lib = __commonJS({ }); } }; - exports.HttpClient = HttpClient3; - var lowercaseKeys2 = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + exports.HttpClient = HttpClient2; + var lowercaseKeys2 = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + } +}); + +// node_modules/@actions/http-client/lib/auth.js +var require_auth = __commonJS({ + "node_modules/@actions/http-client/lib/auth.js"(exports) { + "use strict"; + var __awaiter2 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0; + var BasicCredentialHandler = class { + constructor(username, password) { + this.username = username; + this.password = password; + } + prepareRequest(options) { + if (!options.headers) { + throw Error("The request has no headers"); + } + options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; + } + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); + } + }; + exports.BasicCredentialHandler = BasicCredentialHandler; + var BearerCredentialHandler = class { + constructor(token) { + this.token = token; + } + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + if (!options.headers) { + throw Error("The request has no headers"); + } + options.headers["Authorization"] = `Bearer ${this.token}`; + } + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); + } + }; + exports.BearerCredentialHandler = BearerCredentialHandler; + var PersonalAccessTokenCredentialHandler = class { + constructor(token) { + this.token = token; + } + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + if (!options.headers) { + throw Error("The request has no headers"); + } + options.headers["Authorization"] = `Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`; + } + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); + } + }; + exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; + } +}); + +// node_modules/@actions/core/lib/oidc-utils.js +var require_oidc_utils = __commonJS({ + "node_modules/@actions/core/lib/oidc-utils.js"(exports) { + "use strict"; + var __awaiter2 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.OidcClient = void 0; + var http_client_1 = require_lib(); + var auth_1 = require_auth(); + var core_1 = require_core(); + var OidcClient = class _OidcClient { + static createHttpClient(allowRetry = true, maxRetry = 10) { + const requestOptions = { + allowRetries: allowRetry, + maxRetries: maxRetry + }; + return new http_client_1.HttpClient("actions/oidc-client", [new auth_1.BearerCredentialHandler(_OidcClient.getRequestToken())], requestOptions); + } + static getRequestToken() { + const token = process.env["ACTIONS_ID_TOKEN_REQUEST_TOKEN"]; + if (!token) { + throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable"); + } + return token; + } + static getIDTokenUrl() { + const runtimeUrl = process.env["ACTIONS_ID_TOKEN_REQUEST_URL"]; + if (!runtimeUrl) { + throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable"); + } + return runtimeUrl; + } + static getCall(id_token_url) { + return __awaiter2(this, void 0, void 0, function* () { + var _a; + const httpclient = _OidcClient.createHttpClient(); + const res = yield httpclient.getJson(id_token_url).catch((error3) => { + throw new Error(`Failed to get ID Token. + + Error Code : ${error3.statusCode} + + Error Message: ${error3.message}`); + }); + const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + if (!id_token) { + throw new Error("Response json body do not have ID Token field"); + } + return id_token; + }); + } + static getIDToken(audience) { + return __awaiter2(this, void 0, void 0, function* () { + try { + let id_token_url = _OidcClient.getIDTokenUrl(); + if (audience) { + const encodedAudience = encodeURIComponent(audience); + id_token_url = `${id_token_url}&audience=${encodedAudience}`; + } + (0, core_1.debug)(`ID token url is ${id_token_url}`); + const id_token = yield _OidcClient.getCall(id_token_url); + (0, core_1.setSecret)(id_token); + return id_token; + } catch (error3) { + throw new Error(`Error message: ${error3.message}`); + } + }); + } + }; + exports.OidcClient = OidcClient; + } +}); + +// node_modules/@actions/core/lib/summary.js +var require_summary = __commonJS({ + "node_modules/@actions/core/lib/summary.js"(exports) { + "use strict"; + var __awaiter2 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0; + var os_1 = __require("os"); + var fs_1 = __require("fs"); + var { access, appendFile, writeFile } = fs_1.promises; + exports.SUMMARY_ENV_VAR = "GITHUB_STEP_SUMMARY"; + exports.SUMMARY_DOCS_URL = "https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary"; + var Summary = class { + constructor() { + this._buffer = ""; + } + /** + * Finds the summary file path from the environment, rejects if env var is not found or file does not exist + * Also checks r/w permissions. + * + * @returns step summary file path + */ + filePath() { + return __awaiter2(this, void 0, void 0, function* () { + if (this._filePath) { + return this._filePath; + } + const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR]; + if (!pathFromEnv) { + throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`); + } + try { + yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); + } catch (_a) { + throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); + } + this._filePath = pathFromEnv; + return this._filePath; + }); + } + /** + * Wraps content in an HTML tag, adding any HTML attributes + * + * @param {string} tag HTML tag to wrap + * @param {string | null} content content within the tag + * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add + * + * @returns {string} content wrapped in HTML element + */ + wrap(tag, content, attrs = {}) { + const htmlAttrs = Object.entries(attrs).map(([key, value]) => ` ${key}="${value}"`).join(""); + if (!content) { + return `<${tag}${htmlAttrs}>`; + } + return `<${tag}${htmlAttrs}>${content}`; + } + /** + * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default. + * + * @param {SummaryWriteOptions} [options] (optional) options for write operation + * + * @returns {Promise} summary instance + */ + write(options) { + return __awaiter2(this, void 0, void 0, function* () { + const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite); + const filePath = yield this.filePath(); + const writeFunc = overwrite ? writeFile : appendFile; + yield writeFunc(filePath, this._buffer, { encoding: "utf8" }); + return this.emptyBuffer(); + }); + } + /** + * Clears the summary buffer and wipes the summary file + * + * @returns {Summary} summary instance + */ + clear() { + return __awaiter2(this, void 0, void 0, function* () { + return this.emptyBuffer().write({ overwrite: true }); + }); + } + /** + * Returns the current summary buffer as a string + * + * @returns {string} string of summary buffer + */ + stringify() { + return this._buffer; + } + /** + * If the summary buffer is empty + * + * @returns {boolen} true if the buffer is empty + */ + isEmptyBuffer() { + return this._buffer.length === 0; + } + /** + * Resets the summary buffer without writing to summary file + * + * @returns {Summary} summary instance + */ + emptyBuffer() { + this._buffer = ""; + return this; + } + /** + * Adds raw text to the summary buffer + * + * @param {string} text content to add + * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false) + * + * @returns {Summary} summary instance + */ + addRaw(text, addEOL = false) { + this._buffer += text; + return addEOL ? this.addEOL() : this; + } + /** + * Adds the operating system-specific end-of-line marker to the buffer + * + * @returns {Summary} summary instance + */ + addEOL() { + return this.addRaw(os_1.EOL); + } + /** + * Adds an HTML codeblock to the summary buffer + * + * @param {string} code content to render within fenced code block + * @param {string} lang (optional) language to syntax highlight code + * + * @returns {Summary} summary instance + */ + addCodeBlock(code, lang) { + const attrs = Object.assign({}, lang && { lang }); + const element = this.wrap("pre", this.wrap("code", code), attrs); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML list to the summary buffer + * + * @param {string[]} items list of items to render + * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false) + * + * @returns {Summary} summary instance + */ + addList(items, ordered = false) { + const tag = ordered ? "ol" : "ul"; + const listItems = items.map((item) => this.wrap("li", item)).join(""); + const element = this.wrap(tag, listItems); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML table to the summary buffer + * + * @param {SummaryTableCell[]} rows table rows + * + * @returns {Summary} summary instance + */ + addTable(rows) { + const tableBody = rows.map((row) => { + const cells = row.map((cell) => { + if (typeof cell === "string") { + return this.wrap("td", cell); + } + const { header, data, colspan, rowspan } = cell; + const tag = header ? "th" : "td"; + const attrs = Object.assign(Object.assign({}, colspan && { colspan }), rowspan && { rowspan }); + return this.wrap(tag, data, attrs); + }).join(""); + return this.wrap("tr", cells); + }).join(""); + const element = this.wrap("table", tableBody); + return this.addRaw(element).addEOL(); + } + /** + * Adds a collapsable HTML details element to the summary buffer + * + * @param {string} label text for the closed state + * @param {string} content collapsable content + * + * @returns {Summary} summary instance + */ + addDetails(label, content) { + const element = this.wrap("details", this.wrap("summary", label) + content); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML image tag to the summary buffer + * + * @param {string} src path to the image you to embed + * @param {string} alt text description of the image + * @param {SummaryImageOptions} options (optional) addition image attributes + * + * @returns {Summary} summary instance + */ + addImage(src, alt, options) { + const { width, height } = options || {}; + const attrs = Object.assign(Object.assign({}, width && { width }), height && { height }); + const element = this.wrap("img", null, Object.assign({ src, alt }, attrs)); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML section heading element + * + * @param {string} text heading text + * @param {number | string} [level=1] (optional) the heading level, default: 1 + * + * @returns {Summary} summary instance + */ + addHeading(text, level) { + const tag = `h${level}`; + const allowedTag = ["h1", "h2", "h3", "h4", "h5", "h6"].includes(tag) ? tag : "h1"; + const element = this.wrap(allowedTag, text); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML thematic break (
) to the summary buffer + * + * @returns {Summary} summary instance + */ + addSeparator() { + const element = this.wrap("hr", null); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML line break (
) to the summary buffer + * + * @returns {Summary} summary instance + */ + addBreak() { + const element = this.wrap("br", null); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML blockquote to the summary buffer + * + * @param {string} text quote text + * @param {string} cite (optional) citation url + * + * @returns {Summary} summary instance + */ + addQuote(text, cite) { + const attrs = Object.assign({}, cite && { cite }); + const element = this.wrap("blockquote", text, attrs); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML anchor tag to the summary buffer + * + * @param {string} text link text/content + * @param {string} href hyperlink + * + * @returns {Summary} summary instance + */ + addLink(text, href) { + const element = this.wrap("a", text, { href }); + return this.addRaw(element).addEOL(); + } + }; + var _summary = new Summary(); + exports.markdownSummary = _summary; + exports.summary = _summary; + } +}); + +// node_modules/@actions/core/lib/path-utils.js +var require_path_utils = __commonJS({ + "node_modules/@actions/core/lib/path-utils.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); + }) : (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + })); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = exports && exports.__importStar || /* @__PURE__ */ (function() { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function(o2) { + var ar = []; + for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + } + __setModuleDefault(result, mod); + return result; + }; + })(); + Object.defineProperty(exports, "__esModule", { value: true }); + exports.toPosixPath = toPosixPath; + exports.toWin32Path = toWin32Path; + exports.toPlatformPath = toPlatformPath; + var path2 = __importStar(__require("path")); + function toPosixPath(pth) { + return pth.replace(/[\\]/g, "/"); + } + function toWin32Path(pth) { + return pth.replace(/[/]/g, "\\"); + } + function toPlatformPath(pth) { + return pth.replace(/[/\\]/g, path2.sep); + } + } +}); + +// node_modules/@actions/io/lib/io-util.js +var require_io_util = __commonJS({ + "node_modules/@actions/io/lib/io-util.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); + }) : (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + })); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = exports && exports.__importStar || /* @__PURE__ */ (function() { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function(o2) { + var ar = []; + for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + } + __setModuleDefault(result, mod); + return result; + }; + })(); + var __awaiter2 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + var _a; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.READONLY = exports.UV_FS_O_EXLOCK = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports.rename = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0; + exports.readlink = readlink; + exports.exists = exists; + exports.isDirectory = isDirectory; + exports.isRooted = isRooted; + exports.tryGetExecutablePath = tryGetExecutablePath; + exports.getCmdPath = getCmdPath; + var fs2 = __importStar(__require("fs")); + var path2 = __importStar(__require("path")); + _a = fs2.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.open = _a.open, exports.readdir = _a.readdir, exports.rename = _a.rename, exports.rm = _a.rm, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; + exports.IS_WINDOWS = process.platform === "win32"; + function readlink(fsPath) { + return __awaiter2(this, void 0, void 0, function* () { + const result = yield fs2.promises.readlink(fsPath); + if (exports.IS_WINDOWS && !result.endsWith("\\")) { + return `${result}\\`; + } + return result; + }); + } + exports.UV_FS_O_EXLOCK = 268435456; + exports.READONLY = fs2.constants.O_RDONLY; + function exists(fsPath) { + return __awaiter2(this, void 0, void 0, function* () { + try { + yield (0, exports.stat)(fsPath); + } catch (err) { + if (err.code === "ENOENT") { + return false; + } + throw err; + } + return true; + }); + } + function isDirectory(fsPath_1) { + return __awaiter2(this, arguments, void 0, function* (fsPath, useStat = false) { + const stats = useStat ? yield (0, exports.stat)(fsPath) : yield (0, exports.lstat)(fsPath); + return stats.isDirectory(); + }); + } + function isRooted(p) { + p = normalizeSeparators(p); + if (!p) { + throw new Error('isRooted() parameter "p" cannot be empty'); + } + if (exports.IS_WINDOWS) { + return p.startsWith("\\") || /^[A-Z]:/i.test(p); + } + return p.startsWith("/"); + } + function tryGetExecutablePath(filePath, extensions) { + return __awaiter2(this, void 0, void 0, function* () { + let stats = void 0; + try { + stats = yield (0, exports.stat)(filePath); + } catch (err) { + if (err.code !== "ENOENT") { + console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); + } + } + if (stats && stats.isFile()) { + if (exports.IS_WINDOWS) { + const upperExt = path2.extname(filePath).toUpperCase(); + if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { + return filePath; + } + } else { + if (isUnixExecutable(stats)) { + return filePath; + } + } + } + const originalFilePath = filePath; + for (const extension of extensions) { + filePath = originalFilePath + extension; + stats = void 0; + try { + stats = yield (0, exports.stat)(filePath); + } catch (err) { + if (err.code !== "ENOENT") { + console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); + } + } + if (stats && stats.isFile()) { + if (exports.IS_WINDOWS) { + try { + const directory = path2.dirname(filePath); + const upperName = path2.basename(filePath).toUpperCase(); + for (const actualName of yield (0, exports.readdir)(directory)) { + if (upperName === actualName.toUpperCase()) { + filePath = path2.join(directory, actualName); + break; + } + } + } catch (err) { + console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); + } + return filePath; + } else { + if (isUnixExecutable(stats)) { + return filePath; + } + } + } + } + return ""; + }); + } + function normalizeSeparators(p) { + p = p || ""; + if (exports.IS_WINDOWS) { + p = p.replace(/\//g, "\\"); + return p.replace(/\\\\+/g, "\\"); + } + return p.replace(/\/\/+/g, "/"); + } + function isUnixExecutable(stats) { + return (stats.mode & 1) > 0 || (stats.mode & 8) > 0 && process.getgid !== void 0 && stats.gid === process.getgid() || (stats.mode & 64) > 0 && process.getuid !== void 0 && stats.uid === process.getuid(); + } + function getCmdPath() { + var _a2; + return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; + } + } +}); + +// node_modules/@actions/io/lib/io.js +var require_io = __commonJS({ + "node_modules/@actions/io/lib/io.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); + }) : (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + })); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = exports && exports.__importStar || /* @__PURE__ */ (function() { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function(o2) { + var ar = []; + for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + } + __setModuleDefault(result, mod); + return result; + }; + })(); + var __awaiter2 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.cp = cp; + exports.mv = mv; + exports.rmRF = rmRF; + exports.mkdirP = mkdirP; + exports.which = which; + exports.findInPath = findInPath; + var assert_1 = __require("assert"); + var path2 = __importStar(__require("path")); + var ioUtil = __importStar(require_io_util()); + function cp(source_1, dest_1) { + return __awaiter2(this, arguments, void 0, function* (source, dest, options = {}) { + const { force, recursive, copySourceDirectory } = readCopyOptions(options); + const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null; + if (destStat && destStat.isFile() && !force) { + return; + } + const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path2.join(dest, path2.basename(source)) : dest; + if (!(yield ioUtil.exists(source))) { + throw new Error(`no such file or directory: ${source}`); + } + const sourceStat = yield ioUtil.stat(source); + if (sourceStat.isDirectory()) { + if (!recursive) { + throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`); + } else { + yield cpDirRecursive(source, newDest, 0, force); + } + } else { + if (path2.relative(source, newDest) === "") { + throw new Error(`'${newDest}' and '${source}' are the same file`); + } + yield copyFile(source, newDest, force); + } + }); + } + function mv(source_1, dest_1) { + return __awaiter2(this, arguments, void 0, function* (source, dest, options = {}) { + if (yield ioUtil.exists(dest)) { + let destExists = true; + if (yield ioUtil.isDirectory(dest)) { + dest = path2.join(dest, path2.basename(source)); + destExists = yield ioUtil.exists(dest); + } + if (destExists) { + if (options.force == null || options.force) { + yield rmRF(dest); + } else { + throw new Error("Destination already exists"); + } + } + } + yield mkdirP(path2.dirname(dest)); + yield ioUtil.rename(source, dest); + }); + } + function rmRF(inputPath) { + return __awaiter2(this, void 0, void 0, function* () { + if (ioUtil.IS_WINDOWS) { + if (/[*"<>|]/.test(inputPath)) { + throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows'); + } + } + try { + yield ioUtil.rm(inputPath, { + force: true, + maxRetries: 3, + recursive: true, + retryDelay: 300 + }); + } catch (err) { + throw new Error(`File was unable to be removed ${err}`); + } + }); + } + function mkdirP(fsPath) { + return __awaiter2(this, void 0, void 0, function* () { + (0, assert_1.ok)(fsPath, "a path argument must be provided"); + yield ioUtil.mkdir(fsPath, { recursive: true }); + }); + } + function which(tool, check) { + return __awaiter2(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); + } + if (check) { + const result = yield which(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.`); + } else { + 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 check the file mode to verify the file is executable.`); + } + } + return result; + } + const matches = yield findInPath(tool); + if (matches && matches.length > 0) { + return matches[0]; + } + return ""; + }); + } + function findInPath(tool) { + return __awaiter2(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); + } + const extensions = []; + if (ioUtil.IS_WINDOWS && process.env["PATHEXT"]) { + for (const extension of process.env["PATHEXT"].split(path2.delimiter)) { + if (extension) { + extensions.push(extension); + } + } + } + if (ioUtil.isRooted(tool)) { + const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); + if (filePath) { + return [filePath]; + } + return []; + } + if (tool.includes(path2.sep)) { + return []; + } + const directories = []; + if (process.env.PATH) { + for (const p of process.env.PATH.split(path2.delimiter)) { + if (p) { + directories.push(p); + } + } + } + const matches = []; + for (const directory of directories) { + const filePath = yield ioUtil.tryGetExecutablePath(path2.join(directory, tool), extensions); + if (filePath) { + matches.push(filePath); + } + } + return matches; + }); + } + function readCopyOptions(options) { + const force = options.force == null ? true : options.force; + const recursive = Boolean(options.recursive); + const copySourceDirectory = options.copySourceDirectory == null ? true : Boolean(options.copySourceDirectory); + return { force, recursive, copySourceDirectory }; + } + function cpDirRecursive(sourceDir, destDir, currentDepth, force) { + return __awaiter2(this, void 0, void 0, function* () { + if (currentDepth >= 255) + return; + currentDepth++; + yield mkdirP(destDir); + const files = yield ioUtil.readdir(sourceDir); + for (const fileName of files) { + const srcFile = `${sourceDir}/${fileName}`; + const destFile = `${destDir}/${fileName}`; + const srcFileStat = yield ioUtil.lstat(srcFile); + if (srcFileStat.isDirectory()) { + yield cpDirRecursive(srcFile, destFile, currentDepth, force); + } else { + yield copyFile(srcFile, destFile, force); + } + } + yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); + }); + } + function copyFile(srcFile, destFile, force) { + return __awaiter2(this, void 0, void 0, function* () { + if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { + try { + yield ioUtil.lstat(destFile); + yield ioUtil.unlink(destFile); + } catch (e) { + if (e.code === "EPERM") { + yield ioUtil.chmod(destFile, "0666"); + yield ioUtil.unlink(destFile); + } + } + const symlinkFull = yield ioUtil.readlink(srcFile); + yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? "junction" : null); + } else if (!(yield ioUtil.exists(destFile)) || force) { + yield ioUtil.copyFile(srcFile, destFile); + } + }); + } + } +}); + +// node_modules/@actions/exec/lib/toolrunner.js +var require_toolrunner = __commonJS({ + "node_modules/@actions/exec/lib/toolrunner.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); + }) : (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + })); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = exports && exports.__importStar || /* @__PURE__ */ (function() { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function(o2) { + var ar = []; + for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + } + __setModuleDefault(result, mod); + return result; + }; + })(); + var __awaiter2 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ToolRunner = void 0; + exports.argStringToArray = argStringToArray; + var os = __importStar(__require("os")); + var events = __importStar(__require("events")); + var child = __importStar(__require("child_process")); + var path2 = __importStar(__require("path")); + var io = __importStar(require_io()); + var ioUtil = __importStar(require_io_util()); + var timers_1 = __require("timers"); + var IS_WINDOWS = process.platform === "win32"; + var ToolRunner = class extends events.EventEmitter { + constructor(toolPath, args, options) { + super(); + if (!toolPath) { + throw new Error("Parameter 'toolPath' cannot be null or empty."); + } + this.toolPath = toolPath; + this.args = args || []; + this.options = options || {}; + } + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } + } + _getCommandString(options, noPrefix) { + const toolPath = this._getSpawnFileName(); + const args = this._getSpawnArgs(options); + let cmd = noPrefix ? "" : "[command]"; + if (IS_WINDOWS) { + if (this._isCmdFile()) { + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } + } else if (options.windowsVerbatimArguments) { + cmd += `"${toolPath}"`; + for (const a of args) { + cmd += ` ${a}`; + } + } else { + cmd += this._windowsQuoteCmdArg(toolPath); + for (const a of args) { + cmd += ` ${this._windowsQuoteCmdArg(a)}`; + } + } + } else { + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } + } + return cmd; + } + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + s = s.substring(n + os.EOL.length); + n = s.indexOf(os.EOL); + } + return s; + } catch (err) { + this._debug(`error processing line. Failed with error ${err}`); + return ""; + } + } + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env["COMSPEC"] || "cmd.exe"; + } + } + return this.toolPath; + } + _getSpawnArgs(options) { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; + for (const a of this.args) { + argline += " "; + argline += options.windowsVerbatimArguments ? a : this._windowsQuoteCmdArg(a); + } + argline += '"'; + return [argline]; + } + } + return this.args; + } + _endsWith(str, end) { + return str.endsWith(end); + } + _isCmdFile() { + const upperToolPath = this.toolPath.toUpperCase(); + return this._endsWith(upperToolPath, ".CMD") || this._endsWith(upperToolPath, ".BAT"); + } + _windowsQuoteCmdArg(arg) { + if (!this._isCmdFile()) { + return this._uvQuoteCmdArg(arg); + } + if (!arg) { + return '""'; + } + const cmdSpecialChars = [ + " ", + " ", + "&", + "(", + ")", + "[", + "]", + "{", + "}", + "^", + "=", + ";", + "!", + "'", + "+", + ",", + "`", + "~", + "|", + "<", + ">", + '"' + ]; + let needsQuotes = false; + for (const char of arg) { + if (cmdSpecialChars.some((x) => x === char)) { + needsQuotes = true; + break; + } + } + if (!needsQuotes) { + return arg; + } + let reverse = '"'; + let quoteHit = true; + for (let i = arg.length; i > 0; i--) { + reverse += arg[i - 1]; + if (quoteHit && arg[i - 1] === "\\") { + reverse += "\\"; + } else if (arg[i - 1] === '"') { + quoteHit = true; + reverse += '"'; + } else { + quoteHit = false; + } + } + reverse += '"'; + return reverse.split("").reverse().join(""); + } + _uvQuoteCmdArg(arg) { + if (!arg) { + return '""'; + } + if (!arg.includes(" ") && !arg.includes(" ") && !arg.includes('"')) { + return arg; + } + if (!arg.includes('"') && !arg.includes("\\")) { + return `"${arg}"`; + } + let reverse = '"'; + let quoteHit = true; + for (let i = arg.length; i > 0; i--) { + reverse += arg[i - 1]; + if (quoteHit && arg[i - 1] === "\\") { + reverse += "\\"; + } else if (arg[i - 1] === '"') { + quoteHit = true; + reverse += "\\"; + } else { + quoteHit = false; + } + } + reverse += '"'; + return reverse.split("").reverse().join(""); + } + _cloneExecOptions(options) { + options = options || {}; + const result = { + cwd: options.cwd || process.cwd(), + env: options.env || process.env, + silent: options.silent || false, + windowsVerbatimArguments: options.windowsVerbatimArguments || false, + failOnStdErr: options.failOnStdErr || false, + ignoreReturnCode: options.ignoreReturnCode || false, + delay: options.delay || 1e4 + }; + result.outStream = options.outStream || process.stdout; + result.errStream = options.errStream || process.stderr; + return result; + } + _getSpawnOptions(options, toolPath) { + options = options || {}; + const result = {}; + result.cwd = options.cwd; + result.env = options.env; + result["windowsVerbatimArguments"] = options.windowsVerbatimArguments || this._isCmdFile(); + if (options.windowsVerbatimArguments) { + result.argv0 = `"${toolPath}"`; + } + return result; + } + /** + * Exec a tool. + * Output will be streamed to the live console. + * Returns promise with return code + * + * @param tool path to tool to exec + * @param options optional exec options. See ExecOptions + * @returns number + */ + 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 = yield io.which(this.toolPath, true); + return new Promise((resolve, reject) => __awaiter2(this, void 0, void 0, function* () { + this._debug(`exec tool: ${this.toolPath}`); + this._debug("arguments:"); + for (const arg of this.args) { + this._debug(` ${arg}`); + } + const optionsNonNull = this._cloneExecOptions(this.options); + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL); + } + const state = new ExecState(optionsNonNull, this.toolPath); + state.on("debug", (message) => { + this._debug(message); + }); + if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) { + return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`)); + } + const fileName = this._getSpawnFileName(); + const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName)); + let stdbuffer = ""; + if (cp.stdout) { + cp.stdout.on("data", (data) => { + if (this.options.listeners && this.options.listeners.stdout) { + this.options.listeners.stdout(data); + } + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(data); + } + stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => { + if (this.options.listeners && this.options.listeners.stdline) { + this.options.listeners.stdline(line); + } + }); + }); + } + let errbuffer = ""; + if (cp.stderr) { + cp.stderr.on("data", (data) => { + state.processStderr = true; + if (this.options.listeners && this.options.listeners.stderr) { + this.options.listeners.stderr(data); + } + if (!optionsNonNull.silent && optionsNonNull.errStream && optionsNonNull.outStream) { + const s = optionsNonNull.failOnStdErr ? optionsNonNull.errStream : optionsNonNull.outStream; + s.write(data); + } + errbuffer = this._processLineBuffer(data, errbuffer, (line) => { + if (this.options.listeners && this.options.listeners.errline) { + this.options.listeners.errline(line); + } + }); + }); + } + cp.on("error", (err) => { + state.processError = err.message; + state.processExited = true; + state.processClosed = true; + state.CheckComplete(); + }); + cp.on("exit", (code) => { + state.processExitCode = code; + state.processExited = true; + this._debug(`Exit code ${code} received from tool '${this.toolPath}'`); + state.CheckComplete(); + }); + cp.on("close", (code) => { + state.processExitCode = code; + state.processExited = true; + state.processClosed = true; + this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); + state.CheckComplete(); + }); + state.on("done", (error3, exitCode) => { + if (stdbuffer.length > 0) { + this.emit("stdline", stdbuffer); + } + if (errbuffer.length > 0) { + this.emit("errline", errbuffer); + } + cp.removeAllListeners(); + if (error3) { + reject(error3); + } else { + resolve(exitCode); + } + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error("child process missing stdin"); + } + cp.stdin.end(this.options.input); + } + })); + }); + } + }; + exports.ToolRunner = ToolRunner; + function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ""; + function append(c) { + if (escaped && c !== '"') { + arg += "\\"; + } + arg += c; + escaped = false; + } + for (let i = 0; i < argString.length; i++) { + const c = argString.charAt(i); + if (c === '"') { + if (!escaped) { + inQuotes = !inQuotes; + } else { + append(c); + } + continue; + } + if (c === "\\" && escaped) { + append(c); + continue; + } + if (c === "\\" && inQuotes) { + escaped = true; + continue; + } + if (c === " " && !inQuotes) { + if (arg.length > 0) { + args.push(arg); + arg = ""; + } + continue; + } + append(c); + } + if (arg.length > 0) { + args.push(arg.trim()); + } + return args; + } + var ExecState = class _ExecState extends events.EventEmitter { + constructor(options, toolPath) { + super(); + this.processClosed = false; + this.processError = ""; + this.processExitCode = 0; + this.processExited = false; + this.processStderr = false; + this.delay = 1e4; + this.done = false; + this.timeout = null; + if (!toolPath) { + throw new Error("toolPath must not be empty"); + } + this.options = options; + this.toolPath = toolPath; + if (options.delay) { + this.delay = options.delay; + } + } + CheckComplete() { + if (this.done) { + return; + } + if (this.processClosed) { + this._setResult(); + } else if (this.processExited) { + this.timeout = (0, timers_1.setTimeout)(_ExecState.HandleTimeout, this.delay, this); + } + } + _debug(message) { + this.emit("debug", message); + } + _setResult() { + let error3; + if (this.processExited) { + if (this.processError) { + error3 = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`); + } else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) { + error3 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); + } else if (this.processStderr && this.options.failOnStdErr) { + error3 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); + } + } + if (this.timeout) { + clearTimeout(this.timeout); + this.timeout = null; + } + this.done = true; + this.emit("done", error3, this.processExitCode); + } + static HandleTimeout(state) { + if (state.done) { + return; + } + if (!state.processClosed && state.processExited) { + const message = `The STDIO streams did not close within ${state.delay / 1e3} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; + state._debug(message); + } + state._setResult(); + } + }; + } +}); + +// node_modules/@actions/exec/lib/exec.js +var require_exec = __commonJS({ + "node_modules/@actions/exec/lib/exec.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); + }) : (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + })); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = exports && exports.__importStar || /* @__PURE__ */ (function() { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function(o2) { + var ar = []; + for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + } + __setModuleDefault(result, mod); + return result; + }; + })(); + var __awaiter2 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.exec = exec; + exports.getExecOutput = getExecOutput; + var string_decoder_1 = __require("string_decoder"); + var tr = __importStar(require_toolrunner()); + function exec(commandLine, args, options) { + return __awaiter2(this, void 0, void 0, function* () { + const commandArgs = tr.argStringToArray(commandLine); + if (commandArgs.length === 0) { + throw new Error(`Parameter 'commandLine' cannot be null or empty.`); + } + const toolPath = commandArgs[0]; + args = commandArgs.slice(1).concat(args || []); + const runner = new tr.ToolRunner(toolPath, args, options); + return runner.exec(); + }); + } + function getExecOutput(commandLine, args, options) { + return __awaiter2(this, void 0, void 0, function* () { + var _a, _b; + let stdout = ""; + let stderr = ""; + const stdoutDecoder = new string_decoder_1.StringDecoder("utf8"); + const stderrDecoder = new string_decoder_1.StringDecoder("utf8"); + const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout; + const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr; + const stdErrListener = (data) => { + stderr += stderrDecoder.write(data); + if (originalStdErrListener) { + originalStdErrListener(data); + } + }; + const stdOutListener = (data) => { + stdout += stdoutDecoder.write(data); + if (originalStdoutListener) { + originalStdoutListener(data); + } + }; + const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); + const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + stdout += stdoutDecoder.end(); + stderr += stderrDecoder.end(); + return { + exitCode, + stdout, + stderr + }; + }); + } + } +}); + +// node_modules/@actions/core/lib/platform.js +var require_platform = __commonJS({ + "node_modules/@actions/core/lib/platform.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); + }) : (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + })); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = exports && exports.__importStar || /* @__PURE__ */ (function() { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function(o2) { + var ar = []; + for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + } + __setModuleDefault(result, mod); + return result; + }; + })(); + var __awaiter2 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + var __importDefault = exports && exports.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isLinux = exports.isMacOS = exports.isWindows = exports.arch = exports.platform = void 0; + exports.getDetails = getDetails; + var os_1 = __importDefault(__require("os")); + var exec = __importStar(require_exec()); + var getWindowsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + silent: true + }); + const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { + silent: true + }); + return { + name: name.trim(), + version: version.trim() + }; + }); + var getMacOsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + var _a, _b, _c, _d; + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : ""; + const name = (_d = (_c = stdout.match(/ProductName:\s*(.+)/)) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : ""; + return { + name, + version + }; + }); + var getLinuxInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + const { stdout } = yield exec.getExecOutput("lsb_release", ["-i", "-r", "-s"], { + silent: true + }); + const [name, version] = stdout.trim().split("\n"); + return { + name, + version + }; + }); + exports.platform = os_1.default.platform(); + exports.arch = os_1.default.arch(); + exports.isWindows = exports.platform === "win32"; + exports.isMacOS = exports.platform === "darwin"; + exports.isLinux = exports.platform === "linux"; + function getDetails() { + return __awaiter2(this, void 0, void 0, function* () { + return Object.assign(Object.assign({}, yield exports.isWindows ? getWindowsInfo() : exports.isMacOS ? getMacOsInfo() : getLinuxInfo()), { + platform: exports.platform, + arch: exports.arch, + isWindows: exports.isWindows, + isMacOS: exports.isMacOS, + isLinux: exports.isLinux + }); + }); + } + } +}); + +// node_modules/@actions/core/lib/core.js +var require_core = __commonJS({ + "node_modules/@actions/core/lib/core.js"(exports) { + "use strict"; + var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); + }) : (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + })); + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __importStar = exports && exports.__importStar || /* @__PURE__ */ (function() { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function(o2) { + var ar = []; + for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + } + __setModuleDefault(result, mod); + return result; + }; + })(); + var __awaiter2 = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.platform = exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = exports.markdownSummary = exports.summary = exports.ExitCode = void 0; + exports.exportVariable = exportVariable; + exports.setSecret = setSecret; + exports.addPath = addPath; + exports.getInput = getInput3; + exports.getMultilineInput = getMultilineInput; + exports.getBooleanInput = getBooleanInput2; + exports.setOutput = setOutput; + exports.setCommandEcho = setCommandEcho; + exports.setFailed = setFailed2; + exports.isDebug = isDebug; + exports.debug = debug; + exports.error = error3; + exports.warning = warning; + exports.notice = notice; + exports.info = info7; + exports.startGroup = startGroup; + exports.endGroup = endGroup; + exports.group = group; + exports.saveState = saveState; + exports.getState = getState; + exports.getIDToken = getIDToken; + var command_1 = require_command(); + var file_command_1 = require_file_command(); + var utils_1 = require_utils(); + var os = __importStar(__require("os")); + var path2 = __importStar(__require("path")); + var oidc_utils_1 = require_oidc_utils(); + var ExitCode; + (function(ExitCode2) { + ExitCode2[ExitCode2["Success"] = 0] = "Success"; + ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; + })(ExitCode || (exports.ExitCode = ExitCode = {})); + function exportVariable(name, val) { + const convertedVal = (0, utils_1.toCommandValue)(val); + process.env[name] = convertedVal; + const filePath = process.env["GITHUB_ENV"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("ENV", (0, file_command_1.prepareKeyValueMessage)(name, val)); + } + (0, command_1.issueCommand)("set-env", { name }, convertedVal); + } + function setSecret(secret) { + (0, command_1.issueCommand)("add-mask", {}, secret); + } + function addPath(inputPath) { + const filePath = process.env["GITHUB_PATH"] || ""; + if (filePath) { + (0, file_command_1.issueFileCommand)("PATH", inputPath); + } else { + (0, command_1.issueCommand)("add-path", {}, inputPath); + } + process.env["PATH"] = `${inputPath}${path2.delimiter}${process.env["PATH"]}`; + } + function getInput3(name, options) { + const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; + if (options && options.required && !val) { + throw new Error(`Input required and not supplied: ${name}`); + } + if (options && options.trimWhitespace === false) { + return val; + } + return val.trim(); + } + function getMultilineInput(name, options) { + const inputs = getInput3(name, options).split("\n").filter((x) => x !== ""); + if (options && options.trimWhitespace === false) { + return inputs; + } + return inputs.map((input) => input.trim()); + } + function getBooleanInput2(name, options) { + const trueValue = ["true", "True", "TRUE"]; + const falseValue = ["false", "False", "FALSE"]; + const val = getInput3(name, options); + if (trueValue.includes(val)) + return true; + if (falseValue.includes(val)) + return false; + throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name} +Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); + } + function setOutput(name, value) { + const filePath = process.env["GITHUB_OUTPUT"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value)); + } + process.stdout.write(os.EOL); + (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); + } + function setCommandEcho(enabled) { + (0, command_1.issue)("echo", enabled ? "on" : "off"); + } + function setFailed2(message) { + process.exitCode = ExitCode.Failure; + error3(message); + } + function isDebug() { + return process.env["RUNNER_DEBUG"] === "1"; + } + function debug(message) { + (0, command_1.issueCommand)("debug", {}, message); + } + function error3(message, properties = {}) { + (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + function warning(message, properties = {}) { + (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + function notice(message, properties = {}) { + (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + function info7(message) { + process.stdout.write(message + os.EOL); + } + function startGroup(name) { + (0, command_1.issue)("group", name); + } + function endGroup() { + (0, command_1.issue)("endgroup"); + } + function group(name, fn) { + return __awaiter2(this, void 0, void 0, function* () { + startGroup(name); + let result; + try { + result = yield fn(); + } finally { + endGroup(); + } + return result; + }); + } + function saveState(name, value) { + const filePath = process.env["GITHUB_STATE"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("STATE", (0, file_command_1.prepareKeyValueMessage)(name, value)); + } + (0, command_1.issueCommand)("save-state", { name }, (0, utils_1.toCommandValue)(value)); + } + function getState(name) { + return process.env[`STATE_${name}`] || ""; + } + function getIDToken(aud) { + return __awaiter2(this, void 0, void 0, function* () { + return yield oidc_utils_1.OidcClient.getIDToken(aud); + }); + } + var summary_1 = require_summary(); + Object.defineProperty(exports, "summary", { enumerable: true, get: function() { + return summary_1.summary; + } }); + var summary_2 = require_summary(); + Object.defineProperty(exports, "markdownSummary", { enumerable: true, get: function() { + return summary_2.markdownSummary; + } }); + var path_utils_1 = require_path_utils(); + Object.defineProperty(exports, "toPosixPath", { enumerable: true, get: function() { + return path_utils_1.toPosixPath; + } }); + Object.defineProperty(exports, "toWin32Path", { enumerable: true, get: function() { + return path_utils_1.toWin32Path; + } }); + Object.defineProperty(exports, "toPlatformPath", { enumerable: true, get: function() { + return path_utils_1.toPlatformPath; + } }); + exports.platform = __importStar(require_platform()); } }); @@ -19389,478 +21587,12 @@ var require_fast_content_type_parse = __commonJS({ }); // src/main.ts +var core7 = __toESM(require_core(), 1); import * as process2 from "process"; -// node_modules/@actions/core/lib/command.js -import * as os from "os"; - -// node_modules/@actions/core/lib/utils.js -function toCommandValue(input) { - if (input === null || input === void 0) { - return ""; - } else if (typeof input === "string" || input instanceof String) { - return input; - } - return JSON.stringify(input); -} -function toCommandProperties(annotationProperties) { - if (!Object.keys(annotationProperties).length) { - return {}; - } - return { - title: annotationProperties.title, - file: annotationProperties.file, - line: annotationProperties.startLine, - endLine: annotationProperties.endLine, - col: annotationProperties.startColumn, - endColumn: annotationProperties.endColumn - }; -} - -// node_modules/@actions/core/lib/command.js -function issueCommand(command, properties, message) { - const cmd = new Command(command, properties, message); - process.stdout.write(cmd.toString() + os.EOL); -} -var CMD_STRING = "::"; -var Command = class { - constructor(command, properties, message) { - if (!command) { - command = "missing.command"; - } - this.command = command; - this.properties = properties; - this.message = message; - } - toString() { - let cmdStr = CMD_STRING + this.command; - if (this.properties && Object.keys(this.properties).length > 0) { - cmdStr += " "; - let first = true; - for (const key in this.properties) { - if (this.properties.hasOwnProperty(key)) { - const val = this.properties[key]; - if (val) { - if (first) { - first = false; - } else { - cmdStr += ","; - } - cmdStr += `${key}=${escapeProperty(val)}`; - } - } - } - } - cmdStr += `${CMD_STRING}${escapeData(this.message)}`; - return cmdStr; - } -}; -function escapeData(s) { - return toCommandValue(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A"); -} -function escapeProperty(s) { - return toCommandValue(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/:/g, "%3A").replace(/,/g, "%2C"); -} - -// node_modules/@actions/core/lib/core.js -import * as os3 from "os"; - -// node_modules/@actions/core/node_modules/@actions/http-client/lib/index.js -var tunnel = __toESM(require_tunnel2(), 1); -var import_undici = __toESM(require_undici(), 1); -var HttpCodes; -(function(HttpCodes2) { - HttpCodes2[HttpCodes2["OK"] = 200] = "OK"; - HttpCodes2[HttpCodes2["MultipleChoices"] = 300] = "MultipleChoices"; - HttpCodes2[HttpCodes2["MovedPermanently"] = 301] = "MovedPermanently"; - HttpCodes2[HttpCodes2["ResourceMoved"] = 302] = "ResourceMoved"; - HttpCodes2[HttpCodes2["SeeOther"] = 303] = "SeeOther"; - HttpCodes2[HttpCodes2["NotModified"] = 304] = "NotModified"; - HttpCodes2[HttpCodes2["UseProxy"] = 305] = "UseProxy"; - HttpCodes2[HttpCodes2["SwitchProxy"] = 306] = "SwitchProxy"; - HttpCodes2[HttpCodes2["TemporaryRedirect"] = 307] = "TemporaryRedirect"; - HttpCodes2[HttpCodes2["PermanentRedirect"] = 308] = "PermanentRedirect"; - HttpCodes2[HttpCodes2["BadRequest"] = 400] = "BadRequest"; - HttpCodes2[HttpCodes2["Unauthorized"] = 401] = "Unauthorized"; - HttpCodes2[HttpCodes2["PaymentRequired"] = 402] = "PaymentRequired"; - HttpCodes2[HttpCodes2["Forbidden"] = 403] = "Forbidden"; - HttpCodes2[HttpCodes2["NotFound"] = 404] = "NotFound"; - HttpCodes2[HttpCodes2["MethodNotAllowed"] = 405] = "MethodNotAllowed"; - HttpCodes2[HttpCodes2["NotAcceptable"] = 406] = "NotAcceptable"; - HttpCodes2[HttpCodes2["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; - HttpCodes2[HttpCodes2["RequestTimeout"] = 408] = "RequestTimeout"; - HttpCodes2[HttpCodes2["Conflict"] = 409] = "Conflict"; - HttpCodes2[HttpCodes2["Gone"] = 410] = "Gone"; - HttpCodes2[HttpCodes2["TooManyRequests"] = 429] = "TooManyRequests"; - HttpCodes2[HttpCodes2["InternalServerError"] = 500] = "InternalServerError"; - HttpCodes2[HttpCodes2["NotImplemented"] = 501] = "NotImplemented"; - HttpCodes2[HttpCodes2["BadGateway"] = 502] = "BadGateway"; - HttpCodes2[HttpCodes2["ServiceUnavailable"] = 503] = "ServiceUnavailable"; - HttpCodes2[HttpCodes2["GatewayTimeout"] = 504] = "GatewayTimeout"; -})(HttpCodes || (HttpCodes = {})); -var Headers; -(function(Headers2) { - Headers2["Accept"] = "accept"; - Headers2["ContentType"] = "content-type"; -})(Headers || (Headers = {})); -var MediaTypes; -(function(MediaTypes2) { - MediaTypes2["ApplicationJson"] = "application/json"; -})(MediaTypes || (MediaTypes = {})); -var HttpRedirectCodes = [ - HttpCodes.MovedPermanently, - HttpCodes.ResourceMoved, - HttpCodes.SeeOther, - HttpCodes.TemporaryRedirect, - HttpCodes.PermanentRedirect -]; -var HttpResponseRetryCodes = [ - HttpCodes.BadGateway, - HttpCodes.ServiceUnavailable, - HttpCodes.GatewayTimeout -]; - -// node_modules/@actions/core/lib/summary.js -import { EOL as EOL2 } from "os"; -import { constants, promises } from "fs"; -var __awaiter = function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve) { - resolve(value); - }); - } - return new (P || (P = Promise))(function(resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var { access, appendFile, writeFile } = promises; -var SUMMARY_ENV_VAR = "GITHUB_STEP_SUMMARY"; -var Summary = class { - constructor() { - this._buffer = ""; - } - /** - * Finds the summary file path from the environment, rejects if env var is not found or file does not exist - * Also checks r/w permissions. - * - * @returns step summary file path - */ - filePath() { - return __awaiter(this, void 0, void 0, function* () { - if (this._filePath) { - return this._filePath; - } - const pathFromEnv = process.env[SUMMARY_ENV_VAR]; - if (!pathFromEnv) { - throw new Error(`Unable to find environment variable for $${SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`); - } - try { - yield access(pathFromEnv, constants.R_OK | constants.W_OK); - } catch (_a) { - throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); - } - this._filePath = pathFromEnv; - return this._filePath; - }); - } - /** - * Wraps content in an HTML tag, adding any HTML attributes - * - * @param {string} tag HTML tag to wrap - * @param {string | null} content content within the tag - * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add - * - * @returns {string} content wrapped in HTML element - */ - wrap(tag, content, attrs = {}) { - const htmlAttrs = Object.entries(attrs).map(([key, value]) => ` ${key}="${value}"`).join(""); - if (!content) { - return `<${tag}${htmlAttrs}>`; - } - return `<${tag}${htmlAttrs}>${content}`; - } - /** - * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default. - * - * @param {SummaryWriteOptions} [options] (optional) options for write operation - * - * @returns {Promise} summary instance - */ - write(options) { - return __awaiter(this, void 0, void 0, function* () { - const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite); - const filePath = yield this.filePath(); - const writeFunc = overwrite ? writeFile : appendFile; - yield writeFunc(filePath, this._buffer, { encoding: "utf8" }); - return this.emptyBuffer(); - }); - } - /** - * Clears the summary buffer and wipes the summary file - * - * @returns {Summary} summary instance - */ - clear() { - return __awaiter(this, void 0, void 0, function* () { - return this.emptyBuffer().write({ overwrite: true }); - }); - } - /** - * Returns the current summary buffer as a string - * - * @returns {string} string of summary buffer - */ - stringify() { - return this._buffer; - } - /** - * If the summary buffer is empty - * - * @returns {boolen} true if the buffer is empty - */ - isEmptyBuffer() { - return this._buffer.length === 0; - } - /** - * Resets the summary buffer without writing to summary file - * - * @returns {Summary} summary instance - */ - emptyBuffer() { - this._buffer = ""; - return this; - } - /** - * Adds raw text to the summary buffer - * - * @param {string} text content to add - * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false) - * - * @returns {Summary} summary instance - */ - addRaw(text, addEOL = false) { - this._buffer += text; - return addEOL ? this.addEOL() : this; - } - /** - * Adds the operating system-specific end-of-line marker to the buffer - * - * @returns {Summary} summary instance - */ - addEOL() { - return this.addRaw(EOL2); - } - /** - * Adds an HTML codeblock to the summary buffer - * - * @param {string} code content to render within fenced code block - * @param {string} lang (optional) language to syntax highlight code - * - * @returns {Summary} summary instance - */ - addCodeBlock(code, lang) { - const attrs = Object.assign({}, lang && { lang }); - const element = this.wrap("pre", this.wrap("code", code), attrs); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML list to the summary buffer - * - * @param {string[]} items list of items to render - * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false) - * - * @returns {Summary} summary instance - */ - addList(items, ordered = false) { - const tag = ordered ? "ol" : "ul"; - const listItems = items.map((item) => this.wrap("li", item)).join(""); - const element = this.wrap(tag, listItems); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML table to the summary buffer - * - * @param {SummaryTableCell[]} rows table rows - * - * @returns {Summary} summary instance - */ - addTable(rows) { - const tableBody = rows.map((row) => { - const cells = row.map((cell) => { - if (typeof cell === "string") { - return this.wrap("td", cell); - } - const { header, data, colspan, rowspan } = cell; - const tag = header ? "th" : "td"; - const attrs = Object.assign(Object.assign({}, colspan && { colspan }), rowspan && { rowspan }); - return this.wrap(tag, data, attrs); - }).join(""); - return this.wrap("tr", cells); - }).join(""); - const element = this.wrap("table", tableBody); - return this.addRaw(element).addEOL(); - } - /** - * Adds a collapsable HTML details element to the summary buffer - * - * @param {string} label text for the closed state - * @param {string} content collapsable content - * - * @returns {Summary} summary instance - */ - addDetails(label, content) { - const element = this.wrap("details", this.wrap("summary", label) + content); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML image tag to the summary buffer - * - * @param {string} src path to the image you to embed - * @param {string} alt text description of the image - * @param {SummaryImageOptions} options (optional) addition image attributes - * - * @returns {Summary} summary instance - */ - addImage(src, alt, options) { - const { width, height } = options || {}; - const attrs = Object.assign(Object.assign({}, width && { width }), height && { height }); - const element = this.wrap("img", null, Object.assign({ src, alt }, attrs)); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML section heading element - * - * @param {string} text heading text - * @param {number | string} [level=1] (optional) the heading level, default: 1 - * - * @returns {Summary} summary instance - */ - addHeading(text, level) { - const tag = `h${level}`; - const allowedTag = ["h1", "h2", "h3", "h4", "h5", "h6"].includes(tag) ? tag : "h1"; - const element = this.wrap(allowedTag, text); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML thematic break (
) to the summary buffer - * - * @returns {Summary} summary instance - */ - addSeparator() { - const element = this.wrap("hr", null); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML line break (
) to the summary buffer - * - * @returns {Summary} summary instance - */ - addBreak() { - const element = this.wrap("br", null); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML blockquote to the summary buffer - * - * @param {string} text quote text - * @param {string} cite (optional) citation url - * - * @returns {Summary} summary instance - */ - addQuote(text, cite) { - const attrs = Object.assign({}, cite && { cite }); - const element = this.wrap("blockquote", text, attrs); - return this.addRaw(element).addEOL(); - } - /** - * Adds an HTML anchor tag to the summary buffer - * - * @param {string} text link text/content - * @param {string} href hyperlink - * - * @returns {Summary} summary instance - */ - addLink(text, href) { - const element = this.wrap("a", text, { href }); - return this.addRaw(element).addEOL(); - } -}; -var _summary = new Summary(); - -// node_modules/@actions/core/lib/platform.js -import os2 from "os"; - -// node_modules/@actions/io/lib/io-util.js -import * as fs from "fs"; -var { chmod, copyFile, lstat, mkdir, open, readdir, rename, rm, rmdir, stat, symlink, unlink } = fs.promises; -var IS_WINDOWS = process.platform === "win32"; -var READONLY = fs.constants.O_RDONLY; - -// node_modules/@actions/exec/lib/toolrunner.js -var IS_WINDOWS2 = process.platform === "win32"; - -// node_modules/@actions/core/lib/platform.js -var platform = os2.platform(); -var arch = os2.arch(); - -// node_modules/@actions/core/lib/core.js -var ExitCode; -(function(ExitCode2) { - ExitCode2[ExitCode2["Success"] = 0] = "Success"; - ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; -})(ExitCode || (ExitCode = {})); -function getInput(name, options) { - const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; - if (options && options.required && !val) { - throw new Error(`Input required and not supplied: ${name}`); - } - if (options && options.trimWhitespace === false) { - return val; - } - return val.trim(); -} -function getBooleanInput(name, options) { - const trueValue = ["true", "True", "TRUE"]; - const falseValue = ["false", "False", "FALSE"]; - const val = getInput(name, options); - if (trueValue.includes(val)) - return true; - if (falseValue.includes(val)) - return false; - throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name} -Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); -} -function setFailed(message) { - process.exitCode = ExitCode.Failure; - error(message); -} -function error(message, properties = {}) { - issueCommand("error", toCommandProperties(properties), message instanceof Error ? message.toString() : message); -} -function info(message) { - process.stdout.write(message + os3.EOL); -} - // node_modules/@actions/github/lib/context.js import { readFileSync, existsSync } from "fs"; -import { EOL as EOL4 } from "os"; +import { EOL } from "os"; var Context = class { /** * Hydrate the context from the environment @@ -19873,7 +21605,7 @@ var Context = class { this.payload = JSON.parse(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${EOL4}`); + process.stdout.write(`GITHUB_EVENT_PATH ${path2} does not exist${EOL}`); } } this.eventName = process.env.GITHUB_EVENT_NAME; @@ -19911,8 +21643,8 @@ var Context = class { // node_modules/@actions/github/lib/internal/utils.js var httpClient = __toESM(require_lib(), 1); -var import_undici2 = __toESM(require_undici(), 1); -var __awaiter2 = function(thisArg, _arguments, P, generator) { +var import_undici = __toESM(require_undici(), 1); +var __awaiter = function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve) { resolve(value); @@ -19957,8 +21689,8 @@ function getProxyAgentDispatcher(destinationUrl) { } function getProxyFetch(destinationUrl) { const httpDispatcher = getProxyAgentDispatcher(destinationUrl); - const proxyFetch = (url, opts) => __awaiter2(this, void 0, void 0, function* () { - return (0, import_undici2.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher })); + const proxyFetch = (url, opts) => __awaiter(this, void 0, void 0, function* () { + return (0, import_undici.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher })); }); return proxyFetch; } @@ -20024,8 +21756,8 @@ function addHook(state, kind, name, hook2) { } if (kind === "error") { hook2 = (method, options) => { - return Promise.resolve().then(method.bind(null, options)).catch((error2) => { - return orig(error2, options); + return Promise.resolve().then(method.bind(null, options)).catch((error3) => { + return orig(error3, options); }); }; } @@ -20482,26 +22214,26 @@ async function fetchWrapper(requestOptions) { // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex. ...requestOptions.body && { duplex: "half" } }); - } catch (error2) { + } catch (error3) { let message = "Unknown Error"; - if (error2 instanceof Error) { - if (error2.name === "AbortError") { - error2.status = 500; - throw error2; + if (error3 instanceof Error) { + if (error3.name === "AbortError") { + error3.status = 500; + throw error3; } - message = error2.message; - if (error2.name === "TypeError" && "cause" in error2) { - if (error2.cause instanceof Error) { - message = error2.cause.message; - } else if (typeof error2.cause === "string") { - message = error2.cause; + message = error3.message; + if (error3.name === "TypeError" && "cause" in error3) { + if (error3.cause instanceof Error) { + message = error3.cause.message; + } else if (typeof error3.cause === "string") { + message = error3.cause; } } } const requestError = new RequestError(message, 500, { request: requestOptions }); - requestError.cause = error2; + requestError.cause = error3; throw requestError; } const status = fetchResponse.status; @@ -23399,8 +25131,8 @@ function iterator(octokit, route, parameters) { } } return { value: normalizedResponse }; - } catch (error2) { - if (error2.status !== 409) throw error2; + } catch (error3) { + if (error3.status !== 409) throw error3; url = ""; return { value: { @@ -24057,6 +25789,7 @@ function addVersion(map, name, version) { } // src/git.ts +var core = __toESM(require_core(), 1); import { execFileSync } from "child_process"; function getFileFromRef(ref, filePath, cwd2) { const refFilePath = `${ref}:${filePath}`; @@ -24068,7 +25801,7 @@ function getFileFromRef(ref, filePath, cwd2) { maxBuffer: 1024 * 1024 * 100 }); } catch (e) { - error(`Failed to get file from ref "${refFilePath}": ${e}`); + core.error(`Failed to get file from ref "${refFilePath}": ${e}`); return null; } } @@ -24079,14 +25812,14 @@ function tryGetJSONFromRef(ref, filePath, cwd2) { return JSON.parse(content); } catch (e) { const refFilePath = `${ref}:${filePath}`; - error(`Failed to get json from ref "${refFilePath}": ${e}`); + core.error(`Failed to get json from ref "${refFilePath}": ${e}`); return null; } } return null; } function getBaseRef() { - const inputBaseRef = getInput("base-ref"); + const inputBaseRef = core.getInput("base-ref"); if (inputBaseRef) { return inputBaseRef.includes("/") ? inputBaseRef : `origin/${inputBaseRef}`; } @@ -24098,6 +25831,7 @@ function getBaseRef() { } // src/npm.ts +var core2 = __toESM(require_core(), 1); function getProvenance(meta) { if (meta._npmUser?.trustedPublisher) { return "trusted-with-provenance"; @@ -24152,7 +25886,7 @@ async function fetchPackageMetadataImmediate(packageName, version) { } return await response.json(); } catch (err) { - info(`Failed to fetch metadata for ${packageName}@${version}: ${err}`); + core2.info(`Failed to fetch metadata for ${packageName}@${version}: ${err}`); return null; } } @@ -24181,17 +25915,17 @@ async function calculateTotalDependencySizeIncrease(newVersions, removedVersions const metadata = await fetchPackageMetadata(dep.name, dep.version); if (!metadata || metadata.dist?.unpackedSize === void 0) { packageSizes.set(packageKey, null); - info(`No unpacked size info for ${packageKey}, skipping`); + core2.info(`No unpacked size info for ${packageKey}, skipping`); } else { totalSize += metadata.dist.unpackedSize; packageSizes.set(packageKey, metadata.dist.unpackedSize); - info( + core2.info( `Added ${metadata.dist.unpackedSize} bytes for ${packageKey}` ); } processedPackages.add(packageKey); } catch (e) { - error( + core2.error( `Error fetching package metadata for dep ${packageKey}: ` + e.message ); } @@ -24205,17 +25939,17 @@ async function calculateTotalDependencySizeIncrease(newVersions, removedVersions const metadata = await fetchPackageMetadata(dep.name, dep.version); if (!metadata || metadata.dist?.unpackedSize === void 0) { packageSizes.set(packageKey, null); - info(`No unpacked size info for ${packageKey}, skipping`); + core2.info(`No unpacked size info for ${packageKey}, skipping`); } else { totalSize -= metadata.dist.unpackedSize; packageSizes.set(packageKey, -metadata.dist.unpackedSize); - info( + core2.info( `Subtracted ${metadata.dist.unpackedSize} bytes for ${packageKey}` ); } processedPackages.add(packageKey); } catch (e) { - error( + core2.error( `Error fetching package metadata for dep ${packageKey}: ` + e.message ); } @@ -24244,15 +25978,16 @@ function getDependenciesFromPackageJson(pkg, types) { } return result; } -function isSupportedArchitecture(pkg, os4, cpu, libc) { - const osMatches = pkg.os === void 0 || pkg.os.length === 0 || pkg.os.includes(os4); +function isSupportedArchitecture(pkg, os, cpu, libc) { + const osMatches = pkg.os === void 0 || pkg.os.length === 0 || pkg.os.includes(os); const cpuMatches = pkg.cpu === void 0 || pkg.cpu.length === 0 || pkg.cpu.includes(cpu); const libcMatches = pkg.libc === void 0 || pkg.libc.length === 0 || pkg.libc.includes(libc); return osMatches && cpuMatches && libcMatches; } // src/packs.ts -import * as fs2 from "node:fs/promises"; +var core3 = __toESM(require_core(), 1); +import * as fs from "node:fs/promises"; import * as path from "path"; import { createReadStream } from "node:fs"; import { createGunzip } from "node:zlib"; @@ -24294,7 +26029,7 @@ async function extractPackageNameFromTgz(filePath) { const packageJson = JSON.parse(packageJsonContent); return packageJson.name ?? null; } catch (err) { - info(`Failed to parse package.json in ${filePath}: ${err}`); + core3.info(`Failed to parse package.json in ${filePath}: ${err}`); return null; } } @@ -24305,22 +26040,22 @@ async function extractPackageNameFromTgz(filePath) { } return null; } catch (err) { - info(`Failed to extract package name from ${filePath}: ${err}`); + core3.info(`Failed to extract package name from ${filePath}: ${err}`); return null; } } async function getPacksFromPattern(pattern) { try { const packs = []; - for await (const filePath of fs2.glob(pattern)) { + for await (const filePath of fs.glob(pattern)) { if (!filePath.endsWith(".tgz") && !filePath.endsWith(".tar.gz")) { continue; } - const stats = await fs2.stat(filePath); + const stats = await fs.stat(filePath); const name = path.basename(filePath); const packageName = await extractPackageNameFromTgz(filePath); if (!packageName) { - info( + core3.info( `Warning: Skipping ${name} - could not extract package name from tgz file` ); continue; @@ -24334,7 +26069,7 @@ async function getPacksFromPattern(pattern) { } return packs.sort((a, b) => a.name.localeCompare(b.name)); } catch (err) { - info(`Failed to get packs from pattern "${pattern}": ${err}`); + core3.info(`Failed to get packs from pattern "${pattern}": ${err}`); return []; } } @@ -24407,7 +26142,7 @@ function scanForReplacements(messages, baseDependencies, currentDependencies) { ); break; case "documented": { - const docUrl = `https://github.com/es-tooling/module-replacements/blob/main/docs/modules/${replacement.docPath}.md`; + const docUrl = `https://github.com/e18e/module-replacements/blob/main/docs/modules/${replacement.docPath}.md`; replacementMessages.push( `| ${name} | [See documentation](${docUrl}) |` ); @@ -24545,6 +26280,7 @@ ${duplicateRows.join("\n")}${helpMessage}` } // src/checks/dependency-count.ts +var core4 = __toESM(require_core(), 1); function scanForDependencyCount(messages, threshold, currentDeps, baseDeps) { const currentDepCount = Array.from(currentDeps.values()).reduce( (sum, versions) => sum + versions.size, @@ -24555,9 +26291,9 @@ function scanForDependencyCount(messages, threshold, currentDeps, baseDeps) { 0 ); const depIncrease = currentDepCount - baseDepCount; - info(`Base dependency count: ${baseDepCount}`); - info(`Current dependency count: ${currentDepCount}`); - info(`Dependency count increase: ${depIncrease}`); + core4.info(`Base dependency count: ${baseDepCount}`); + core4.info(`Current dependency count: ${currentDepCount}`); + core4.info(`Dependency count increase: ${depIncrease}`); if (depIncrease >= threshold) { messages.push( `## \u26A0\uFE0F Dependency Count @@ -24567,6 +26303,9 @@ This PR adds ${depIncrease} new dependencies (${baseDepCount} \u2192 ${currentDe } } +// src/checks/dependency-size.ts +var core5 = __toESM(require_core(), 1); + // src/common.ts function formatBytes(bytes) { if (bytes === 0) return "0 B"; @@ -24682,8 +26421,8 @@ async function scanForDependencySize(messages, threshold, currentDeps, baseDeps, if (removedVersions.length > 0) { await removeUnsupportedOptionalDependencies(baseLockFile, removedVersions); } - info(`Found ${newVersions.length} new package versions`); - info(`Found ${removedVersions.length} removed package versions.`); + core5.info(`Found ${newVersions.length} new package versions`); + core5.info(`Found ${removedVersions.length} removed package versions.`); if (newVersions.length === 0 && removedVersions.length === 0) { return; } @@ -24692,7 +26431,7 @@ async function scanForDependencySize(messages, threshold, currentDeps, baseDeps, newVersions, removedVersions ); - info( + core5.info( `Total dependency size increase: ${sizeData ? formatBytes(sizeData.totalSize) : "unknown"}` ); const shouldShow = threshold === -1 || sizeData !== null && sizeData.totalSize >= threshold; @@ -24725,11 +26464,12 @@ ${packageRows} ); } } catch (err) { - info(`Failed to calculate total dependency size increase: ${err}`); + core5.info(`Failed to calculate total dependency size increase: ${err}`); } } // src/checks/provenance.ts +var core6 = __toESM(require_core(), 1); async function scanForProvenance(messages, currentDeps, baseDeps) { const provenanceRows = []; for (const [packageName, currentVersionSet] of currentDeps) { @@ -24760,7 +26500,7 @@ async function scanForProvenance(messages, currentDeps, baseDeps) { ); } } catch (err) { - info(`Failed to check provenance for ${packageName}: ${err}`); + core6.info(`Failed to check provenance for ${packageName}: ${err}`); } } if (provenanceRows.length > 0) { @@ -24810,44 +26550,44 @@ var COMMENT_TAG = ""; async function run() { try { const baseWorkspace = process2.env.GITHUB_WORKSPACE || process2.cwd(); - const workDir = getInput("working-directory") || "."; + const workDir = core7.getInput("working-directory") || "."; const workspacePath = join2(baseWorkspace, workDir); - info(`Workspace path is ${workspacePath}`); + core7.info(`Workspace path is ${workspacePath}`); const baseRef = getBaseRef(); const currentRef = context2.payload.pull_reuqest?.head.sha ?? context2.sha; const lockfileFilename = detectLockfile(workspacePath); - info(`Detected lockfile ${lockfileFilename}`); - const token = getInput("github-token", { required: true }); - const prNumber = parseInt(getInput("pr-number", { required: true }), 10); - const detectReplacements = getBooleanInput("detect-replacements"); + core7.info(`Detected lockfile ${lockfileFilename}`); + const token = core7.getInput("github-token", { required: true }); + const prNumber = parseInt(core7.getInput("pr-number", { required: true }), 10); + const detectReplacements = core7.getBooleanInput("detect-replacements"); const dependencyThreshold = parseInt( - getInput("dependency-threshold") || "10", + core7.getInput("dependency-threshold") || "10", 10 ); const sizeThreshold = parseInt( - getInput("size-threshold") || "100000", + core7.getInput("size-threshold") || "100000", 10 ); const duplicateThreshold = parseInt( - getInput("duplicate-threshold") || "1", + core7.getInput("duplicate-threshold") || "1", 10 ); const packSizeThreshold = parseInt( - getInput("pack-size-threshold") || "50000", + core7.getInput("pack-size-threshold") || "50000", 10 ); if (Number.isNaN(prNumber) || prNumber < 1) { - info("No valid pull request number was found. Skipping."); + core7.info("No valid pull request number was found. Skipping."); return; } if (!lockfileFilename) { - info("No lockfile detected in the workspace. Exiting."); + core7.info("No lockfile detected in the workspace. Exiting."); return; } const lockfilePath = join2(workDir, lockfileFilename); const packageFilePath = join2(workDir, "package.json"); - info(`Using lockfile: ${lockfilePath}`); - info( + core7.info(`Using lockfile: ${lockfilePath}`); + core7.info( `Comparing package lockfiles between ${baseRef} and ${currentRef}` ); const basePackageLock = getFileFromRef( @@ -24856,7 +26596,7 @@ async function run() { baseWorkspace ); if (!basePackageLock) { - info("No package lockfile found in base ref"); + core7.info("No package lockfile found in base ref"); return; } const currentPackageLock = getFileFromRef( @@ -24865,7 +26605,7 @@ async function run() { baseWorkspace ); if (!currentPackageLock) { - info("No package lockfile found in current ref"); + core7.info("No package lockfile found in current ref"); return; } const basePackageJson = tryGetJSONFromRef( @@ -24886,11 +26626,11 @@ async function run() { lockfileFilename, currentPackageJson ?? void 0 ); - info( + core7.info( `Parsed current lockfile with ${parsedCurrentLock.packages.length} packages` ); } catch (err) { - setFailed(`Failed to parse current lockfile: ${err}`); + core7.setFailed(`Failed to parse current lockfile: ${err}`); return; } try { @@ -24899,19 +26639,19 @@ async function run() { lockfileFilename, basePackageJson ?? void 0 ); - info( + core7.info( `Parsed base lockfile with ${parsedBaseLock.packages.length} packages` ); } catch (err) { - setFailed(`Failed to parse base lockfile: ${err}`); + core7.setFailed(`Failed to parse base lockfile: ${err}`); return; } const currentDeps = computeDependencyVersions(parsedCurrentLock); const baseDeps = computeDependencyVersions(parsedBaseLock); - info(`Dependency threshold set to ${dependencyThreshold}`); - info(`Size threshold set to ${formatBytes(sizeThreshold)}`); - info(`Duplicate threshold set to ${duplicateThreshold}`); - info(`Pack size threshold set to ${formatBytes(packSizeThreshold)}`); + core7.info(`Dependency threshold set to ${dependencyThreshold}`); + core7.info(`Size threshold set to ${formatBytes(sizeThreshold)}`); + core7.info(`Duplicate threshold set to ${duplicateThreshold}`); + core7.info(`Pack size threshold set to ${formatBytes(packSizeThreshold)}`); const messages = []; scanForDependencyCount( messages, @@ -24935,16 +26675,16 @@ async function run() { parsedBaseLock ); await scanForProvenance(messages, currentDeps, baseDeps); - const basePackagesPattern = getInput("base-packages"); - const sourcePackagesPattern = getInput("source-packages"); + const basePackagesPattern = core7.getInput("base-packages"); + const sourcePackagesPattern = core7.getInput("source-packages"); if (basePackagesPattern && sourcePackagesPattern) { try { - info( + core7.info( `Comparing pack sizes between patterns: ${basePackagesPattern} and ${sourcePackagesPattern}` ); const basePacks = await getPacksFromPattern(basePackagesPattern); const sourcePacks = await getPacksFromPattern(sourcePackagesPattern); - info( + core7.info( `Found ${basePacks.length} base packs and ${sourcePacks.length} source packs` ); await scanForBundleSize( @@ -24954,12 +26694,12 @@ async function run() { packSizeThreshold ); } catch (err) { - info(`Failed to compare pack sizes: ${err}`); + core7.info(`Failed to compare pack sizes: ${err}`); } } if (detectReplacements) { if (!basePackageJson || !currentPackageJson) { - setFailed( + core7.setFailed( "detect-replacements requires both base and current package.json to be present" ); return; @@ -25008,11 +26748,11 @@ async function run() { No dependency warnings found. ` }); - info( + core7.info( `Updated existing dependency diff comment #${existingCommentId}` ); } else { - info("No dependency warnings found. Skipping comment creation."); + core7.info("No dependency warnings found. Skipping comment creation."); } return; } @@ -25025,7 +26765,7 @@ ${messages.join("\n\n")}`; comment_id: existingCommentId, body: finalCommentBody }); - info( + core7.info( `Updated existing dependency diff comment #${existingCommentId}` ); } else { @@ -25035,13 +26775,13 @@ ${messages.join("\n\n")}`; issue_number: prNumber, body: finalCommentBody }); - info("Created new dependency diff comment"); + core7.info("Created new dependency diff comment"); } - } catch (error2) { - if (error2 instanceof Error) { - setFailed(error2.message); + } catch (error3) { + if (error3 instanceof Error) { + core7.setFailed(error3.message); } else { - setFailed("An unknown error occurred."); + core7.setFailed("An unknown error occurred."); } } } diff --git a/src/checks/replacements.ts b/src/checks/replacements.ts index 9596d81..f2ddb15 100644 --- a/src/checks/replacements.ts +++ b/src/checks/replacements.ts @@ -45,7 +45,7 @@ export function scanForReplacements( ); break; case 'documented': { - const docUrl = `https://github.com/es-tooling/module-replacements/blob/main/docs/modules/${replacement.docPath}.md`; + const docUrl = `https://github.com/e18e/module-replacements/blob/main/docs/modules/${replacement.docPath}.md`; replacementMessages.push( `| ${name} | [See documentation](${docUrl}) |` );