forked from Mirror/attic-action
9 lines
76 KiB
JavaScript
9 lines
76 KiB
JavaScript
"use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __esm=(fn,res)=>function(){return fn&&(res=(0,fn[__getOwnPropNames(fn)[0]])(fn=0)),res};var __commonJS=(cb,mod)=>function(){return mod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports};var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var require_utils=__commonJS({"node_modules/.pnpm/@actions+core@1.10.0/node_modules/@actions/core/lib/utils.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.toCommandProperties=exports.toCommandValue=void 0;function toCommandValue(input){return input==null?"":typeof input=="string"||input instanceof String?input:JSON.stringify(input)}exports.toCommandValue=toCommandValue;function toCommandProperties(annotationProperties){return Object.keys(annotationProperties).length?{title:annotationProperties.title,file:annotationProperties.file,line:annotationProperties.startLine,endLine:annotationProperties.endLine,col:annotationProperties.startColumn,endColumn:annotationProperties.endColumn}:{}}exports.toCommandProperties=toCommandProperties}});var require_command=__commonJS({"node_modules/.pnpm/@actions+core@1.10.0/node_modules/@actions/core/lib/command.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?function(o,m,k,k2){k2===void 0&&(k2=k),Object.defineProperty(o,k2,{enumerable:!0,get:function(){return m[k]}})}:function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]}),__setModuleDefault=exports&&exports.__setModuleDefault||(Object.create?function(o,v){Object.defineProperty(o,"default",{enumerable:!0,value:v})}:function(o,v){o.default=v}),__importStar=exports&&exports.__importStar||function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)k!=="default"&&Object.hasOwnProperty.call(mod,k)&&__createBinding(result,mod,k);return __setModuleDefault(result,mod),result};Object.defineProperty(exports,"__esModule",{value:!0});exports.issue=exports.issueCommand=void 0;var os=__importStar(require("os")),utils_1=require_utils();function issueCommand(command,properties,message){let cmd=new Command(command,properties,message);process.stdout.write(cmd.toString()+os.EOL)}exports.issueCommand=issueCommand;function issue(name,message=""){issueCommand(name,{},message)}exports.issue=issue;var CMD_STRING="::",Command=class{constructor(command,properties,message){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=!0;for(let key in this.properties)if(this.properties.hasOwnProperty(key)){let val=this.properties[key];val&&(first?first=!1:cmdStr+=",",cmdStr+=`${key}=${escapeProperty(val)}`)}}return cmdStr+=`${CMD_STRING}${escapeData(this.message)}`,cmdStr}};function escapeData(s){return utils_1.toCommandValue(s).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(s){return utils_1.toCommandValue(s).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}}});function rng(){return poolPtr>rnds8Pool.length-16&&(import_crypto.default.randomFillSync(rnds8Pool),poolPtr=0),rnds8Pool.slice(poolPtr,poolPtr+=16)}var import_crypto,rnds8Pool,poolPtr,init_rng=__esm({"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/rng.js"(){import_crypto=__toESM(require("crypto")),rnds8Pool=new Uint8Array(256),poolPtr=rnds8Pool.length}});var regex_default,init_regex=__esm({"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/regex.js"(){regex_default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i}});function validate(uuid){return typeof uuid=="string"&®ex_default.test(uuid)}var validate_default,init_validate=__esm({"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/validate.js"(){init_regex();validate_default=validate}});function stringify(arr,offset=0){let uuid=(byteToHex[arr[offset+0]]+byteToHex[arr[offset+1]]+byteToHex[arr[offset+2]]+byteToHex[arr[offset+3]]+"-"+byteToHex[arr[offset+4]]+byteToHex[arr[offset+5]]+"-"+byteToHex[arr[offset+6]]+byteToHex[arr[offset+7]]+"-"+byteToHex[arr[offset+8]]+byteToHex[arr[offset+9]]+"-"+byteToHex[arr[offset+10]]+byteToHex[arr[offset+11]]+byteToHex[arr[offset+12]]+byteToHex[arr[offset+13]]+byteToHex[arr[offset+14]]+byteToHex[arr[offset+15]]).toLowerCase();if(!validate_default(uuid))throw TypeError("Stringified UUID is invalid");return uuid}var byteToHex,stringify_default,init_stringify=__esm({"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/stringify.js"(){init_validate();byteToHex=[];for(let i=0;i<256;++i)byteToHex.push((i+256).toString(16).substr(1));stringify_default=stringify}});function v1(options,buf,offset){let i=buf&&offset||0,b=buf||new Array(16);options=options||{};let node=options.node||_nodeId,clockseq=options.clockseq!==void 0?options.clockseq:_clockseq;if(node==null||clockseq==null){let seedBytes=options.random||(options.rng||rng)();node==null&&(node=_nodeId=[seedBytes[0]|1,seedBytes[1],seedBytes[2],seedBytes[3],seedBytes[4],seedBytes[5]]),clockseq==null&&(clockseq=_clockseq=(seedBytes[6]<<8|seedBytes[7])&16383)}let msecs=options.msecs!==void 0?options.msecs:Date.now(),nsecs=options.nsecs!==void 0?options.nsecs:_lastNSecs+1,dt=msecs-_lastMSecs+(nsecs-_lastNSecs)/1e4;if(dt<0&&options.clockseq===void 0&&(clockseq=clockseq+1&16383),(dt<0||msecs>_lastMSecs)&&options.nsecs===void 0&&(nsecs=0),nsecs>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");_lastMSecs=msecs,_lastNSecs=nsecs,_clockseq=clockseq,msecs+=122192928e5;let tl=((msecs&268435455)*1e4+nsecs)%4294967296;b[i++]=tl>>>24&255,b[i++]=tl>>>16&255,b[i++]=tl>>>8&255,b[i++]=tl&255;let tmh=msecs/4294967296*1e4&268435455;b[i++]=tmh>>>8&255,b[i++]=tmh&255,b[i++]=tmh>>>24&15|16,b[i++]=tmh>>>16&255,b[i++]=clockseq>>>8|128,b[i++]=clockseq&255;for(let n=0;n<6;++n)b[i+n]=node[n];return buf||stringify_default(b)}var _nodeId,_clockseq,_lastMSecs,_lastNSecs,v1_default,init_v1=__esm({"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/v1.js"(){init_rng();init_stringify();_lastMSecs=0,_lastNSecs=0;v1_default=v1}});function parse(uuid){if(!validate_default(uuid))throw TypeError("Invalid UUID");let v,arr=new Uint8Array(16);return arr[0]=(v=parseInt(uuid.slice(0,8),16))>>>24,arr[1]=v>>>16&255,arr[2]=v>>>8&255,arr[3]=v&255,arr[4]=(v=parseInt(uuid.slice(9,13),16))>>>8,arr[5]=v&255,arr[6]=(v=parseInt(uuid.slice(14,18),16))>>>8,arr[7]=v&255,arr[8]=(v=parseInt(uuid.slice(19,23),16))>>>8,arr[9]=v&255,arr[10]=(v=parseInt(uuid.slice(24,36),16))/1099511627776&255,arr[11]=v/4294967296&255,arr[12]=v>>>24&255,arr[13]=v>>>16&255,arr[14]=v>>>8&255,arr[15]=v&255,arr}var parse_default,init_parse=__esm({"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/parse.js"(){init_validate();parse_default=parse}});function stringToBytes(str){str=unescape(encodeURIComponent(str));let bytes=[];for(let i=0;i<str.length;++i)bytes.push(str.charCodeAt(i));return bytes}function v35_default(name,version2,hashfunc){function generateUUID(value,namespace,buf,offset){if(typeof value=="string"&&(value=stringToBytes(value)),typeof namespace=="string"&&(namespace=parse_default(namespace)),namespace.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let bytes=new Uint8Array(16+value.length);if(bytes.set(namespace),bytes.set(value,namespace.length),bytes=hashfunc(bytes),bytes[6]=bytes[6]&15|version2,bytes[8]=bytes[8]&63|128,buf){offset=offset||0;for(let i=0;i<16;++i)buf[offset+i]=bytes[i];return buf}return stringify_default(bytes)}try{generateUUID.name=name}catch{}return generateUUID.DNS=DNS,generateUUID.URL=URL2,generateUUID}var DNS,URL2,init_v35=__esm({"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/v35.js"(){init_stringify();init_parse();DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",URL2="6ba7b811-9dad-11d1-80b4-00c04fd430c8"}});function md5(bytes){return Array.isArray(bytes)?bytes=Buffer.from(bytes):typeof bytes=="string"&&(bytes=Buffer.from(bytes,"utf8")),import_crypto2.default.createHash("md5").update(bytes).digest()}var import_crypto2,md5_default,init_md5=__esm({"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/md5.js"(){import_crypto2=__toESM(require("crypto"));md5_default=md5}});var v3,v3_default,init_v3=__esm({"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/v3.js"(){init_v35();init_md5();v3=v35_default("v3",48,md5_default),v3_default=v3}});function v4(options,buf,offset){options=options||{};let rnds=options.random||(options.rng||rng)();if(rnds[6]=rnds[6]&15|64,rnds[8]=rnds[8]&63|128,buf){offset=offset||0;for(let i=0;i<16;++i)buf[offset+i]=rnds[i];return buf}return stringify_default(rnds)}var v4_default,init_v4=__esm({"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/v4.js"(){init_rng();init_stringify();v4_default=v4}});function sha1(bytes){return Array.isArray(bytes)?bytes=Buffer.from(bytes):typeof bytes=="string"&&(bytes=Buffer.from(bytes,"utf8")),import_crypto3.default.createHash("sha1").update(bytes).digest()}var import_crypto3,sha1_default,init_sha1=__esm({"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/sha1.js"(){import_crypto3=__toESM(require("crypto"));sha1_default=sha1}});var v5,v5_default,init_v5=__esm({"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/v5.js"(){init_v35();init_sha1();v5=v35_default("v5",80,sha1_default),v5_default=v5}});var nil_default,init_nil=__esm({"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/nil.js"(){nil_default="00000000-0000-0000-0000-000000000000"}});function version(uuid){if(!validate_default(uuid))throw TypeError("Invalid UUID");return parseInt(uuid.substr(14,1),16)}var version_default,init_version=__esm({"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/version.js"(){init_validate();version_default=version}});var esm_node_exports={};__export(esm_node_exports,{NIL:()=>nil_default,parse:()=>parse_default,stringify:()=>stringify_default,v1:()=>v1_default,v3:()=>v3_default,v4:()=>v4_default,v5:()=>v5_default,validate:()=>validate_default,version:()=>version_default});var init_esm_node=__esm({"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/index.js"(){init_v1();init_v3();init_v4();init_v5();init_nil();init_version();init_validate();init_stringify();init_parse()}});var require_file_command=__commonJS({"node_modules/.pnpm/@actions+core@1.10.0/node_modules/@actions/core/lib/file-command.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?function(o,m,k,k2){k2===void 0&&(k2=k),Object.defineProperty(o,k2,{enumerable:!0,get:function(){return m[k]}})}:function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]}),__setModuleDefault=exports&&exports.__setModuleDefault||(Object.create?function(o,v){Object.defineProperty(o,"default",{enumerable:!0,value:v})}:function(o,v){o.default=v}),__importStar=exports&&exports.__importStar||function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)k!=="default"&&Object.hasOwnProperty.call(mod,k)&&__createBinding(result,mod,k);return __setModuleDefault(result,mod),result};Object.defineProperty(exports,"__esModule",{value:!0});exports.prepareKeyValueMessage=exports.issueFileCommand=void 0;var fs=__importStar(require("fs")),os=__importStar(require("os")),uuid_1=(init_esm_node(),__toCommonJS(esm_node_exports)),utils_1=require_utils();function issueFileCommand(command,message){let filePath=process.env[`GITHUB_${command}`];if(!filePath)throw new Error(`Unable to find environment variable for file command ${command}`);if(!fs.existsSync(filePath))throw new Error(`Missing file at path: ${filePath}`);fs.appendFileSync(filePath,`${utils_1.toCommandValue(message)}${os.EOL}`,{encoding:"utf8"})}exports.issueFileCommand=issueFileCommand;function prepareKeyValueMessage(key,value){let delimiter=`ghadelimiter_${uuid_1.v4()}`,convertedValue=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}`}exports.prepareKeyValueMessage=prepareKeyValueMessage}});var require_proxy=__commonJS({"node_modules/.pnpm/@actions+http-client@2.1.0/node_modules/@actions/http-client/lib/proxy.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.checkBypass=exports.getProxyUrl=void 0;function getProxyUrl(reqUrl){let usingSsl=reqUrl.protocol==="https:";if(checkBypass(reqUrl))return;let proxyVar=(()=>usingSsl?process.env.https_proxy||process.env.HTTPS_PROXY:process.env.http_proxy||process.env.HTTP_PROXY)();if(proxyVar)return new URL(proxyVar)}exports.getProxyUrl=getProxyUrl;function checkBypass(reqUrl){if(!reqUrl.hostname)return!1;let reqHost=reqUrl.hostname;if(isLoopbackAddress(reqHost))return!0;let noProxy=process.env.no_proxy||process.env.NO_PROXY||"";if(!noProxy)return!1;let reqPort;reqUrl.port?reqPort=Number(reqUrl.port):reqUrl.protocol==="http:"?reqPort=80:reqUrl.protocol==="https:"&&(reqPort=443);let upperReqHosts=[reqUrl.hostname.toUpperCase()];typeof reqPort=="number"&&upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);for(let 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!0;return!1}exports.checkBypass=checkBypass;function isLoopbackAddress(host){let hostLower=host.toLowerCase();return hostLower==="localhost"||hostLower.startsWith("127.")||hostLower.startsWith("[::1]")||hostLower.startsWith("[0:0:0:0:0:0:0:1]")}}});var require_tunnel=__commonJS({"node_modules/.pnpm/tunnel@0.0.6/node_modules/tunnel/lib/tunnel.js"(exports){"use strict";var net=require("net"),tls=require("tls"),http=require("http"),https=require("https"),events=require("events"),assert=require("assert"),util=require("util");exports.httpOverHttp=httpOverHttp;exports.httpsOverHttp=httpsOverHttp;exports.httpOverHttps=httpOverHttps;exports.httpsOverHttps=httpsOverHttps;function httpOverHttp(options){var agent=new TunnelingAgent(options);return agent.request=http.request,agent}function httpsOverHttp(options){var agent=new TunnelingAgent(options);return agent.request=http.request,agent.createSocket=createSecureSocket,agent.defaultPort=443,agent}function httpOverHttps(options){var agent=new TunnelingAgent(options);return agent.request=https.request,agent}function httpsOverHttps(options){var agent=new TunnelingAgent(options);return agent.request=https.request,agent.createSocket=createSecureSocket,agent.defaultPort=443,agent}function TunnelingAgent(options){var self=this;self.options=options||{},self.proxyOptions=self.options.proxy||{},self.maxSockets=self.options.maxSockets||http.Agent.defaultMaxSockets,self.requests=[],self.sockets=[],self.on("free",function(socket,host,port,localAddress){for(var options2=toOptions(host,port,localAddress),i=0,len=self.requests.length;i<len;++i){var pending=self.requests[i];if(pending.host===options2.host&&pending.port===options2.port){self.requests.splice(i,1),pending.request.onSocket(socket);return}}socket.destroy(),self.removeSocket(socket)})}util.inherits(TunnelingAgent,events.EventEmitter);TunnelingAgent.prototype.addRequest=function(req,host,port,localAddress){var self=this,options=mergeOptions({request:req},self.options,toOptions(host,port,localAddress));if(self.sockets.length>=this.maxSockets){self.requests.push(options);return}self.createSocket(options,function(socket){socket.on("free",onFree),socket.on("close",onCloseOrRemove),socket.on("agentRemove",onCloseOrRemove),req.onSocket(socket);function onFree(){self.emit("free",socket,options)}function onCloseOrRemove(err){self.removeSocket(socket),socket.removeListener("free",onFree),socket.removeListener("close",onCloseOrRemove),socket.removeListener("agentRemove",onCloseOrRemove)}})};TunnelingAgent.prototype.createSocket=function(options,cb){var self=this,placeholder={};self.sockets.push(placeholder);var connectOptions=mergeOptions({},self.proxyOptions,{method:"CONNECT",path:options.host+":"+options.port,agent:!1,headers:{host:options.host+":"+options.port}});options.localAddress&&(connectOptions.localAddress=options.localAddress),connectOptions.proxyAuth&&(connectOptions.headers=connectOptions.headers||{},connectOptions.headers["Proxy-Authorization"]="Basic "+new Buffer(connectOptions.proxyAuth).toString("base64")),debug("making CONNECT request");var connectReq=self.request(connectOptions);connectReq.useChunkedEncodingByDefault=!1,connectReq.once("response",onResponse),connectReq.once("upgrade",onUpgrade),connectReq.once("connect",onConnect),connectReq.once("error",onError),connectReq.end();function onResponse(res){res.upgrade=!0}function onUpgrade(res,socket,head){process.nextTick(function(){onConnect(res,socket,head)})}function onConnect(res,socket,head){if(connectReq.removeAllListeners(),socket.removeAllListeners(),res.statusCode!==200){debug("tunneling socket could not be established, statusCode=%d",res.statusCode),socket.destroy();var error=new Error("tunneling socket could not be established, statusCode="+res.statusCode);error.code="ECONNRESET",options.request.emit("error",error),self.removeSocket(placeholder);return}if(head.length>0){debug("got illegal response body from proxy"),socket.destroy();var error=new Error("got illegal response body from proxy");error.code="ECONNRESET",options.request.emit("error",error),self.removeSocket(placeholder);return}return debug("tunneling connection has established"),self.sockets[self.sockets.indexOf(placeholder)]=socket,cb(socket)}function onError(cause){connectReq.removeAllListeners(),debug(`tunneling socket could not be established, cause=%s
|
|
`,cause.message,cause.stack);var error=new Error("tunneling socket could not be established, cause="+cause.message);error.code="ECONNRESET",options.request.emit("error",error),self.removeSocket(placeholder)}};TunnelingAgent.prototype.removeSocket=function(socket){var pos=this.sockets.indexOf(socket);if(pos!==-1){this.sockets.splice(pos,1);var pending=this.requests.shift();pending&&this.createSocket(pending,function(socket2){pending.request.onSocket(socket2)})}};function createSecureSocket(options,cb){var self=this;TunnelingAgent.prototype.createSocket.call(self,options,function(socket){var hostHeader=options.request.getHeader("host"),tlsOptions=mergeOptions({},self.options,{socket,servername:hostHeader?hostHeader.replace(/:.*$/,""):options.host}),secureSocket=tls.connect(0,tlsOptions);self.sockets[self.sockets.indexOf(socket)]=secureSocket,cb(secureSocket)})}function toOptions(host,port,localAddress){return typeof host=="string"?{host,port,localAddress}:host}function mergeOptions(target){for(var i=1,len=arguments.length;i<len;++i){var overrides=arguments[i];if(typeof overrides=="object")for(var keys=Object.keys(overrides),j=0,keyLen=keys.length;j<keyLen;++j){var k=keys[j];overrides[k]!==void 0&&(target[k]=overrides[k])}}return target}var debug;process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?debug=function(){var args=Array.prototype.slice.call(arguments);typeof args[0]=="string"?args[0]="TUNNEL: "+args[0]:args.unshift("TUNNEL:"),console.error.apply(console,args)}:debug=function(){};exports.debug=debug}});var require_tunnel2=__commonJS({"node_modules/.pnpm/tunnel@0.0.6/node_modules/tunnel/index.js"(exports,module2){module2.exports=require_tunnel()}});var require_lib=__commonJS({"node_modules/.pnpm/@actions+http-client@2.1.0/node_modules/@actions/http-client/lib/index.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?function(o,m,k,k2){k2===void 0&&(k2=k),Object.defineProperty(o,k2,{enumerable:!0,get:function(){return m[k]}})}:function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]}),__setModuleDefault=exports&&exports.__setModuleDefault||(Object.create?function(o,v){Object.defineProperty(o,"default",{enumerable:!0,value:v})}:function(o,v){o.default=v}),__importStar=exports&&exports.__importStar||function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)k!=="default"&&Object.hasOwnProperty.call(mod,k)&&__createBinding(result,mod,k);return __setModuleDefault(result,mod),result},__awaiter=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:!0});exports.HttpClient=exports.isHttps=exports.HttpClientResponse=exports.HttpClientError=exports.getProxyUrl=exports.MediaTypes=exports.Headers=exports.HttpCodes=void 0;var http=__importStar(require("http")),https=__importStar(require("https")),pm=__importStar(require_proxy()),tunnel=__importStar(require_tunnel2()),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||(exports.HttpCodes={}));var Headers;(function(Headers2){Headers2.Accept="accept",Headers2.ContentType="content-type"})(Headers=exports.Headers||(exports.Headers={}));var MediaTypes;(function(MediaTypes2){MediaTypes2.ApplicationJson="application/json"})(MediaTypes=exports.MediaTypes||(exports.MediaTypes={}));function getProxyUrl(serverUrl){let proxyUrl=pm.getProxyUrl(new URL(serverUrl));return proxyUrl?proxyUrl.href:""}exports.getProxyUrl=getProxyUrl;var HttpRedirectCodes=[HttpCodes.MovedPermanently,HttpCodes.ResourceMoved,HttpCodes.SeeOther,HttpCodes.TemporaryRedirect,HttpCodes.PermanentRedirect],HttpResponseRetryCodes=[HttpCodes.BadGateway,HttpCodes.ServiceUnavailable,HttpCodes.GatewayTimeout],RetryableHttpVerbs=["OPTIONS","GET","DELETE","HEAD"],ExponentialBackoffCeiling=10,ExponentialBackoffTimeSlice=5,HttpClientError=class _HttpClientError extends Error{constructor(message,statusCode){super(message),this.name="HttpClientError",this.statusCode=statusCode,Object.setPrototypeOf(this,_HttpClientError.prototype)}};exports.HttpClientError=HttpClientError;var HttpClientResponse=class{constructor(message){this.message=message}readBody(){return __awaiter(this,void 0,void 0,function*(){return new Promise(resolve=>__awaiter(this,void 0,void 0,function*(){let output=Buffer.alloc(0);this.message.on("data",chunk=>{output=Buffer.concat([output,chunk])}),this.message.on("end",()=>{resolve(output.toString())})}))})}};exports.HttpClientResponse=HttpClientResponse;function isHttps(requestUrl){return new URL(requestUrl).protocol==="https:"}exports.isHttps=isHttps;var HttpClient=class{constructor(userAgent,handlers,requestOptions){this._ignoreSslError=!1,this._allowRedirects=!0,this._allowRedirectDowngrade=!1,this._maxRedirects=50,this._allowRetries=!1,this._maxRetries=1,this._keepAlive=!1,this._disposed=!1,this.userAgent=userAgent,this.handlers=handlers||[],this.requestOptions=requestOptions,requestOptions&&(requestOptions.ignoreSslError!=null&&(this._ignoreSslError=requestOptions.ignoreSslError),this._socketTimeout=requestOptions.socketTimeout,requestOptions.allowRedirects!=null&&(this._allowRedirects=requestOptions.allowRedirects),requestOptions.allowRedirectDowngrade!=null&&(this._allowRedirectDowngrade=requestOptions.allowRedirectDowngrade),requestOptions.maxRedirects!=null&&(this._maxRedirects=Math.max(requestOptions.maxRedirects,0)),requestOptions.keepAlive!=null&&(this._keepAlive=requestOptions.keepAlive),requestOptions.allowRetries!=null&&(this._allowRetries=requestOptions.allowRetries),requestOptions.maxRetries!=null&&(this._maxRetries=requestOptions.maxRetries))}options(requestUrl,additionalHeaders){return __awaiter(this,void 0,void 0,function*(){return this.request("OPTIONS",requestUrl,null,additionalHeaders||{})})}get(requestUrl,additionalHeaders){return __awaiter(this,void 0,void 0,function*(){return this.request("GET",requestUrl,null,additionalHeaders||{})})}del(requestUrl,additionalHeaders){return __awaiter(this,void 0,void 0,function*(){return this.request("DELETE",requestUrl,null,additionalHeaders||{})})}post(requestUrl,data,additionalHeaders){return __awaiter(this,void 0,void 0,function*(){return this.request("POST",requestUrl,data,additionalHeaders||{})})}patch(requestUrl,data,additionalHeaders){return __awaiter(this,void 0,void 0,function*(){return this.request("PATCH",requestUrl,data,additionalHeaders||{})})}put(requestUrl,data,additionalHeaders){return __awaiter(this,void 0,void 0,function*(){return this.request("PUT",requestUrl,data,additionalHeaders||{})})}head(requestUrl,additionalHeaders){return __awaiter(this,void 0,void 0,function*(){return this.request("HEAD",requestUrl,null,additionalHeaders||{})})}sendStream(verb,requestUrl,stream,additionalHeaders){return __awaiter(this,void 0,void 0,function*(){return this.request(verb,requestUrl,stream,additionalHeaders)})}getJson(requestUrl,additionalHeaders={}){return __awaiter(this,void 0,void 0,function*(){additionalHeaders[Headers.Accept]=this._getExistingOrDefaultHeader(additionalHeaders,Headers.Accept,MediaTypes.ApplicationJson);let res=yield this.get(requestUrl,additionalHeaders);return this._processResponse(res,this.requestOptions)})}postJson(requestUrl,obj,additionalHeaders={}){return __awaiter(this,void 0,void 0,function*(){let data=JSON.stringify(obj,null,2);additionalHeaders[Headers.Accept]=this._getExistingOrDefaultHeader(additionalHeaders,Headers.Accept,MediaTypes.ApplicationJson),additionalHeaders[Headers.ContentType]=this._getExistingOrDefaultHeader(additionalHeaders,Headers.ContentType,MediaTypes.ApplicationJson);let res=yield this.post(requestUrl,data,additionalHeaders);return this._processResponse(res,this.requestOptions)})}putJson(requestUrl,obj,additionalHeaders={}){return __awaiter(this,void 0,void 0,function*(){let data=JSON.stringify(obj,null,2);additionalHeaders[Headers.Accept]=this._getExistingOrDefaultHeader(additionalHeaders,Headers.Accept,MediaTypes.ApplicationJson),additionalHeaders[Headers.ContentType]=this._getExistingOrDefaultHeader(additionalHeaders,Headers.ContentType,MediaTypes.ApplicationJson);let res=yield this.put(requestUrl,data,additionalHeaders);return this._processResponse(res,this.requestOptions)})}patchJson(requestUrl,obj,additionalHeaders={}){return __awaiter(this,void 0,void 0,function*(){let data=JSON.stringify(obj,null,2);additionalHeaders[Headers.Accept]=this._getExistingOrDefaultHeader(additionalHeaders,Headers.Accept,MediaTypes.ApplicationJson),additionalHeaders[Headers.ContentType]=this._getExistingOrDefaultHeader(additionalHeaders,Headers.ContentType,MediaTypes.ApplicationJson);let res=yield this.patch(requestUrl,data,additionalHeaders);return this._processResponse(res,this.requestOptions)})}request(verb,requestUrl,data,headers){return __awaiter(this,void 0,void 0,function*(){if(this._disposed)throw new Error("Client has already been disposed.");let parsedUrl=new URL(requestUrl),info2=this._prepareRequest(verb,parsedUrl,headers),maxTries=this._allowRetries&&RetryableHttpVerbs.includes(verb)?this._maxRetries+1:1,numTries=0,response;do{if(response=yield this.requestRaw(info2,data),response&&response.message&&response.message.statusCode===HttpCodes.Unauthorized){let authenticationHandler;for(let handler of this.handlers)if(handler.canHandleAuthentication(response)){authenticationHandler=handler;break}return authenticationHandler?authenticationHandler.handleAuthentication(this,info2,data):response}let redirectsRemaining=this._maxRedirects;for(;response.message.statusCode&&HttpRedirectCodes.includes(response.message.statusCode)&&this._allowRedirects&&redirectsRemaining>0;){let redirectUrl=response.message.headers.location;if(!redirectUrl)break;let parsedRedirectUrl=new URL(redirectUrl);if(parsedUrl.protocol==="https:"&&parsedUrl.protocol!==parsedRedirectUrl.protocol&&!this._allowRedirectDowngrade)throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.");if(yield response.readBody(),parsedRedirectUrl.hostname!==parsedUrl.hostname)for(let header in headers)header.toLowerCase()==="authorization"&&delete headers[header];info2=this._prepareRequest(verb,parsedRedirectUrl,headers),response=yield this.requestRaw(info2,data),redirectsRemaining--}if(!response.message.statusCode||!HttpResponseRetryCodes.includes(response.message.statusCode))return response;numTries+=1,numTries<maxTries&&(yield response.readBody(),yield this._performExponentialBackoff(numTries))}while(numTries<maxTries);return response})}dispose(){this._agent&&this._agent.destroy(),this._disposed=!0}requestRaw(info2,data){return __awaiter(this,void 0,void 0,function*(){return new Promise((resolve,reject)=>{function callbackForResult(err,res){err?reject(err):res?resolve(res):reject(new Error("Unknown error"))}this.requestRawWithCallback(info2,data,callbackForResult)})})}requestRawWithCallback(info2,data,onResult){typeof data=="string"&&(info2.options.headers||(info2.options.headers={}),info2.options.headers["Content-Length"]=Buffer.byteLength(data,"utf8"));let callbackCalled=!1;function handleResult(err,res){callbackCalled||(callbackCalled=!0,onResult(err,res))}let req=info2.httpModule.request(info2.options,msg=>{let res=new HttpClientResponse(msg);handleResult(void 0,res)}),socket;req.on("socket",sock=>{socket=sock}),req.setTimeout(this._socketTimeout||3*6e4,()=>{socket&&socket.end(),handleResult(new Error(`Request timeout: ${info2.options.path}`))}),req.on("error",function(err){handleResult(err)}),data&&typeof data=="string"&&req.write(data,"utf8"),data&&typeof data!="string"?(data.on("close",function(){req.end()}),data.pipe(req)):req.end()}getAgent(serverUrl){let parsedUrl=new URL(serverUrl);return this._getAgent(parsedUrl)}_prepareRequest(method,requestUrl,headers){let info2={};info2.parsedUrl=requestUrl;let usingSsl=info2.parsedUrl.protocol==="https:";info2.httpModule=usingSsl?https:http;let defaultPort=usingSsl?443:80;if(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),this.userAgent!=null&&(info2.options.headers["user-agent"]=this.userAgent),info2.options.agent=this._getAgent(info2.parsedUrl),this.handlers)for(let handler of this.handlers)handler.prepareRequest(info2.options);return info2}_mergeHeaders(headers){return this.requestOptions&&this.requestOptions.headers?Object.assign({},lowercaseKeys(this.requestOptions.headers),lowercaseKeys(headers||{})):lowercaseKeys(headers||{})}_getExistingOrDefaultHeader(additionalHeaders,header,_default){let clientHeader;return this.requestOptions&&this.requestOptions.headers&&(clientHeader=lowercaseKeys(this.requestOptions.headers)[header]),additionalHeaders[header]||clientHeader||_default}_getAgent(parsedUrl){let agent,proxyUrl=pm.getProxyUrl(parsedUrl),useProxy=proxyUrl&&proxyUrl.hostname;if(this._keepAlive&&useProxy&&(agent=this._proxyAgent),this._keepAlive&&!useProxy&&(agent=this._agent),agent)return agent;let usingSsl=parsedUrl.protocol==="https:",maxSockets=100;if(this.requestOptions&&(maxSockets=this.requestOptions.maxSockets||http.globalAgent.maxSockets),proxyUrl&&proxyUrl.hostname){let agentOptions={maxSockets,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(proxyUrl.username||proxyUrl.password)&&{proxyAuth:`${proxyUrl.username}:${proxyUrl.password}`}),{host:proxyUrl.hostname,port:proxyUrl.port})},tunnelAgent,overHttps=proxyUrl.protocol==="https:";usingSsl?tunnelAgent=overHttps?tunnel.httpsOverHttps:tunnel.httpsOverHttp:tunnelAgent=overHttps?tunnel.httpOverHttps:tunnel.httpOverHttp,agent=tunnelAgent(agentOptions),this._proxyAgent=agent}if(this._keepAlive&&!agent){let options={keepAlive:this._keepAlive,maxSockets};agent=usingSsl?new https.Agent(options):new http.Agent(options),this._agent=agent}return agent||(agent=usingSsl?https.globalAgent:http.globalAgent),usingSsl&&this._ignoreSslError&&(agent.options=Object.assign(agent.options||{},{rejectUnauthorized:!1})),agent}_performExponentialBackoff(retryNumber){return __awaiter(this,void 0,void 0,function*(){retryNumber=Math.min(ExponentialBackoffCeiling,retryNumber);let ms=ExponentialBackoffTimeSlice*Math.pow(2,retryNumber);return new Promise(resolve=>setTimeout(()=>resolve(),ms))})}_processResponse(res,options){return __awaiter(this,void 0,void 0,function*(){return new Promise((resolve,reject)=>__awaiter(this,void 0,void 0,function*(){let statusCode=res.message.statusCode||0,response={statusCode,result:null,headers:{}};statusCode===HttpCodes.NotFound&&resolve(response);function dateTimeDeserializer(key,value){if(typeof value=="string"){let a=new Date(value);if(!isNaN(a.valueOf()))return a}return value}let obj,contents;try{contents=yield res.readBody(),contents&&contents.length>0&&(options&&options.deserializeDates?obj=JSON.parse(contents,dateTimeDeserializer):obj=JSON.parse(contents),response.result=obj),response.headers=res.message.headers}catch{}if(statusCode>299){let msg;obj&&obj.message?msg=obj.message:contents&&contents.length>0?msg=contents:msg=`Failed request: (${statusCode})`;let err=new HttpClientError(msg,statusCode);err.result=response.result,reject(err)}else resolve(response)}))})}};exports.HttpClient=HttpClient;var lowercaseKeys=obj=>Object.keys(obj).reduce((c,k)=>(c[k.toLowerCase()]=obj[k],c),{})}});var require_auth=__commonJS({"node_modules/.pnpm/@actions+http-client@2.1.0/node_modules/@actions/http-client/lib/auth.js"(exports){"use strict";var __awaiter=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:!0});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")}`}canHandleAuthentication(){return!1}handleAuthentication(){return __awaiter(this,void 0,void 0,function*(){throw new Error("not implemented")})}};exports.BasicCredentialHandler=BasicCredentialHandler;var BearerCredentialHandler=class{constructor(token){this.token=token}prepareRequest(options){if(!options.headers)throw Error("The request has no headers");options.headers.Authorization=`Bearer ${this.token}`}canHandleAuthentication(){return!1}handleAuthentication(){return __awaiter(this,void 0,void 0,function*(){throw new Error("not implemented")})}};exports.BearerCredentialHandler=BearerCredentialHandler;var PersonalAccessTokenCredentialHandler=class{constructor(token){this.token=token}prepareRequest(options){if(!options.headers)throw Error("The request has no headers");options.headers.Authorization=`Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`}canHandleAuthentication(){return!1}handleAuthentication(){return __awaiter(this,void 0,void 0,function*(){throw new Error("not implemented")})}};exports.PersonalAccessTokenCredentialHandler=PersonalAccessTokenCredentialHandler}});var require_oidc_utils=__commonJS({"node_modules/.pnpm/@actions+core@1.10.0/node_modules/@actions/core/lib/oidc-utils.js"(exports){"use strict";var __awaiter=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:!0});exports.OidcClient=void 0;var http_client_1=require_lib(),auth_1=require_auth(),core_1=require_core(),OidcClient=class _OidcClient{static createHttpClient(allowRetry=!0,maxRetry=10){let requestOptions={allowRetries:allowRetry,maxRetries:maxRetry};return new http_client_1.HttpClient("actions/oidc-client",[new auth_1.BearerCredentialHandler(_OidcClient.getRequestToken())],requestOptions)}static getRequestToken(){let 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(){let 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){var _a;return __awaiter(this,void 0,void 0,function*(){let id_token=(_a=(yield _OidcClient.createHttpClient().getJson(id_token_url).catch(error=>{throw new Error(`Failed to get ID Token.
|
|
|
|
Error Code : ${error.statusCode}
|
|
|
|
Error Message: ${error.result.message}`)})).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 __awaiter(this,void 0,void 0,function*(){try{let id_token_url=_OidcClient.getIDTokenUrl();if(audience){let encodedAudience=encodeURIComponent(audience);id_token_url=`${id_token_url}&audience=${encodedAudience}`}core_1.debug(`ID token url is ${id_token_url}`);let id_token=yield _OidcClient.getCall(id_token_url);return core_1.setSecret(id_token),id_token}catch(error){throw new Error(`Error message: ${error.message}`)}})}};exports.OidcClient=OidcClient}});var require_summary=__commonJS({"node_modules/.pnpm/@actions+core@1.10.0/node_modules/@actions/core/lib/summary.js"(exports){"use strict";var __awaiter=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:!0});exports.summary=exports.markdownSummary=exports.SUMMARY_DOCS_URL=exports.SUMMARY_ENV_VAR=void 0;var os_1=require("os"),fs_1=require("fs"),{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=""}filePath(){return __awaiter(this,void 0,void 0,function*(){if(this._filePath)return this._filePath;let 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{throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`)}return this._filePath=pathFromEnv,this._filePath})}wrap(tag,content,attrs={}){let htmlAttrs=Object.entries(attrs).map(([key,value])=>` ${key}="${value}"`).join("");return content?`<${tag}${htmlAttrs}>${content}</${tag}>`:`<${tag}${htmlAttrs}>`}write(options){return __awaiter(this,void 0,void 0,function*(){let overwrite=!!options?.overwrite,filePath=yield this.filePath();return yield(overwrite?writeFile:appendFile)(filePath,this._buffer,{encoding:"utf8"}),this.emptyBuffer()})}clear(){return __awaiter(this,void 0,void 0,function*(){return this.emptyBuffer().write({overwrite:!0})})}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){return this._buffer="",this}addRaw(text,addEOL=!1){return this._buffer+=text,addEOL?this.addEOL():this}addEOL(){return this.addRaw(os_1.EOL)}addCodeBlock(code,lang){let attrs=Object.assign({},lang&&{lang}),element=this.wrap("pre",this.wrap("code",code),attrs);return this.addRaw(element).addEOL()}addList(items,ordered=!1){let tag=ordered?"ol":"ul",listItems=items.map(item=>this.wrap("li",item)).join(""),element=this.wrap(tag,listItems);return this.addRaw(element).addEOL()}addTable(rows){let tableBody=rows.map(row=>{let cells=row.map(cell=>{if(typeof cell=="string")return this.wrap("td",cell);let{header,data,colspan,rowspan}=cell,tag=header?"th":"td",attrs=Object.assign(Object.assign({},colspan&&{colspan}),rowspan&&{rowspan});return this.wrap(tag,data,attrs)}).join("");return this.wrap("tr",cells)}).join(""),element=this.wrap("table",tableBody);return this.addRaw(element).addEOL()}addDetails(label,content){let element=this.wrap("details",this.wrap("summary",label)+content);return this.addRaw(element).addEOL()}addImage(src,alt,options){let{width,height}=options||{},attrs=Object.assign(Object.assign({},width&&{width}),height&&{height}),element=this.wrap("img",null,Object.assign({src,alt},attrs));return this.addRaw(element).addEOL()}addHeading(text,level){let tag=`h${level}`,allowedTag=["h1","h2","h3","h4","h5","h6"].includes(tag)?tag:"h1",element=this.wrap(allowedTag,text);return this.addRaw(element).addEOL()}addSeparator(){let element=this.wrap("hr",null);return this.addRaw(element).addEOL()}addBreak(){let element=this.wrap("br",null);return this.addRaw(element).addEOL()}addQuote(text,cite){let attrs=Object.assign({},cite&&{cite}),element=this.wrap("blockquote",text,attrs);return this.addRaw(element).addEOL()}addLink(text,href){let element=this.wrap("a",text,{href});return this.addRaw(element).addEOL()}},_summary=new Summary;exports.markdownSummary=_summary;exports.summary=_summary}});var require_path_utils=__commonJS({"node_modules/.pnpm/@actions+core@1.10.0/node_modules/@actions/core/lib/path-utils.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?function(o,m,k,k2){k2===void 0&&(k2=k),Object.defineProperty(o,k2,{enumerable:!0,get:function(){return m[k]}})}:function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]}),__setModuleDefault=exports&&exports.__setModuleDefault||(Object.create?function(o,v){Object.defineProperty(o,"default",{enumerable:!0,value:v})}:function(o,v){o.default=v}),__importStar=exports&&exports.__importStar||function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)k!=="default"&&Object.hasOwnProperty.call(mod,k)&&__createBinding(result,mod,k);return __setModuleDefault(result,mod),result};Object.defineProperty(exports,"__esModule",{value:!0});exports.toPlatformPath=exports.toWin32Path=exports.toPosixPath=void 0;var path=__importStar(require("path"));function toPosixPath(pth){return pth.replace(/[\\]/g,"/")}exports.toPosixPath=toPosixPath;function toWin32Path(pth){return pth.replace(/[/]/g,"\\")}exports.toWin32Path=toWin32Path;function toPlatformPath(pth){return pth.replace(/[/\\]/g,path.sep)}exports.toPlatformPath=toPlatformPath}});var require_core=__commonJS({"node_modules/.pnpm/@actions+core@1.10.0/node_modules/@actions/core/lib/core.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?function(o,m,k,k2){k2===void 0&&(k2=k),Object.defineProperty(o,k2,{enumerable:!0,get:function(){return m[k]}})}:function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]}),__setModuleDefault=exports&&exports.__setModuleDefault||(Object.create?function(o,v){Object.defineProperty(o,"default",{enumerable:!0,value:v})}:function(o,v){o.default=v}),__importStar=exports&&exports.__importStar||function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)k!=="default"&&Object.hasOwnProperty.call(mod,k)&&__createBinding(result,mod,k);return __setModuleDefault(result,mod),result},__awaiter=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:!0});exports.getIDToken=exports.getState=exports.saveState=exports.group=exports.endGroup=exports.startGroup=exports.info=exports.notice=exports.warning=exports.error=exports.debug=exports.isDebug=exports.setFailed=exports.setCommandEcho=exports.setOutput=exports.getBooleanInput=exports.getMultilineInput=exports.getInput=exports.addPath=exports.setSecret=exports.exportVariable=exports.ExitCode=void 0;var command_1=require_command(),file_command_1=require_file_command(),utils_1=require_utils(),os=__importStar(require("os")),path=__importStar(require("path")),oidc_utils_1=require_oidc_utils(),ExitCode;(function(ExitCode2){ExitCode2[ExitCode2.Success=0]="Success",ExitCode2[ExitCode2.Failure=1]="Failure"})(ExitCode=exports.ExitCode||(exports.ExitCode={}));function exportVariable(name,val){let convertedVal=utils_1.toCommandValue(val);if(process.env[name]=convertedVal,process.env.GITHUB_ENV||"")return file_command_1.issueFileCommand("ENV",file_command_1.prepareKeyValueMessage(name,val));command_1.issueCommand("set-env",{name},convertedVal)}exports.exportVariable=exportVariable;function setSecret(secret){command_1.issueCommand("add-mask",{},secret)}exports.setSecret=setSecret;function addPath(inputPath){process.env.GITHUB_PATH||""?file_command_1.issueFileCommand("PATH",inputPath):command_1.issueCommand("add-path",{},inputPath),process.env.PATH=`${inputPath}${path.delimiter}${process.env.PATH}`}exports.addPath=addPath;function getInput2(name,options){let val=process.env[`INPUT_${name.replace(/ /g,"_").toUpperCase()}`]||"";if(options&&options.required&&!val)throw new Error(`Input required and not supplied: ${name}`);return options&&options.trimWhitespace===!1?val:val.trim()}exports.getInput=getInput2;function getMultilineInput(name,options){let inputs=getInput2(name,options).split(`
|
|
`).filter(x=>x!=="");return options&&options.trimWhitespace===!1?inputs:inputs.map(input=>input.trim())}exports.getMultilineInput=getMultilineInput;function getBooleanInput(name,options){let trueValue=["true","True","TRUE"],falseValue=["false","False","FALSE"],val=getInput2(name,options);if(trueValue.includes(val))return!0;if(falseValue.includes(val))return!1;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}
|
|
Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}exports.getBooleanInput=getBooleanInput;function setOutput(name,value){if(process.env.GITHUB_OUTPUT||"")return file_command_1.issueFileCommand("OUTPUT",file_command_1.prepareKeyValueMessage(name,value));process.stdout.write(os.EOL),command_1.issueCommand("set-output",{name},utils_1.toCommandValue(value))}exports.setOutput=setOutput;function setCommandEcho(enabled){command_1.issue("echo",enabled?"on":"off")}exports.setCommandEcho=setCommandEcho;function setFailed2(message){process.exitCode=ExitCode.Failure,error(message)}exports.setFailed=setFailed2;function isDebug(){return process.env.RUNNER_DEBUG==="1"}exports.isDebug=isDebug;function debug(message){command_1.issueCommand("debug",{},message)}exports.debug=debug;function error(message,properties={}){command_1.issueCommand("error",utils_1.toCommandProperties(properties),message instanceof Error?message.toString():message)}exports.error=error;function warning(message,properties={}){command_1.issueCommand("warning",utils_1.toCommandProperties(properties),message instanceof Error?message.toString():message)}exports.warning=warning;function notice(message,properties={}){command_1.issueCommand("notice",utils_1.toCommandProperties(properties),message instanceof Error?message.toString():message)}exports.notice=notice;function info2(message){process.stdout.write(message+os.EOL)}exports.info=info2;function startGroup2(name){command_1.issue("group",name)}exports.startGroup=startGroup2;function endGroup2(){command_1.issue("endgroup")}exports.endGroup=endGroup2;function group(name,fn){return __awaiter(this,void 0,void 0,function*(){startGroup2(name);let result;try{result=yield fn()}finally{endGroup2()}return result})}exports.group=group;function saveState(name,value){if(process.env.GITHUB_STATE||"")return file_command_1.issueFileCommand("STATE",file_command_1.prepareKeyValueMessage(name,value));command_1.issueCommand("save-state",{name},utils_1.toCommandValue(value))}exports.saveState=saveState;function getState2(name){return process.env[`STATE_${name}`]||""}exports.getState=getState2;function getIDToken(aud){return __awaiter(this,void 0,void 0,function*(){return yield oidc_utils_1.OidcClient.getIDToken(aud)})}exports.getIDToken=getIDToken;var summary_1=require_summary();Object.defineProperty(exports,"summary",{enumerable:!0,get:function(){return summary_1.summary}});var summary_2=require_summary();Object.defineProperty(exports,"markdownSummary",{enumerable:!0,get:function(){return summary_2.markdownSummary}});var path_utils_1=require_path_utils();Object.defineProperty(exports,"toPosixPath",{enumerable:!0,get:function(){return path_utils_1.toPosixPath}});Object.defineProperty(exports,"toWin32Path",{enumerable:!0,get:function(){return path_utils_1.toWin32Path}});Object.defineProperty(exports,"toPlatformPath",{enumerable:!0,get:function(){return path_utils_1.toPlatformPath}})}});var require_io_util=__commonJS({"node_modules/.pnpm/@actions+io@1.1.3/node_modules/@actions/io/lib/io-util.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?function(o,m,k,k2){k2===void 0&&(k2=k),Object.defineProperty(o,k2,{enumerable:!0,get:function(){return m[k]}})}:function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]}),__setModuleDefault=exports&&exports.__setModuleDefault||(Object.create?function(o,v){Object.defineProperty(o,"default",{enumerable:!0,value:v})}:function(o,v){o.default=v}),__importStar=exports&&exports.__importStar||function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)k!=="default"&&Object.hasOwnProperty.call(mod,k)&&__createBinding(result,mod,k);return __setModuleDefault(result,mod),result},__awaiter=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())})},_a;Object.defineProperty(exports,"__esModule",{value:!0});exports.getCmdPath=exports.tryGetExecutablePath=exports.isRooted=exports.isDirectory=exports.exists=exports.READONLY=exports.UV_FS_O_EXLOCK=exports.IS_WINDOWS=exports.unlink=exports.symlink=exports.stat=exports.rmdir=exports.rm=exports.rename=exports.readlink=exports.readdir=exports.open=exports.mkdir=exports.lstat=exports.copyFile=exports.chmod=void 0;var fs=__importStar(require("fs")),path=__importStar(require("path"));_a=fs.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.readlink=_a.readlink,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";exports.UV_FS_O_EXLOCK=268435456;exports.READONLY=fs.constants.O_RDONLY;function exists(fsPath){return __awaiter(this,void 0,void 0,function*(){try{yield exports.stat(fsPath)}catch(err){if(err.code==="ENOENT")return!1;throw err}return!0})}exports.exists=exists;function isDirectory(fsPath,useStat=!1){return __awaiter(this,void 0,void 0,function*(){return(useStat?yield exports.stat(fsPath):yield exports.lstat(fsPath)).isDirectory()})}exports.isDirectory=isDirectory;function isRooted(p){if(p=normalizeSeparators(p),!p)throw new Error('isRooted() parameter "p" cannot be empty');return exports.IS_WINDOWS?p.startsWith("\\")||/^[A-Z]:/i.test(p):p.startsWith("/")}exports.isRooted=isRooted;function tryGetExecutablePath(filePath,extensions){return __awaiter(this,void 0,void 0,function*(){let stats;try{stats=yield exports.stat(filePath)}catch(err){err.code!=="ENOENT"&&console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`)}if(stats&&stats.isFile()){if(exports.IS_WINDOWS){let upperExt=path.extname(filePath).toUpperCase();if(extensions.some(validExt=>validExt.toUpperCase()===upperExt))return filePath}else if(isUnixExecutable(stats))return filePath}let originalFilePath=filePath;for(let extension of extensions){filePath=originalFilePath+extension,stats=void 0;try{stats=yield exports.stat(filePath)}catch(err){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{let directory=path.dirname(filePath),upperName=path.basename(filePath).toUpperCase();for(let actualName of yield exports.readdir(directory))if(upperName===actualName.toUpperCase()){filePath=path.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""})}exports.tryGetExecutablePath=tryGetExecutablePath;function normalizeSeparators(p){return p=p||"",exports.IS_WINDOWS?(p=p.replace(/\//g,"\\"),p.replace(/\\\\+/g,"\\")):p.replace(/\/\/+/g,"/")}function isUnixExecutable(stats){return(stats.mode&1)>0||(stats.mode&8)>0&&stats.gid===process.getgid()||(stats.mode&64)>0&&stats.uid===process.getuid()}function getCmdPath(){var _a2;return(_a2=process.env.COMSPEC)!==null&&_a2!==void 0?_a2:"cmd.exe"}exports.getCmdPath=getCmdPath}});var require_io=__commonJS({"node_modules/.pnpm/@actions+io@1.1.3/node_modules/@actions/io/lib/io.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?function(o,m,k,k2){k2===void 0&&(k2=k),Object.defineProperty(o,k2,{enumerable:!0,get:function(){return m[k]}})}:function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]}),__setModuleDefault=exports&&exports.__setModuleDefault||(Object.create?function(o,v){Object.defineProperty(o,"default",{enumerable:!0,value:v})}:function(o,v){o.default=v}),__importStar=exports&&exports.__importStar||function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)k!=="default"&&Object.hasOwnProperty.call(mod,k)&&__createBinding(result,mod,k);return __setModuleDefault(result,mod),result},__awaiter=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:!0});exports.findInPath=exports.which=exports.mkdirP=exports.rmRF=exports.mv=exports.cp=void 0;var assert_1=require("assert"),path=__importStar(require("path")),ioUtil=__importStar(require_io_util());function cp(source,dest,options={}){return __awaiter(this,void 0,void 0,function*(){let{force,recursive,copySourceDirectory}=readCopyOptions(options),destStat=(yield ioUtil.exists(dest))?yield ioUtil.stat(dest):null;if(destStat&&destStat.isFile()&&!force)return;let newDest=destStat&&destStat.isDirectory()&©SourceDirectory?path.join(dest,path.basename(source)):dest;if(!(yield ioUtil.exists(source)))throw new Error(`no such file or directory: ${source}`);if((yield ioUtil.stat(source)).isDirectory())if(recursive)yield cpDirRecursive(source,newDest,0,force);else throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);else{if(path.relative(source,newDest)==="")throw new Error(`'${newDest}' and '${source}' are the same file`);yield copyFile(source,newDest,force)}})}exports.cp=cp;function mv(source,dest,options={}){return __awaiter(this,void 0,void 0,function*(){if(yield ioUtil.exists(dest)){let destExists=!0;if((yield ioUtil.isDirectory(dest))&&(dest=path.join(dest,path.basename(source)),destExists=yield ioUtil.exists(dest)),destExists)if(options.force==null||options.force)yield rmRF(dest);else throw new Error("Destination already exists")}yield mkdirP(path.dirname(dest)),yield ioUtil.rename(source,dest)})}exports.mv=mv;function rmRF(inputPath){return __awaiter(this,void 0,void 0,function*(){if(ioUtil.IS_WINDOWS&&/[*"<>|]/.test(inputPath))throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');try{yield ioUtil.rm(inputPath,{force:!0,maxRetries:3,recursive:!0,retryDelay:300})}catch(err){throw new Error(`File was unable to be removed ${err}`)}})}exports.rmRF=rmRF;function mkdirP(fsPath){return __awaiter(this,void 0,void 0,function*(){assert_1.ok(fsPath,"a path argument must be provided"),yield ioUtil.mkdir(fsPath,{recursive:!0})})}exports.mkdirP=mkdirP;function which(tool,check){return __awaiter(this,void 0,void 0,function*(){if(!tool)throw new Error("parameter 'tool' is required");if(check){let result=yield which(tool,!1);if(!result)throw ioUtil.IS_WINDOWS?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.`):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}let matches=yield findInPath(tool);return matches&&matches.length>0?matches[0]:""})}exports.which=which;function findInPath(tool){return __awaiter(this,void 0,void 0,function*(){if(!tool)throw new Error("parameter 'tool' is required");let extensions=[];if(ioUtil.IS_WINDOWS&&process.env.PATHEXT)for(let extension of process.env.PATHEXT.split(path.delimiter))extension&&extensions.push(extension);if(ioUtil.isRooted(tool)){let filePath=yield ioUtil.tryGetExecutablePath(tool,extensions);return filePath?[filePath]:[]}if(tool.includes(path.sep))return[];let directories=[];if(process.env.PATH)for(let p of process.env.PATH.split(path.delimiter))p&&directories.push(p);let matches=[];for(let directory of directories){let filePath=yield ioUtil.tryGetExecutablePath(path.join(directory,tool),extensions);filePath&&matches.push(filePath)}return matches})}exports.findInPath=findInPath;function readCopyOptions(options){let force=options.force==null?!0:options.force,recursive=!!options.recursive,copySourceDirectory=options.copySourceDirectory==null?!0:!!options.copySourceDirectory;return{force,recursive,copySourceDirectory}}function cpDirRecursive(sourceDir,destDir,currentDepth,force){return __awaiter(this,void 0,void 0,function*(){if(currentDepth>=255)return;currentDepth++,yield mkdirP(destDir);let files=yield ioUtil.readdir(sourceDir);for(let fileName of files){let srcFile=`${sourceDir}/${fileName}`,destFile=`${destDir}/${fileName}`;(yield ioUtil.lstat(srcFile)).isDirectory()?yield cpDirRecursive(srcFile,destFile,currentDepth,force):yield copyFile(srcFile,destFile,force)}yield ioUtil.chmod(destDir,(yield ioUtil.stat(sourceDir)).mode)})}function copyFile(srcFile,destFile,force){return __awaiter(this,void 0,void 0,function*(){if((yield ioUtil.lstat(srcFile)).isSymbolicLink()){try{yield ioUtil.lstat(destFile),yield ioUtil.unlink(destFile)}catch(e){e.code==="EPERM"&&(yield ioUtil.chmod(destFile,"0666"),yield ioUtil.unlink(destFile))}let symlinkFull=yield ioUtil.readlink(srcFile);yield ioUtil.symlink(symlinkFull,destFile,ioUtil.IS_WINDOWS?"junction":null)}else(!(yield ioUtil.exists(destFile))||force)&&(yield ioUtil.copyFile(srcFile,destFile))})}}});var require_toolrunner=__commonJS({"node_modules/.pnpm/@actions+exec@1.1.1/node_modules/@actions/exec/lib/toolrunner.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?function(o,m,k,k2){k2===void 0&&(k2=k),Object.defineProperty(o,k2,{enumerable:!0,get:function(){return m[k]}})}:function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]}),__setModuleDefault=exports&&exports.__setModuleDefault||(Object.create?function(o,v){Object.defineProperty(o,"default",{enumerable:!0,value:v})}:function(o,v){o.default=v}),__importStar=exports&&exports.__importStar||function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)k!=="default"&&Object.hasOwnProperty.call(mod,k)&&__createBinding(result,mod,k);return __setModuleDefault(result,mod),result},__awaiter=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:!0});exports.argStringToArray=exports.ToolRunner=void 0;var os=__importStar(require("os")),events=__importStar(require("events")),child=__importStar(require("child_process")),path=__importStar(require("path")),io=__importStar(require_io()),ioUtil=__importStar(require_io_util()),timers_1=require("timers"),IS_WINDOWS=process.platform==="win32",ToolRunner=class extends events.EventEmitter{constructor(toolPath,args,options){if(super(),!toolPath)throw new Error("Parameter 'toolPath' cannot be null or empty.");this.toolPath=toolPath,this.args=args||[],this.options=options||{}}_debug(message){this.options.listeners&&this.options.listeners.debug&&this.options.listeners.debug(message)}_getCommandString(options,noPrefix){let toolPath=this._getSpawnFileName(),args=this._getSpawnArgs(options),cmd=noPrefix?"":"[command]";if(IS_WINDOWS)if(this._isCmdFile()){cmd+=toolPath;for(let a of args)cmd+=` ${a}`}else if(options.windowsVerbatimArguments){cmd+=`"${toolPath}"`;for(let a of args)cmd+=` ${a}`}else{cmd+=this._windowsQuoteCmdArg(toolPath);for(let a of args)cmd+=` ${this._windowsQuoteCmdArg(a)}`}else{cmd+=toolPath;for(let a of args)cmd+=` ${a}`}return cmd}_processLineBuffer(data,strBuffer,onLine){try{let s=strBuffer+data.toString(),n=s.indexOf(os.EOL);for(;n>-1;){let line=s.substring(0,n);onLine(line),s=s.substring(n+os.EOL.length),n=s.indexOf(os.EOL)}return s}catch(err){return this._debug(`error processing line. Failed with error ${err}`),""}}_getSpawnFileName(){return IS_WINDOWS&&this._isCmdFile()?process.env.COMSPEC||"cmd.exe":this.toolPath}_getSpawnArgs(options){if(IS_WINDOWS&&this._isCmdFile()){let argline=`/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;for(let a of this.args)argline+=" ",argline+=options.windowsVerbatimArguments?a:this._windowsQuoteCmdArg(a);return argline+='"',[argline]}return this.args}_endsWith(str,end){return str.endsWith(end)}_isCmdFile(){let 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'""';let cmdSpecialChars=[" "," ","&","(",")","[","]","{","}","^","=",";","!","'","+",",","`","~","|","<",">",'"'],needsQuotes=!1;for(let char of arg)if(cmdSpecialChars.some(x=>x===char)){needsQuotes=!0;break}if(!needsQuotes)return arg;let reverse='"',quoteHit=!0;for(let i=arg.length;i>0;i--)reverse+=arg[i-1],quoteHit&&arg[i-1]==="\\"?reverse+="\\":arg[i-1]==='"'?(quoteHit=!0,reverse+='"'):quoteHit=!1;return reverse+='"',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='"',quoteHit=!0;for(let i=arg.length;i>0;i--)reverse+=arg[i-1],quoteHit&&arg[i-1]==="\\"?reverse+="\\":arg[i-1]==='"'?(quoteHit=!0,reverse+="\\"):quoteHit=!1;return reverse+='"',reverse.split("").reverse().join("")}_cloneExecOptions(options){options=options||{};let result={cwd:options.cwd||process.cwd(),env:options.env||process.env,silent:options.silent||!1,windowsVerbatimArguments:options.windowsVerbatimArguments||!1,failOnStdErr:options.failOnStdErr||!1,ignoreReturnCode:options.ignoreReturnCode||!1,delay:options.delay||1e4};return result.outStream=options.outStream||process.stdout,result.errStream=options.errStream||process.stderr,result}_getSpawnOptions(options,toolPath){options=options||{};let result={};return result.cwd=options.cwd,result.env=options.env,result.windowsVerbatimArguments=options.windowsVerbatimArguments||this._isCmdFile(),options.windowsVerbatimArguments&&(result.argv0=`"${toolPath}"`),result}exec(){return __awaiter(this,void 0,void 0,function*(){return!ioUtil.isRooted(this.toolPath)&&(this.toolPath.includes("/")||IS_WINDOWS&&this.toolPath.includes("\\"))&&(this.toolPath=path.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)),this.toolPath=yield io.which(this.toolPath,!0),new Promise((resolve,reject)=>__awaiter(this,void 0,void 0,function*(){this._debug(`exec tool: ${this.toolPath}`),this._debug("arguments:");for(let arg of this.args)this._debug(` ${arg}`);let optionsNonNull=this._cloneExecOptions(this.options);!optionsNonNull.silent&&optionsNonNull.outStream&&optionsNonNull.outStream.write(this._getCommandString(optionsNonNull)+os.EOL);let state=new ExecState(optionsNonNull,this.toolPath);if(state.on("debug",message=>{this._debug(message)}),this.options.cwd&&!(yield ioUtil.exists(this.options.cwd)))return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`));let fileName=this._getSpawnFileName(),cp=child.spawn(fileName,this._getSpawnArgs(optionsNonNull),this._getSpawnOptions(this.options,fileName)),stdbuffer="";cp.stdout&&cp.stdout.on("data",data=>{this.options.listeners&&this.options.listeners.stdout&&this.options.listeners.stdout(data),!optionsNonNull.silent&&optionsNonNull.outStream&&optionsNonNull.outStream.write(data),stdbuffer=this._processLineBuffer(data,stdbuffer,line=>{this.options.listeners&&this.options.listeners.stdline&&this.options.listeners.stdline(line)})});let errbuffer="";if(cp.stderr&&cp.stderr.on("data",data=>{state.processStderr=!0,this.options.listeners&&this.options.listeners.stderr&&this.options.listeners.stderr(data),!optionsNonNull.silent&&optionsNonNull.errStream&&optionsNonNull.outStream&&(optionsNonNull.failOnStdErr?optionsNonNull.errStream:optionsNonNull.outStream).write(data),errbuffer=this._processLineBuffer(data,errbuffer,line=>{this.options.listeners&&this.options.listeners.errline&&this.options.listeners.errline(line)})}),cp.on("error",err=>{state.processError=err.message,state.processExited=!0,state.processClosed=!0,state.CheckComplete()}),cp.on("exit",code=>{state.processExitCode=code,state.processExited=!0,this._debug(`Exit code ${code} received from tool '${this.toolPath}'`),state.CheckComplete()}),cp.on("close",code=>{state.processExitCode=code,state.processExited=!0,state.processClosed=!0,this._debug(`STDIO streams have closed for tool '${this.toolPath}'`),state.CheckComplete()}),state.on("done",(error,exitCode)=>{stdbuffer.length>0&&this.emit("stdline",stdbuffer),errbuffer.length>0&&this.emit("errline",errbuffer),cp.removeAllListeners(),error?reject(error):resolve(exitCode)}),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){let args=[],inQuotes=!1,escaped=!1,arg="";function append(c){escaped&&c!=='"'&&(arg+="\\"),arg+=c,escaped=!1}for(let i=0;i<argString.length;i++){let c=argString.charAt(i);if(c==='"'){escaped?append(c):inQuotes=!inQuotes;continue}if(c==="\\"&&escaped){append(c);continue}if(c==="\\"&&inQuotes){escaped=!0;continue}if(c===" "&&!inQuotes){arg.length>0&&(args.push(arg),arg="");continue}append(c)}return arg.length>0&&args.push(arg.trim()),args}exports.argStringToArray=argStringToArray;var ExecState=class _ExecState extends events.EventEmitter{constructor(options,toolPath){if(super(),this.processClosed=!1,this.processError="",this.processExitCode=0,this.processExited=!1,this.processStderr=!1,this.delay=1e4,this.done=!1,this.timeout=null,!toolPath)throw new Error("toolPath must not be empty");this.options=options,this.toolPath=toolPath,options.delay&&(this.delay=options.delay)}CheckComplete(){this.done||(this.processClosed?this._setResult():this.processExited&&(this.timeout=timers_1.setTimeout(_ExecState.HandleTimeout,this.delay,this)))}_debug(message){this.emit("debug",message)}_setResult(){let error;this.processExited&&(this.processError?error=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}`):this.processExitCode!==0&&!this.options.ignoreReturnCode?error=new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`):this.processStderr&&this.options.failOnStdErr&&(error=new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`))),this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.done=!0,this.emit("done",error,this.processExitCode)}static HandleTimeout(state){if(!state.done){if(!state.processClosed&&state.processExited){let 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()}}}}});var require_exec=__commonJS({"node_modules/.pnpm/@actions+exec@1.1.1/node_modules/@actions/exec/lib/exec.js"(exports){"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?function(o,m,k,k2){k2===void 0&&(k2=k),Object.defineProperty(o,k2,{enumerable:!0,get:function(){return m[k]}})}:function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]}),__setModuleDefault=exports&&exports.__setModuleDefault||(Object.create?function(o,v){Object.defineProperty(o,"default",{enumerable:!0,value:v})}:function(o,v){o.default=v}),__importStar=exports&&exports.__importStar||function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)k!=="default"&&Object.hasOwnProperty.call(mod,k)&&__createBinding(result,mod,k);return __setModuleDefault(result,mod),result},__awaiter=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:!0});exports.getExecOutput=exports.exec=void 0;var string_decoder_1=require("string_decoder"),tr=__importStar(require_toolrunner());function exec3(commandLine,args,options){return __awaiter(this,void 0,void 0,function*(){let commandArgs=tr.argStringToArray(commandLine);if(commandArgs.length===0)throw new Error("Parameter 'commandLine' cannot be null or empty.");let toolPath=commandArgs[0];return args=commandArgs.slice(1).concat(args||[]),new tr.ToolRunner(toolPath,args,options).exec()})}exports.exec=exec3;function getExecOutput(commandLine,args,options){var _a,_b;return __awaiter(this,void 0,void 0,function*(){let stdout="",stderr="",stdoutDecoder=new string_decoder_1.StringDecoder("utf8"),stderrDecoder=new string_decoder_1.StringDecoder("utf8"),originalStdoutListener=(_a=options?.listeners)===null||_a===void 0?void 0:_a.stdout,originalStdErrListener=(_b=options?.listeners)===null||_b===void 0?void 0:_b.stderr,stdErrListener=data=>{stderr+=stderrDecoder.write(data),originalStdErrListener&&originalStdErrListener(data)},stdOutListener=data=>{stdout+=stdoutDecoder.write(data),originalStdoutListener&&originalStdoutListener(data)},listeners=Object.assign(Object.assign({},options?.listeners),{stdout:stdOutListener,stderr:stdErrListener}),exitCode=yield exec3(commandLine,args,Object.assign(Object.assign({},options),{listeners}));return stdout+=stdoutDecoder.end(),stderr+=stderrDecoder.end(),{exitCode,stdout,stderr}})}exports.getExecOutput=getExecOutput}});var core=__toESM(require_core()),import_exec2=__toESM(require_exec());var import_exec=__toESM(require_exec()),import_node_stream=require("node:stream"),StringStream=class extends import_node_stream.Writable{chunks=[];_write(chunk,_enc,next){this.chunks.push(Buffer.from(chunk)),next()}string(){return Buffer.concat(this.chunks).toString("utf-8")}},getStorePaths=async()=>{let outStream=new StringStream;return await(0,import_exec.exec)("nix",["path-info","--all"],{outStream}),outStream.string().split(`
|
|
`).filter(Boolean)};var push=async()=>{core.startGroup("Push to Attic");try{if(core.getInput("skip-push")==="true")core.info("Pushing to cache is disabled by skip-push");else{let cache=core.getInput("cache");core.info("Pushing to cache");let oldPaths=JSON.parse(core.getState("initial-paths")),addedPaths=(await getStorePaths()).filter(p=>!oldPaths.includes(p));await(0,import_exec2.exec)("attic",["push",cache,...addedPaths])}}catch(e){core.setFailed(`Action failed with error: ${e}`)}core.endGroup()};var main=async()=>{await push()};main();
|