diff --git a/dist/main.js b/dist/main.js index 23c73e4..f527e2f 100644 --- a/dist/main.js +++ b/dist/main.js @@ -58,7 +58,7 @@ ${e.format(t)} Error Message: ${n.message}`)})).result)===null||t===void 0?void 0:t.value;if(!i)throw new Error("Response json body do not have ID Token field");return i})}static getIDToken(e){return jl(this,void 0,void 0,function*(){try{let t=A.getIDTokenUrl();if(e){let s=encodeURIComponent(e);t=`${t}&audience=${s}`}(0,zl.debug)(`ID token url is ${t}`);let r=yield A.getCall(t);return(0,zl.setSecret)(r),r}catch(t){throw new Error(`Error message: ${t.message}`)}})}};gs.OidcClient=kQ});var SQ=l(te=>{"use strict";var NQ=te&&te.__awaiter||function(A,e,t,r){function s(i){return i instanceof t?i:new t(function(n){n(i)})}return new(t||(t=Promise))(function(i,n){function o(Q){try{E(r.next(Q))}catch(a){n(a)}}function g(Q){try{E(r.throw(Q))}catch(a){n(a)}}function E(Q){Q.done?i(Q.value):s(Q.value).then(o,g)}E((r=r.apply(A,e||[])).next())})};Object.defineProperty(te,"__esModule",{value:!0});te.summary=te.markdownSummary=te.SUMMARY_DOCS_URL=te.SUMMARY_ENV_VAR=void 0;var cb=require("os"),bQ=require("fs"),{access:Ib,appendFile:hb,writeFile:lb}=bQ.promises;te.SUMMARY_ENV_VAR="GITHUB_STEP_SUMMARY";te.SUMMARY_DOCS_URL="https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";var mQ=class{constructor(){this._buffer=""}filePath(){return NQ(this,void 0,void 0,function*(){if(this._filePath)return this._filePath;let e=process.env[te.SUMMARY_ENV_VAR];if(!e)throw new Error(`Unable to find environment variable for $${te.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);try{yield Ib(e,bQ.constants.R_OK|bQ.constants.W_OK)}catch(t){throw new Error(`Unable to access summary file: '${e}'. Check if the file has correct read/write permissions.`)}return this._filePath=e,this._filePath})}wrap(e,t,r={}){let s=Object.entries(r).map(([i,n])=>` ${i}="${n}"`).join("");return t?`<${e}${s}>${t}`:`<${e}${s}>`}write(e){return NQ(this,void 0,void 0,function*(){let t=!!(e!=null&&e.overwrite),r=yield this.filePath();return yield(t?lb:hb)(r,this._buffer,{encoding:"utf8"}),this.emptyBuffer()})}clear(){return NQ(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(e,t=!1){return this._buffer+=e,t?this.addEOL():this}addEOL(){return this.addRaw(cb.EOL)}addCodeBlock(e,t){let r=Object.assign({},t&&{lang:t}),s=this.wrap("pre",this.wrap("code",e),r);return this.addRaw(s).addEOL()}addList(e,t=!1){let r=t?"ol":"ul",s=e.map(n=>this.wrap("li",n)).join(""),i=this.wrap(r,s);return this.addRaw(i).addEOL()}addTable(e){let t=e.map(s=>{let i=s.map(n=>{if(typeof n=="string")return this.wrap("td",n);let{header:o,data:g,colspan:E,rowspan:Q}=n,a=o?"th":"td",B=Object.assign(Object.assign({},E&&{colspan:E}),Q&&{rowspan:Q});return this.wrap(a,g,B)}).join("");return this.wrap("tr",i)}).join(""),r=this.wrap("table",t);return this.addRaw(r).addEOL()}addDetails(e,t){let r=this.wrap("details",this.wrap("summary",e)+t);return this.addRaw(r).addEOL()}addImage(e,t,r){let{width:s,height:i}=r||{},n=Object.assign(Object.assign({},s&&{width:s}),i&&{height:i}),o=this.wrap("img",null,Object.assign({src:e,alt:t},n));return this.addRaw(o).addEOL()}addHeading(e,t){let r=`h${t}`,s=["h1","h2","h3","h4","h5","h6"].includes(r)?r:"h1",i=this.wrap(s,e);return this.addRaw(i).addEOL()}addSeparator(){let e=this.wrap("hr",null);return this.addRaw(e).addEOL()}addBreak(){let e=this.wrap("br",null);return this.addRaw(e).addEOL()}addQuote(e,t){let r=Object.assign({},t&&{cite:t}),s=this.wrap("blockquote",e,r);return this.addRaw(s).addEOL()}addLink(e,t){let r=this.wrap("a",e,{href:t});return this.addRaw(r).addEOL()}},Au=new mQ;te.markdownSummary=Au;te.summary=Au});var eu=l(re=>{"use strict";var ub=re&&re.__createBinding||(Object.create?function(A,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,r,s)}:function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]}),db=re&&re.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),fb=re&&re.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.prototype.hasOwnProperty.call(A,t)&&ub(e,A,t);return db(e,A),e};Object.defineProperty(re,"__esModule",{value:!0});re.toPlatformPath=re.toWin32Path=re.toPosixPath=void 0;var yb=fb(require("path"));function wb(A){return A.replace(/[\\]/g,"/")}re.toPosixPath=wb;function Db(A){return A.replace(/[/]/g,"\\")}re.toWin32Path=Db;function pb(A){return A.replace(/[/\\]/g,yb.sep)}re.toPlatformPath=pb});var LQ=l(b=>{"use strict";var Rb=b&&b.__createBinding||(Object.create?function(A,e,t,r){r===void 0&&(r=t),Object.defineProperty(A,r,{enumerable:!0,get:function(){return e[t]}})}:function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]}),kb=b&&b.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),ru=b&&b.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.hasOwnProperty.call(A,t)&&Rb(e,A,t);return kb(e,A),e},UQ=b&&b.__awaiter||function(A,e,t,r){function s(i){return i instanceof t?i:new t(function(n){n(i)})}return new(t||(t=Promise))(function(i,n){function o(Q){try{E(r.next(Q))}catch(a){n(a)}}function g(Q){try{E(r.throw(Q))}catch(a){n(a)}}function E(Q){Q.done?i(Q.value):s(Q.value).then(o,g)}E((r=r.apply(A,e||[])).next())})},se;Object.defineProperty(b,"__esModule",{value:!0});b.getCmdPath=b.tryGetExecutablePath=b.isRooted=b.isDirectory=b.exists=b.READONLY=b.UV_FS_O_EXLOCK=b.IS_WINDOWS=b.unlink=b.symlink=b.stat=b.rmdir=b.rm=b.rename=b.readlink=b.readdir=b.open=b.mkdir=b.lstat=b.copyFile=b.chmod=void 0;var su=ru(require("fs")),so=ru(require("path"));se=su.promises,b.chmod=se.chmod,b.copyFile=se.copyFile,b.lstat=se.lstat,b.mkdir=se.mkdir,b.open=se.open,b.readdir=se.readdir,b.readlink=se.readlink,b.rename=se.rename,b.rm=se.rm,b.rmdir=se.rmdir,b.stat=se.stat,b.symlink=se.symlink,b.unlink=se.unlink;b.IS_WINDOWS=process.platform==="win32";b.UV_FS_O_EXLOCK=268435456;b.READONLY=su.constants.O_RDONLY;function Fb(A){return UQ(this,void 0,void 0,function*(){try{yield b.stat(A)}catch(e){if(e.code==="ENOENT")return!1;throw e}return!0})}b.exists=Fb;function Nb(A,e=!1){return UQ(this,void 0,void 0,function*(){return(e?yield b.stat(A):yield b.lstat(A)).isDirectory()})}b.isDirectory=Nb;function bb(A){if(A=Sb(A),!A)throw new Error('isRooted() parameter "p" cannot be empty');return b.IS_WINDOWS?A.startsWith("\\")||/^[A-Z]:/i.test(A):A.startsWith("/")}b.isRooted=bb;function mb(A,e){return UQ(this,void 0,void 0,function*(){let t;try{t=yield b.stat(A)}catch(s){s.code!=="ENOENT"&&console.log(`Unexpected error attempting to determine if executable file exists '${A}': ${s}`)}if(t&&t.isFile()){if(b.IS_WINDOWS){let s=so.extname(A).toUpperCase();if(e.some(i=>i.toUpperCase()===s))return A}else if(tu(t))return A}let r=A;for(let s of e){A=r+s,t=void 0;try{t=yield b.stat(A)}catch(i){i.code!=="ENOENT"&&console.log(`Unexpected error attempting to determine if executable file exists '${A}': ${i}`)}if(t&&t.isFile()){if(b.IS_WINDOWS){try{let i=so.dirname(A),n=so.basename(A).toUpperCase();for(let o of yield b.readdir(i))if(n===o.toUpperCase()){A=so.join(i,o);break}}catch(i){console.log(`Unexpected error attempting to determine the actual case of the file '${A}': ${i}`)}return A}else if(tu(t))return A}}return""})}b.tryGetExecutablePath=mb;function Sb(A){return A=A||"",b.IS_WINDOWS?(A=A.replace(/\//g,"\\"),A.replace(/\\\\+/g,"\\")):A.replace(/\/\/+/g,"/")}function tu(A){return(A.mode&1)>0||(A.mode&8)>0&&A.gid===process.getgid()||(A.mode&64)>0&&A.uid===process.getuid()}function Ub(){var A;return(A=process.env.COMSPEC)!==null&&A!==void 0?A:"cmd.exe"}b.getCmdPath=Ub});var au=l(cA=>{"use strict";var Lb=cA&&cA.__createBinding||(Object.create?function(A,e,t,r){r===void 0&&(r=t),Object.defineProperty(A,r,{enumerable:!0,get:function(){return e[t]}})}:function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]}),Mb=cA&&cA.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),iu=cA&&cA.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.hasOwnProperty.call(A,t)&&Lb(e,A,t);return Mb(e,A),e},Tt=cA&&cA.__awaiter||function(A,e,t,r){function s(i){return i instanceof t?i:new t(function(n){n(i)})}return new(t||(t=Promise))(function(i,n){function o(Q){try{E(r.next(Q))}catch(a){n(a)}}function g(Q){try{E(r.throw(Q))}catch(a){n(a)}}function E(Q){Q.done?i(Q.value):s(Q.value).then(o,g)}E((r=r.apply(A,e||[])).next())})};Object.defineProperty(cA,"__esModule",{value:!0});cA.findInPath=cA.which=cA.mkdirP=cA.rmRF=cA.mv=cA.cp=void 0;var Yb=require("assert"),tt=iu(require("path")),X=iu(LQ());function xb(A,e,t={}){return Tt(this,void 0,void 0,function*(){let{force:r,recursive:s,copySourceDirectory:i}=Gb(t),n=(yield X.exists(e))?yield X.stat(e):null;if(n&&n.isFile()&&!r)return;let o=n&&n.isDirectory()&&i?tt.join(e,tt.basename(A)):e;if(!(yield X.exists(A)))throw new Error(`no such file or directory: ${A}`);if((yield X.stat(A)).isDirectory())if(s)yield Eu(A,o,0,r);else throw new Error(`Failed to copy. ${A} is a directory, but tried to copy without recursive flag.`);else{if(tt.relative(A,o)==="")throw new Error(`'${o}' and '${A}' are the same file`);yield Qu(A,o,r)}})}cA.cp=xb;function Jb(A,e,t={}){return Tt(this,void 0,void 0,function*(){if(yield X.exists(e)){let r=!0;if((yield X.isDirectory(e))&&(e=tt.join(e,tt.basename(A)),r=yield X.exists(e)),r)if(t.force==null||t.force)yield nu(e);else throw new Error("Destination already exists")}yield MQ(tt.dirname(e)),yield X.rename(A,e)})}cA.mv=Jb;function nu(A){return Tt(this,void 0,void 0,function*(){if(X.IS_WINDOWS&&/[*"<>|]/.test(A))throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');try{yield X.rm(A,{force:!0,maxRetries:3,recursive:!0,retryDelay:300})}catch(e){throw new Error(`File was unable to be removed ${e}`)}})}cA.rmRF=nu;function MQ(A){return Tt(this,void 0,void 0,function*(){Yb.ok(A,"a path argument must be provided"),yield X.mkdir(A,{recursive:!0})})}cA.mkdirP=MQ;function ou(A,e){return Tt(this,void 0,void 0,function*(){if(!A)throw new Error("parameter 'tool' is required");if(e){let r=yield ou(A,!1);if(!r)throw X.IS_WINDOWS?new Error(`Unable to locate executable file: ${A}. 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: ${A}. 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 r}let t=yield gu(A);return t&&t.length>0?t[0]:""})}cA.which=ou;function gu(A){return Tt(this,void 0,void 0,function*(){if(!A)throw new Error("parameter 'tool' is required");let e=[];if(X.IS_WINDOWS&&process.env.PATHEXT)for(let s of process.env.PATHEXT.split(tt.delimiter))s&&e.push(s);if(X.isRooted(A)){let s=yield X.tryGetExecutablePath(A,e);return s?[s]:[]}if(A.includes(tt.sep))return[];let t=[];if(process.env.PATH)for(let s of process.env.PATH.split(tt.delimiter))s&&t.push(s);let r=[];for(let s of t){let i=yield X.tryGetExecutablePath(tt.join(s,A),e);i&&r.push(i)}return r})}cA.findInPath=gu;function Gb(A){let e=A.force==null?!0:A.force,t=!!A.recursive,r=A.copySourceDirectory==null?!0:!!A.copySourceDirectory;return{force:e,recursive:t,copySourceDirectory:r}}function Eu(A,e,t,r){return Tt(this,void 0,void 0,function*(){if(t>=255)return;t++,yield MQ(e);let s=yield X.readdir(A);for(let i of s){let n=`${A}/${i}`,o=`${e}/${i}`;(yield X.lstat(n)).isDirectory()?yield Eu(n,o,t,r):yield Qu(n,o,r)}yield X.chmod(e,(yield X.stat(A)).mode)})}function Qu(A,e,t){return Tt(this,void 0,void 0,function*(){if((yield X.lstat(A)).isSymbolicLink()){try{yield X.lstat(e),yield X.unlink(e)}catch(s){s.code==="EPERM"&&(yield X.chmod(e,"0666"),yield X.unlink(e))}let r=yield X.readlink(A);yield X.symlink(r,e,X.IS_WINDOWS?"junction":null)}else(!(yield X.exists(e))||t)&&(yield X.copyFile(A,e))})}});var Iu=l(ie=>{"use strict";var Tb=ie&&ie.__createBinding||(Object.create?function(A,e,t,r){r===void 0&&(r=t),Object.defineProperty(A,r,{enumerable:!0,get:function(){return e[t]}})}:function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]}),Hb=ie&&ie.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),Es=ie&&ie.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.hasOwnProperty.call(A,t)&&Tb(e,A,t);return Hb(e,A),e},Bu=ie&&ie.__awaiter||function(A,e,t,r){function s(i){return i instanceof t?i:new t(function(n){n(i)})}return new(t||(t=Promise))(function(i,n){function o(Q){try{E(r.next(Q))}catch(a){n(a)}}function g(Q){try{E(r.throw(Q))}catch(a){n(a)}}function E(Q){Q.done?i(Q.value):s(Q.value).then(o,g)}E((r=r.apply(A,e||[])).next())})};Object.defineProperty(ie,"__esModule",{value:!0});ie.argStringToArray=ie.ToolRunner=void 0;var io=Es(require("os")),cu=Es(require("events")),vb=Es(require("child_process")),Vb=Es(require("path")),qb=Es(au()),Cu=Es(LQ()),Ob=require("timers"),no=process.platform==="win32",YQ=class extends cu.EventEmitter{constructor(e,t,r){if(super(),!e)throw new Error("Parameter 'toolPath' cannot be null or empty.");this.toolPath=e,this.args=t||[],this.options=r||{}}_debug(e){this.options.listeners&&this.options.listeners.debug&&this.options.listeners.debug(e)}_getCommandString(e,t){let r=this._getSpawnFileName(),s=this._getSpawnArgs(e),i=t?"":"[command]";if(no)if(this._isCmdFile()){i+=r;for(let n of s)i+=` ${n}`}else if(e.windowsVerbatimArguments){i+=`"${r}"`;for(let n of s)i+=` ${n}`}else{i+=this._windowsQuoteCmdArg(r);for(let n of s)i+=` ${this._windowsQuoteCmdArg(n)}`}else{i+=r;for(let n of s)i+=` ${n}`}return i}_processLineBuffer(e,t,r){try{let s=t+e.toString(),i=s.indexOf(io.EOL);for(;i>-1;){let n=s.substring(0,i);r(n),s=s.substring(i+io.EOL.length),i=s.indexOf(io.EOL)}return s}catch(s){return this._debug(`error processing line. Failed with error ${s}`),""}}_getSpawnFileName(){return no&&this._isCmdFile()?process.env.COMSPEC||"cmd.exe":this.toolPath}_getSpawnArgs(e){if(no&&this._isCmdFile()){let t=`/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;for(let r of this.args)t+=" ",t+=e.windowsVerbatimArguments?r:this._windowsQuoteCmdArg(r);return t+='"',[t]}return this.args}_endsWith(e,t){return e.endsWith(t)}_isCmdFile(){let e=this.toolPath.toUpperCase();return this._endsWith(e,".CMD")||this._endsWith(e,".BAT")}_windowsQuoteCmdArg(e){if(!this._isCmdFile())return this._uvQuoteCmdArg(e);if(!e)return'""';let t=[" "," ","&","(",")","[","]","{","}","^","=",";","!","'","+",",","`","~","|","<",">",'"'],r=!1;for(let n of e)if(t.some(o=>o===n)){r=!0;break}if(!r)return e;let s='"',i=!0;for(let n=e.length;n>0;n--)s+=e[n-1],i&&e[n-1]==="\\"?s+="\\":e[n-1]==='"'?(i=!0,s+='"'):i=!1;return s+='"',s.split("").reverse().join("")}_uvQuoteCmdArg(e){if(!e)return'""';if(!e.includes(" ")&&!e.includes(" ")&&!e.includes('"'))return e;if(!e.includes('"')&&!e.includes("\\"))return`"${e}"`;let t='"',r=!0;for(let s=e.length;s>0;s--)t+=e[s-1],r&&e[s-1]==="\\"?t+="\\":e[s-1]==='"'?(r=!0,t+="\\"):r=!1;return t+='"',t.split("").reverse().join("")}_cloneExecOptions(e){e=e||{};let t={cwd:e.cwd||process.cwd(),env:e.env||process.env,silent:e.silent||!1,windowsVerbatimArguments:e.windowsVerbatimArguments||!1,failOnStdErr:e.failOnStdErr||!1,ignoreReturnCode:e.ignoreReturnCode||!1,delay:e.delay||1e4};return t.outStream=e.outStream||process.stdout,t.errStream=e.errStream||process.stderr,t}_getSpawnOptions(e,t){e=e||{};let r={};return r.cwd=e.cwd,r.env=e.env,r.windowsVerbatimArguments=e.windowsVerbatimArguments||this._isCmdFile(),e.windowsVerbatimArguments&&(r.argv0=`"${t}"`),r}exec(){return Bu(this,void 0,void 0,function*(){return!Cu.isRooted(this.toolPath)&&(this.toolPath.includes("/")||no&&this.toolPath.includes("\\"))&&(this.toolPath=Vb.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)),this.toolPath=yield qb.which(this.toolPath,!0),new Promise((e,t)=>Bu(this,void 0,void 0,function*(){this._debug(`exec tool: ${this.toolPath}`),this._debug("arguments:");for(let E of this.args)this._debug(` ${E}`);let r=this._cloneExecOptions(this.options);!r.silent&&r.outStream&&r.outStream.write(this._getCommandString(r)+io.EOL);let s=new xQ(r,this.toolPath);if(s.on("debug",E=>{this._debug(E)}),this.options.cwd&&!(yield Cu.exists(this.options.cwd)))return t(new Error(`The cwd: ${this.options.cwd} does not exist!`));let i=this._getSpawnFileName(),n=vb.spawn(i,this._getSpawnArgs(r),this._getSpawnOptions(this.options,i)),o="";n.stdout&&n.stdout.on("data",E=>{this.options.listeners&&this.options.listeners.stdout&&this.options.listeners.stdout(E),!r.silent&&r.outStream&&r.outStream.write(E),o=this._processLineBuffer(E,o,Q=>{this.options.listeners&&this.options.listeners.stdline&&this.options.listeners.stdline(Q)})});let g="";if(n.stderr&&n.stderr.on("data",E=>{s.processStderr=!0,this.options.listeners&&this.options.listeners.stderr&&this.options.listeners.stderr(E),!r.silent&&r.errStream&&r.outStream&&(r.failOnStdErr?r.errStream:r.outStream).write(E),g=this._processLineBuffer(E,g,Q=>{this.options.listeners&&this.options.listeners.errline&&this.options.listeners.errline(Q)})}),n.on("error",E=>{s.processError=E.message,s.processExited=!0,s.processClosed=!0,s.CheckComplete()}),n.on("exit",E=>{s.processExitCode=E,s.processExited=!0,this._debug(`Exit code ${E} received from tool '${this.toolPath}'`),s.CheckComplete()}),n.on("close",E=>{s.processExitCode=E,s.processExited=!0,s.processClosed=!0,this._debug(`STDIO streams have closed for tool '${this.toolPath}'`),s.CheckComplete()}),s.on("done",(E,Q)=>{o.length>0&&this.emit("stdline",o),g.length>0&&this.emit("errline",g),n.removeAllListeners(),E?t(E):e(Q)}),this.options.input){if(!n.stdin)throw new Error("child process missing stdin");n.stdin.end(this.options.input)}}))})}};ie.ToolRunner=YQ;function Wb(A){let e=[],t=!1,r=!1,s="";function i(n){r&&n!=='"'&&(s+="\\"),s+=n,r=!1}for(let n=0;n0&&(e.push(s),s="");continue}i(o)}return s.length>0&&e.push(s.trim()),e}ie.argStringToArray=Wb;var xQ=class A extends cu.EventEmitter{constructor(e,t){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,!t)throw new Error("toolPath must not be empty");this.options=e,this.toolPath=t,e.delay&&(this.delay=e.delay)}CheckComplete(){this.done||(this.processClosed?this._setResult():this.processExited&&(this.timeout=Ob.setTimeout(A.HandleTimeout,this.delay,this)))}_debug(e){this.emit("debug",e)}_setResult(){let e;this.processExited&&(this.processError?e=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?e=new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`):this.processStderr&&this.options.failOnStdErr&&(e=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",e,this.processExitCode)}static HandleTimeout(e){if(!e.done){if(!e.processClosed&&e.processExited){let t=`The STDIO streams did not close within ${e.delay/1e3} seconds of the exit event from process '${e.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;e._debug(t)}e._setResult()}}}});var fu=l(ne=>{"use strict";var Pb=ne&&ne.__createBinding||(Object.create?function(A,e,t,r){r===void 0&&(r=t),Object.defineProperty(A,r,{enumerable:!0,get:function(){return e[t]}})}:function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]}),_b=ne&&ne.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),Zb=ne&&ne.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.hasOwnProperty.call(A,t)&&Pb(e,A,t);return _b(e,A),e},uu=ne&&ne.__awaiter||function(A,e,t,r){function s(i){return i instanceof t?i:new t(function(n){n(i)})}return new(t||(t=Promise))(function(i,n){function o(Q){try{E(r.next(Q))}catch(a){n(a)}}function g(Q){try{E(r.throw(Q))}catch(a){n(a)}}function E(Q){Q.done?i(Q.value):s(Q.value).then(o,g)}E((r=r.apply(A,e||[])).next())})};Object.defineProperty(ne,"__esModule",{value:!0});ne.getExecOutput=ne.exec=void 0;var hu=require("string_decoder"),lu=Zb(Iu());function du(A,e,t){return uu(this,void 0,void 0,function*(){let r=lu.argStringToArray(A);if(r.length===0)throw new Error("Parameter 'commandLine' cannot be null or empty.");let s=r[0];return e=r.slice(1).concat(e||[]),new lu.ToolRunner(s,e,t).exec()})}ne.exec=du;function Xb(A,e,t){var r,s;return uu(this,void 0,void 0,function*(){let i="",n="",o=new hu.StringDecoder("utf8"),g=new hu.StringDecoder("utf8"),E=(r=t==null?void 0:t.listeners)===null||r===void 0?void 0:r.stdout,Q=(s=t==null?void 0:t.listeners)===null||s===void 0?void 0:s.stderr,a=h=>{n+=g.write(h),Q&&Q(h)},B=h=>{i+=o.write(h),E&&E(h)},C=Object.assign(Object.assign({},t==null?void 0:t.listeners),{stdout:B,stderr:a}),c=yield du(A,e,Object.assign(Object.assign({},t),{listeners:C}));return i+=o.end(),n+=g.end(),{exitCode:c,stdout:i,stderr:n}})}ne.getExecOutput=Xb});var wu=l(W=>{"use strict";var Kb=W&&W.__createBinding||(Object.create?function(A,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,r,s)}:function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]}),jb=W&&W.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),zb=W&&W.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.prototype.hasOwnProperty.call(A,t)&&Kb(e,A,t);return jb(e,A),e},go=W&&W.__awaiter||function(A,e,t,r){function s(i){return i instanceof t?i:new t(function(n){n(i)})}return new(t||(t=Promise))(function(i,n){function o(Q){try{E(r.next(Q))}catch(a){n(a)}}function g(Q){try{E(r.throw(Q))}catch(a){n(a)}}function E(Q){Q.done?i(Q.value):s(Q.value).then(o,g)}E((r=r.apply(A,e||[])).next())})},$b=W&&W.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(W,"__esModule",{value:!0});W.getDetails=W.isLinux=W.isMacOS=W.isWindows=W.arch=W.platform=void 0;var yu=$b(require("os")),oo=zb(fu()),Am=()=>go(void 0,void 0,void 0,function*(){let{stdout:A}=yield oo.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"',void 0,{silent:!0}),{stdout:e}=yield oo.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"',void 0,{silent:!0});return{name:e.trim(),version:A.trim()}}),em=()=>go(void 0,void 0,void 0,function*(){var A,e,t,r;let{stdout:s}=yield oo.getExecOutput("sw_vers",void 0,{silent:!0}),i=(e=(A=s.match(/ProductVersion:\s*(.+)/))===null||A===void 0?void 0:A[1])!==null&&e!==void 0?e:"";return{name:(r=(t=s.match(/ProductName:\s*(.+)/))===null||t===void 0?void 0:t[1])!==null&&r!==void 0?r:"",version:i}}),tm=()=>go(void 0,void 0,void 0,function*(){let{stdout:A}=yield oo.getExecOutput("lsb_release",["-i","-r","-s"],{silent:!0}),[e,t]=A.trim().split(` `);return{name:e,version:t}});W.platform=yu.default.platform();W.arch=yu.default.arch();W.isWindows=W.platform==="win32";W.isMacOS=W.platform==="darwin";W.isLinux=W.platform==="linux";function rm(){return go(this,void 0,void 0,function*(){return Object.assign(Object.assign({},yield W.isWindows?Am():W.isMacOS?em():tm()),{platform:W.platform,arch:W.arch,isWindows:W.isWindows,isMacOS:W.isMacOS,isLinux:W.isLinux})})}W.getDetails=rm});var FQ=l(F=>{"use strict";var sm=F&&F.__createBinding||(Object.create?function(A,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,r,s)}:function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]}),im=F&&F.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),GQ=F&&F.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.prototype.hasOwnProperty.call(A,t)&&sm(e,A,t);return im(e,A),e},Du=F&&F.__awaiter||function(A,e,t,r){function s(i){return i instanceof t?i:new t(function(n){n(i)})}return new(t||(t=Promise))(function(i,n){function o(Q){try{E(r.next(Q))}catch(a){n(a)}}function g(Q){try{E(r.throw(Q))}catch(a){n(a)}}function E(Q){Q.done?i(Q.value):s(Q.value).then(o,g)}E((r=r.apply(A,e||[])).next())})};Object.defineProperty(F,"__esModule",{value:!0});F.platform=F.toPlatformPath=F.toWin32Path=F.toPosixPath=F.markdownSummary=F.summary=F.getIDToken=F.getState=F.saveState=F.group=F.endGroup=F.startGroup=F.info=F.notice=F.warning=F.error=F.debug=F.isDebug=F.setFailed=F.setCommandEcho=F.setOutput=F.getBooleanInput=F.getMultilineInput=F.getInput=F.addPath=F.setSecret=F.exportVariable=F.ExitCode=void 0;var Se=KQ(),Qr=$Q(),Qs=ni(),pu=GQ(require("os")),nm=GQ(require("path")),om=$l(),JQ;(function(A){A[A.Success=0]="Success",A[A.Failure=1]="Failure"})(JQ||(F.ExitCode=JQ={}));function gm(A,e){let t=(0,Qs.toCommandValue)(e);if(process.env[A]=t,process.env.GITHUB_ENV||"")return(0,Qr.issueFileCommand)("ENV",(0,Qr.prepareKeyValueMessage)(A,e));(0,Se.issueCommand)("set-env",{name:A},t)}F.exportVariable=gm;function Em(A){(0,Se.issueCommand)("add-mask",{},A)}F.setSecret=Em;function Qm(A){process.env.GITHUB_PATH||""?(0,Qr.issueFileCommand)("PATH",A):(0,Se.issueCommand)("add-path",{},A),process.env.PATH=`${A}${nm.delimiter}${process.env.PATH}`}F.addPath=Qm;function TQ(A,e){let t=process.env[`INPUT_${A.replace(/ /g,"_").toUpperCase()}`]||"";if(e&&e.required&&!t)throw new Error(`Input required and not supplied: ${A}`);return e&&e.trimWhitespace===!1?t:t.trim()}F.getInput=TQ;function am(A,e){let t=TQ(A,e).split(` `).filter(r=>r!=="");return e&&e.trimWhitespace===!1?t:t.map(r=>r.trim())}F.getMultilineInput=am;function Bm(A,e){let t=["true","True","TRUE"],r=["false","False","FALSE"],s=TQ(A,e);if(t.includes(s))return!0;if(r.includes(s))return!1;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${A} -Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}F.getBooleanInput=Bm;function Cm(A,e){if(process.env.GITHUB_OUTPUT||"")return(0,Qr.issueFileCommand)("OUTPUT",(0,Qr.prepareKeyValueMessage)(A,e));process.stdout.write(pu.EOL),(0,Se.issueCommand)("set-output",{name:A},(0,Qs.toCommandValue)(e))}F.setOutput=Cm;function cm(A){(0,Se.issue)("echo",A?"on":"off")}F.setCommandEcho=cm;function Im(A){process.exitCode=JQ.Failure,Ru(A)}F.setFailed=Im;function hm(){return process.env.RUNNER_DEBUG==="1"}F.isDebug=hm;function lm(A){(0,Se.issueCommand)("debug",{},A)}F.debug=lm;function Ru(A,e={}){(0,Se.issueCommand)("error",(0,Qs.toCommandProperties)(e),A instanceof Error?A.toString():A)}F.error=Ru;function um(A,e={}){(0,Se.issueCommand)("warning",(0,Qs.toCommandProperties)(e),A instanceof Error?A.toString():A)}F.warning=um;function dm(A,e={}){(0,Se.issueCommand)("notice",(0,Qs.toCommandProperties)(e),A instanceof Error?A.toString():A)}F.notice=dm;function fm(A){process.stdout.write(A+pu.EOL)}F.info=fm;function ku(A){(0,Se.issue)("group",A)}F.startGroup=ku;function Fu(){(0,Se.issue)("endgroup")}F.endGroup=Fu;function ym(A,e){return Du(this,void 0,void 0,function*(){ku(A);let t;try{t=yield e()}finally{Fu()}return t})}F.group=ym;function wm(A,e){if(process.env.GITHUB_STATE||"")return(0,Qr.issueFileCommand)("STATE",(0,Qr.prepareKeyValueMessage)(A,e));(0,Se.issueCommand)("save-state",{name:A},(0,Qs.toCommandValue)(e))}F.saveState=wm;function Dm(A){return process.env[`STATE_${A}`]||""}F.getState=Dm;function pm(A){return Du(this,void 0,void 0,function*(){return yield om.OidcClient.getIDToken(A)})}F.getIDToken=pm;var Rm=SQ();Object.defineProperty(F,"summary",{enumerable:!0,get:function(){return Rm.summary}});var km=SQ();Object.defineProperty(F,"markdownSummary",{enumerable:!0,get:function(){return km.markdownSummary}});var HQ=eu();Object.defineProperty(F,"toPosixPath",{enumerable:!0,get:function(){return HQ.toPosixPath}});Object.defineProperty(F,"toWin32Path",{enumerable:!0,get:function(){return HQ.toWin32Path}});Object.defineProperty(F,"toPlatformPath",{enumerable:!0,get:function(){return HQ.toPlatformPath}});F.platform=GQ(wu())});var bu=l(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.ActionsCache=void 0;var Nu=fQ(),Fm=RQ();function vQ(A){return A?200<=A&&A<300:!1}var VQ=class{constructor(e,t){_A(this,"baseUrl");_A(this,"token");_A(this,"httpClient");_A(this,"scopes");this.baseUrl=e,this.token=t,this.httpClient=new Nu.HttpClient("bazel-github-actions-cache",[new Fm.BearerCredentialHandler(t)],{headers:{Accept:"application/json;api-version=6.0-preview.1"}}),this.scopes=new Map}putCache(e,t,r,s){return f(this,null,function*(){var C;let o={key:`${e}-${t}`,version:"b",cacheSize:r},g=yield this.httpClient.postJson(`${this.baseUrl}caches`,o),E=(C=g==null?void 0:g.result)==null?void 0:C.cacheId;if(!E)return s.resume(),!1;let Q=yield this.httpClient.sendStream("PATCH",`${this.baseUrl}caches/${E}`,s,{"Content-Type":"application/octet-stream","Content-Range":`bytes 0-${r-1}/*`});if(!vQ(Q.message.statusCode))return s.resume(),!1;let a={size:r},B=yield this.httpClient.postJson(`${this.baseUrl}caches/${E}`,a);return!!vQ(B.statusCode)})}getCache(e,t){return f(this,null,function*(){var Q,a,B;let r=`${e}-${t}`,s="b",i=yield this.httpClient.getJson(`${this.baseUrl}cache?keys=${r}&version=${s}`),n=((Q=i==null?void 0:i.result)==null?void 0:Q.scope)||"undefined";this.scopes.set(n,((a=this.scopes.get(n))!=null?a:0)+1);let o=(B=i==null?void 0:i.result)==null?void 0:B.archiveLocation;if(!o)return null;let E=yield new Nu.HttpClient("bazel-github-actions-cache").get(o);return vQ(E.message.statusCode)?E.message:(E.message.resume(),null)})}};Eo.ActionsCache=VQ});var Su=l(rt=>{"use strict";var Nm=rt&&rt.__createBinding||(Object.create?function(A,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,r,s)}:function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]}),bm=rt&&rt.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),mm=rt&&rt.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.prototype.hasOwnProperty.call(A,t)&&Nm(e,A,t);return bm(e,A),e};Object.defineProperty(rt,"__esModule",{value:!0});rt.HttpServer=void 0;var Sm=mm(require("http")),mu=require("url"),qQ=class extends Sm.Server{constructor(t){super();_A(this,"n_get",0);_A(this,"n_get_hit",0);_A(this,"n_put",0);_A(this,"n_put_succ",0);_A(this,"n_put_bytes",0);_A(this,"actionsCache");this.actionsCache=t,this.on("request",this.onRequest)}getStats(){return{n_get:this.n_get,n_get_hit:this.n_get_hit,n_put:this.n_put,n_put_succ:this.n_put_succ,n_put_bytes:this.n_put_bytes}}get_close(t,r){this.close(),r.writeHead(200,{"Content-type":"application/json"}),r.end(JSON.stringify(this.actionsCache.scopes))}get_cas(t,r){return f(this,null,function*(){var g,E,Q,a,B;let s=(0,mu.parse)((g=t.url)!=null?g:""),i=(Q=(E=s.pathname)==null?void 0:E.startsWith("/cas/"))!=null?Q:!1,n=(B=(a=s.pathname)==null?void 0:a.substring(i?5:4))!=null?B:"",o=i?"cas":"ac";if(t.method=="PUT"){this.n_put+=1;let C=Number(t.headers["content-length"]),c=!1;try{c=yield this.actionsCache.putCache(o,n,C,t)}catch(h){}c?(this.n_put_succ+=1,this.n_put_bytes+=C,r.writeHead(200)):r.writeHead(500),r.end()}else if(t.method=="GET"){this.n_get+=1;let C=null;try{C=yield this.actionsCache.getCache(o,n)}catch(c){}C?(this.n_get_hit+=1,r.writeHead(200,{"Content-Type":"application/octet-stream"}),C.pipe(r)):(r.writeHead(404),r.end())}})}onRequest(t,r){return f(this,null,function*(){var i,n,o,g;let s=(0,mu.parse)((i=t.url)!=null?i:"");s.pathname=="/close"?this.get_close(t,r):(n=s.pathname)!=null&&n.startsWith("/_apis/artifactcache/")?(r.writeHead(404),r.end()):(o=s.pathname)!=null&&o.startsWith("/cas/")||(g=s.pathname)!=null&&g.startsWith("/ac/")?this.get_cas(t,r):(r.writeHead(404),r.end())})}};rt.HttpServer=qQ});var Um=exports&&exports.__createBinding||(Object.create?function(A,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,r,s)}:function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]}),Lm=exports&&exports.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),Mm=exports&&exports.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.prototype.hasOwnProperty.call(A,t)&&Um(e,A,t);return Lm(e,A),e};Object.defineProperty(exports,"__esModule",{value:!0});var Ym=require("child_process"),xm=Mm(FQ()),Jm=bu(),Gm=Su(),Tm=[];function Hm(A){xm.debug(A),Tm.push(A)}process.env.IS_BACKGROUND?vm():(console.log("spawning"),Hm("foreground"),(0,Ym.spawn)(process.execPath,process.argv.slice(1),{detached:!0,stdio:"inherit",env:x(y({},process.env),{IS_BACKGROUND:"1"})}).unref());function vm(){var i;let e=`${process.env.ACTIONS_CACHE_URL||"http://localhost:3056/"}_apis/artifactcache/`,t=(i=process.env.ACTIONS_RUNTIME_TOKEN)!=null?i:"",r=new Jm.ActionsCache(e,t),s=new Gm.HttpServer(r);s.on("close",()=>{console.log("Goodbye: "+JSON.stringify(s.getStats()))}),s.listen(3055)} +Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}F.getBooleanInput=Bm;function Cm(A,e){if(process.env.GITHUB_OUTPUT||"")return(0,Qr.issueFileCommand)("OUTPUT",(0,Qr.prepareKeyValueMessage)(A,e));process.stdout.write(pu.EOL),(0,Se.issueCommand)("set-output",{name:A},(0,Qs.toCommandValue)(e))}F.setOutput=Cm;function cm(A){(0,Se.issue)("echo",A?"on":"off")}F.setCommandEcho=cm;function Im(A){process.exitCode=JQ.Failure,Ru(A)}F.setFailed=Im;function hm(){return process.env.RUNNER_DEBUG==="1"}F.isDebug=hm;function lm(A){(0,Se.issueCommand)("debug",{},A)}F.debug=lm;function Ru(A,e={}){(0,Se.issueCommand)("error",(0,Qs.toCommandProperties)(e),A instanceof Error?A.toString():A)}F.error=Ru;function um(A,e={}){(0,Se.issueCommand)("warning",(0,Qs.toCommandProperties)(e),A instanceof Error?A.toString():A)}F.warning=um;function dm(A,e={}){(0,Se.issueCommand)("notice",(0,Qs.toCommandProperties)(e),A instanceof Error?A.toString():A)}F.notice=dm;function fm(A){process.stdout.write(A+pu.EOL)}F.info=fm;function ku(A){(0,Se.issue)("group",A)}F.startGroup=ku;function Fu(){(0,Se.issue)("endgroup")}F.endGroup=Fu;function ym(A,e){return Du(this,void 0,void 0,function*(){ku(A);let t;try{t=yield e()}finally{Fu()}return t})}F.group=ym;function wm(A,e){if(process.env.GITHUB_STATE||"")return(0,Qr.issueFileCommand)("STATE",(0,Qr.prepareKeyValueMessage)(A,e));(0,Se.issueCommand)("save-state",{name:A},(0,Qs.toCommandValue)(e))}F.saveState=wm;function Dm(A){return process.env[`STATE_${A}`]||""}F.getState=Dm;function pm(A){return Du(this,void 0,void 0,function*(){return yield om.OidcClient.getIDToken(A)})}F.getIDToken=pm;var Rm=SQ();Object.defineProperty(F,"summary",{enumerable:!0,get:function(){return Rm.summary}});var km=SQ();Object.defineProperty(F,"markdownSummary",{enumerable:!0,get:function(){return km.markdownSummary}});var HQ=eu();Object.defineProperty(F,"toPosixPath",{enumerable:!0,get:function(){return HQ.toPosixPath}});Object.defineProperty(F,"toWin32Path",{enumerable:!0,get:function(){return HQ.toWin32Path}});Object.defineProperty(F,"toPlatformPath",{enumerable:!0,get:function(){return HQ.toPlatformPath}});F.platform=GQ(wu())});var bu=l(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.ActionsCache=void 0;var Nu=fQ(),Fm=RQ();function vQ(A){return A?200<=A&&A<300:!1}var VQ=class{constructor(e,t){_A(this,"baseUrl");_A(this,"token");_A(this,"httpClient");_A(this,"scopes");this.baseUrl=e,this.token=t,this.httpClient=new Nu.HttpClient("bazel-github-actions-cache",[new Fm.BearerCredentialHandler(t)],{headers:{Accept:"application/json;api-version=6.0-preview.1"}}),this.scopes=new Map}putCache(e,t,r,s){return f(this,null,function*(){var C;let o={key:`${e}-${t}`,version:"b",cacheSize:r},g=yield this.httpClient.postJson(`${this.baseUrl}caches`,o),E=(C=g==null?void 0:g.result)==null?void 0:C.cacheId;if(!E)return s.resume(),!1;let Q=yield this.httpClient.sendStream("PATCH",`${this.baseUrl}caches/${E}`,s,{"Content-Type":"application/octet-stream","Content-Range":`bytes 0-${r-1}/*`});if(!vQ(Q.message.statusCode))return s.resume(),!1;let a={size:r},B=yield this.httpClient.postJson(`${this.baseUrl}caches/${E}`,a);return!!vQ(B.statusCode)})}getCache(e,t){return f(this,null,function*(){var Q,a,B;let r=`${e}-${t}`,s="b",i=yield this.httpClient.getJson(`${this.baseUrl}cache?keys=${r}&version=${s}`),n=((Q=i==null?void 0:i.result)==null?void 0:Q.scope)||"undefined";this.scopes.set(n,((a=this.scopes.get(n))!=null?a:0)+1);let o=(B=i==null?void 0:i.result)==null?void 0:B.archiveLocation;if(!o)return null;let E=yield new Nu.HttpClient("bazel-github-actions-cache").get(o);return vQ(E.message.statusCode)?E.message:(E.message.resume(),null)})}};Eo.ActionsCache=VQ});var Su=l(rt=>{"use strict";var Nm=rt&&rt.__createBinding||(Object.create?function(A,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,r,s)}:function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]}),bm=rt&&rt.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),mm=rt&&rt.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.prototype.hasOwnProperty.call(A,t)&&Nm(e,A,t);return bm(e,A),e};Object.defineProperty(rt,"__esModule",{value:!0});rt.HttpServer=void 0;var Sm=mm(require("http")),mu=require("url"),qQ=class extends Sm.Server{constructor(t){super();_A(this,"n_get",0);_A(this,"n_get_hit",0);_A(this,"n_put",0);_A(this,"n_put_succ",0);_A(this,"n_put_bytes",0);_A(this,"actionsCache");this.actionsCache=t,this.on("request",this.onRequest)}getStats(){return{n_get:this.n_get,n_get_hit:this.n_get_hit,n_put:this.n_put,n_put_succ:this.n_put_succ,n_put_bytes:this.n_put_bytes}}get_close(t,r){this.close(),r.writeHead(200,{"Content-type":"application/json"});let s=this.getStats();s.scopes=Object.fromEntries(this.actionsCache.scopes),r.end(JSON.stringify(s))}get_cas(t,r){return f(this,null,function*(){var g,E,Q,a,B;let s=(0,mu.parse)((g=t.url)!=null?g:""),i=(Q=(E=s.pathname)==null?void 0:E.startsWith("/cas/"))!=null?Q:!1,n=(B=(a=s.pathname)==null?void 0:a.substring(i?5:4))!=null?B:"",o=i?"cas":"ac";if(t.method=="PUT"){this.n_put+=1;let C=Number(t.headers["content-length"]),c=!1;try{c=yield this.actionsCache.putCache(o,n,C,t)}catch(h){}c?(this.n_put_succ+=1,this.n_put_bytes+=C,r.writeHead(200)):r.writeHead(500),r.end()}else if(t.method=="GET"){this.n_get+=1;let C=null;try{C=yield this.actionsCache.getCache(o,n)}catch(c){}C?(this.n_get_hit+=1,r.writeHead(200,{"Content-Type":"application/octet-stream"}),C.pipe(r)):(r.writeHead(404),r.end())}})}onRequest(t,r){return f(this,null,function*(){var i,n,o,g;let s=(0,mu.parse)((i=t.url)!=null?i:"");s.pathname=="/close"?this.get_close(t,r):(n=s.pathname)!=null&&n.startsWith("/_apis/artifactcache/")?(r.writeHead(404),r.end()):(o=s.pathname)!=null&&o.startsWith("/cas/")||(g=s.pathname)!=null&&g.startsWith("/ac/")?this.get_cas(t,r):(r.writeHead(404),r.end())})}};rt.HttpServer=qQ});var Um=exports&&exports.__createBinding||(Object.create?function(A,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,r,s)}:function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]}),Lm=exports&&exports.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),Mm=exports&&exports.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.prototype.hasOwnProperty.call(A,t)&&Um(e,A,t);return Lm(e,A),e};Object.defineProperty(exports,"__esModule",{value:!0});var Ym=require("child_process"),xm=Mm(FQ()),Jm=bu(),Gm=Su(),Tm=[];function Hm(A){xm.debug(A),Tm.push(A)}process.env.IS_BACKGROUND?vm():(console.log("spawning"),Hm("foreground"),(0,Ym.spawn)(process.execPath,process.argv.slice(1),{detached:!0,stdio:"inherit",env:x(y({},process.env),{IS_BACKGROUND:"1"})}).unref());function vm(){var i;let e=`${process.env.ACTIONS_CACHE_URL||"http://localhost:3056/"}_apis/artifactcache/`,t=(i=process.env.ACTIONS_RUNTIME_TOKEN)!=null?i:"",r=new Jm.ActionsCache(e,t),s=new Gm.HttpServer(r);s.on("close",()=>{console.log("Goodbye: "+JSON.stringify(s.getStats()))}),s.listen(3055)} /*! Bundled license information: undici/lib/fetch/body.js: diff --git a/src/HttpServer.ts b/src/HttpServer.ts index e03429b..4a576c3 100644 --- a/src/HttpServer.ts +++ b/src/HttpServer.ts @@ -16,7 +16,7 @@ export class HttpServer extends http.Server { this.on('request', this.onRequest) } - getStats() { + getStats(): any { return { "n_get": this.n_get, "n_get_hit": this.n_get_hit, @@ -31,7 +31,10 @@ export class HttpServer extends http.Server { response.writeHead(200, { "Content-type": "application/json" }) - response.end(JSON.stringify(this.actionsCache.scopes)) + const stats = this.getStats() + stats["scopes"] = Object.fromEntries(this.actionsCache.scopes) + + response.end(JSON.stringify(stats)) } async get_cas(request: http.IncomingMessage, response: http.ServerResponse) {