From 5e474f6fc966c13cb78fbee33ef5e096c42f0cbc Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2024 19:36:56 +0000 Subject: [PATCH] [autofix.ci] apply automated fixes --- dist/setup/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index f3401f19..41e9dd41 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -45,7 +45,7 @@ ${o}:${decodeURIComponent(n[o])}`}return i}},Ve=class extends ks{constructor(e,a `);let o=e.computeHMACSHA256(s);return new La(a,o,i.toString(),r,n,t.protocol,t.startsOn,t.expiresOn,t.ipRange,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,t.encryptionScope)}var Xu=class t extends Fs{constructor(e,a,i){let r;Fi(a)?r=a:M.isNode&&a instanceof Ve||a instanceof Te||M.isTokenCredential(a)?r=Oe(a,i):r=Oe(new Te,i),super(e,r),this.serviceContext=new zd(this.storageClientContext)}static fromConnectionString(e,a){a=a||{};let i=En(e);if(i.kind==="AccountConnString")if(M.isNode){let r=new Ve(i.accountName,i.accountKey);a.proxyOptions||(a.proxyOptions=M.getDefaultProxySettings(i.proxyUri));let n=Oe(r,a);return new t(i.url,n)}else throw new Error("Account connection string is only supported in Node.js environment");else if(i.kind==="SASConnString"){let r=Oe(new Te,a);return new t(i.url+"?"+i.accountSas,r)}else throw new Error("Connection string must be either an Account connection string or a SAS connection string")}getContainerClient(e){return new Vd(ze(this.url,encodeURIComponent(e)),this.pipeline)}async createContainer(e,a={}){let{span:i,updatedOptions:r}=L("BlobServiceClient-createContainer",a);try{let n=this.getContainerClient(e),s=await n.create(r);return{containerClient:n,containerCreateResponse:s}}catch(n){throw i.setStatus({code:q.SpanStatusCode.ERROR,message:n.message}),n}finally{i.end()}}async deleteContainer(e,a={}){let{span:i,updatedOptions:r}=L("BlobServiceClient-deleteContainer",a);try{return await this.getContainerClient(e).delete(r)}catch(n){throw i.setStatus({code:q.SpanStatusCode.ERROR,message:n.message}),n}finally{i.end()}}async undeleteContainer(e,a,i={}){let{span:r,updatedOptions:n}=L("BlobServiceClient-undeleteContainer",i);try{let s=this.getContainerClient(i.destinationContainerName||e),p=await new gr(s.storageClientContext).restore(Object.assign({deletedContainerName:e,deletedContainerVersion:a},n));return{containerClient:s,containerUndeleteResponse:p}}catch(s){throw r.setStatus({code:q.SpanStatusCode.ERROR,message:s.message}),s}finally{r.end()}}async renameContainer(e,a,i={}){var r;let{span:n,updatedOptions:s}=L("BlobServiceClient-renameContainer",i);try{let o=this.getContainerClient(a),d=await new gr(o.storageClientContext).rename(e,Object.assign(Object.assign({},s),{sourceLeaseId:(r=i.sourceCondition)===null||r===void 0?void 0:r.leaseId}));return{containerClient:o,containerRenameResponse:d}}catch(o){throw n.setStatus({code:q.SpanStatusCode.ERROR,message:o.message}),o}finally{n.end()}}async getProperties(e={}){let{span:a,updatedOptions:i}=L("BlobServiceClient-getProperties",e);try{return await this.serviceContext.getProperties(Object.assign({abortSignal:e.abortSignal},G(i)))}catch(r){throw a.setStatus({code:q.SpanStatusCode.ERROR,message:r.message}),r}finally{a.end()}}async setProperties(e,a={}){let{span:i,updatedOptions:r}=L("BlobServiceClient-setProperties",a);try{return await this.serviceContext.setProperties(e,Object.assign({abortSignal:a.abortSignal},G(r)))}catch(n){throw i.setStatus({code:q.SpanStatusCode.ERROR,message:n.message}),n}finally{i.end()}}async getStatistics(e={}){let{span:a,updatedOptions:i}=L("BlobServiceClient-getStatistics",e);try{return await this.serviceContext.getStatistics(Object.assign({abortSignal:e.abortSignal},G(i)))}catch(r){throw a.setStatus({code:q.SpanStatusCode.ERROR,message:r.message}),r}finally{a.end()}}async getAccountInfo(e={}){let{span:a,updatedOptions:i}=L("BlobServiceClient-getAccountInfo",e);try{return await this.serviceContext.getAccountInfo(Object.assign({abortSignal:e.abortSignal},G(i)))}catch(r){throw a.setStatus({code:q.SpanStatusCode.ERROR,message:r.message}),r}finally{a.end()}}async listContainersSegment(e,a={}){let{span:i,updatedOptions:r}=L("BlobServiceClient-listContainersSegment",a);try{return await this.serviceContext.listContainersSegment(Object.assign(Object.assign(Object.assign({abortSignal:a.abortSignal,marker:e},a),{include:typeof a.include=="string"?[a.include]:a.include}),G(r)))}catch(n){throw i.setStatus({code:q.SpanStatusCode.ERROR,message:n.message}),n}finally{i.end()}}async findBlobsByTagsSegment(e,a,i={}){let{span:r,updatedOptions:n}=L("BlobServiceClient-findBlobsByTagsSegment",i);try{let s=await this.serviceContext.filterBlobs(Object.assign({abortSignal:i.abortSignal,where:e,marker:a,maxPageSize:i.maxPageSize},G(n)));return Object.assign(Object.assign({},s),{_response:s._response,blobs:s.blobs.map(p=>{var d;let l="";return((d=p.tags)===null||d===void 0?void 0:d.blobTagSet.length)===1&&(l=p.tags.blobTagSet[0].value),Object.assign(Object.assign({},p),{tags:As(p.tags),tagValue:l})})})}catch(s){throw r.setStatus({code:q.SpanStatusCode.ERROR,message:s.message}),s}finally{r.end()}}findBlobsByTagsSegments(e,a,i={}){return k.__asyncGenerator(this,arguments,function*(){let n;if(a||a===void 0)do n=yield k.__await(this.findBlobsByTagsSegment(e,a,i)),n.blobs=n.blobs||[],a=n.continuationToken,yield yield k.__await(n);while(a)})}findBlobsByTagsItems(e,a={}){return k.__asyncGenerator(this,arguments,function*(){var r,n;let s;try{for(var o=k.__asyncValues(this.findBlobsByTagsSegments(e,s,a)),p;p=yield k.__await(o.next()),!p.done;){let d=p.value;yield k.__await(yield*k.__asyncDelegator(k.__asyncValues(d.blobs)))}}catch(d){r={error:d}}finally{try{p&&!p.done&&(n=o.return)&&(yield k.__await(n.call(o)))}finally{if(r)throw r.error}}})}findBlobsByTags(e,a={}){let i=Object.assign({},a),r=this.findBlobsByTagsItems(e,i);return{next(){return r.next()},[Symbol.asyncIterator](){return this},byPage:(n={})=>this.findBlobsByTagsSegments(e,n.continuationToken,Object.assign({maxPageSize:n.maxPageSize},i))}}listSegments(e,a={}){return k.__asyncGenerator(this,arguments,function*(){let r;if(e||e===void 0)do r=yield k.__await(this.listContainersSegment(e,a)),r.containerItems=r.containerItems||[],e=r.continuationToken,yield yield k.__await(yield k.__await(r));while(e)})}listItems(e={}){return k.__asyncGenerator(this,arguments,function*(){var i,r;let n;try{for(var s=k.__asyncValues(this.listSegments(n,e)),o;o=yield k.__await(s.next()),!o.done;){let p=o.value;yield k.__await(yield*k.__asyncDelegator(k.__asyncValues(p.containerItems)))}}catch(p){i={error:p}}finally{try{o&&!o.done&&(r=s.return)&&(yield k.__await(r.call(s)))}finally{if(i)throw i.error}}})}listContainers(e={}){e.prefix===""&&(e.prefix=void 0);let a=[];e.includeDeleted&&a.push("deleted"),e.includeMetadata&&a.push("metadata"),e.includeSystem&&a.push("system");let i=Object.assign(Object.assign({},e),a.length>0?{include:a}:{}),r=this.listItems(i);return{next(){return r.next()},[Symbol.asyncIterator](){return this},byPage:(n={})=>this.listSegments(n.continuationToken,Object.assign({maxPageSize:n.maxPageSize},i))}}async getUserDelegationKey(e,a,i={}){let{span:r,updatedOptions:n}=L("BlobServiceClient-getUserDelegationKey",i);try{let s=await this.serviceContext.getUserDelegationKey({startsOn:Ne(e,!1),expiresOn:Ne(a,!1)},Object.assign({abortSignal:i.abortSignal},G(n))),o={signedObjectId:s.signedObjectId,signedTenantId:s.signedTenantId,signedStartsOn:new Date(s.signedStartsOn),signedExpiresOn:new Date(s.signedExpiresOn),signedService:s.signedService,signedVersion:s.signedVersion,value:s.value};return Object.assign({_response:s._response,requestId:s.requestId,clientRequestId:s.clientRequestId,version:s.version,date:s.date,errorCode:s.errorCode},o)}catch(s){throw r.setStatus({code:q.SpanStatusCode.ERROR,message:s.message}),s}finally{r.end()}}getBlobBatchClient(){return new Ws(this.url,this.pipeline)}generateAccountSasUrl(e,a=Ks.parse("r"),i="sco",r={}){if(!(this.credential instanceof Ve))throw RangeError("Can only generate the account SAS when the client is initialized with a shared key credential");if(e===void 0){let s=new Date;e=new Date(s.getTime()+3600*1e3)}let n=dv(Object.assign({permissions:a,expiresOn:e,resourceTypes:i,services:Qs.parse("b").toString()},r),this.credential).toString();return f0(this.url,n)}};Y.KnownEncryptionAlgorithmType=void 0;(function(t){t.AES256="AES256"})(Y.KnownEncryptionAlgorithmType||(Y.KnownEncryptionAlgorithmType={}));Object.defineProperty(Y,"BaseRequestPolicy",{enumerable:!0,get:function(){return M.BaseRequestPolicy}});Object.defineProperty(Y,"HttpHeaders",{enumerable:!0,get:function(){return M.HttpHeaders}});Object.defineProperty(Y,"RequestPolicyOptions",{enumerable:!0,get:function(){return M.RequestPolicyOptions}});Object.defineProperty(Y,"RestError",{enumerable:!0,get:function(){return M.RestError}});Object.defineProperty(Y,"WebResource",{enumerable:!0,get:function(){return M.WebResource}});Object.defineProperty(Y,"deserializationPolicy",{enumerable:!0,get:function(){return M.deserializationPolicy}});Y.AccountSASPermissions=Ks;Y.AccountSASResourceTypes=$d;Y.AccountSASServices=Qs;Y.AnonymousCredential=Te;Y.AnonymousCredentialPolicy=Hd;Y.AppendBlobClient=$s;Y.BlobBatch=pn;Y.BlobBatchClient=Ws;Y.BlobClient=ba;Y.BlobLeaseClient=Vs;Y.BlobSASPermissions=ii;Y.BlobServiceClient=Xu;Y.BlockBlobClient=Gs;Y.ContainerClient=Vd;Y.ContainerSASPermissions=ri;Y.Credential=ks;Y.CredentialPolicy=js;Y.PageBlobClient=Xs;Y.Pipeline=Hs;Y.SASQueryParameters=La;Y.StorageBrowserPolicy=qd;Y.StorageBrowserPolicyFactory=Ld;Y.StorageOAuthScopes=m0;Y.StorageRetryPolicy=jd;Y.StorageRetryPolicyFactory=kd;Y.StorageSharedKeyCredential=Ve;Y.StorageSharedKeyCredentialPolicy=Ud;Y.generateAccountSASQueryParameters=dv;Y.generateBlobSASQueryParameters=g0;Y.isPipelineLike=Fi;Y.logger=xa;Y.newPipeline=Oe});var v0=T($e=>{"use strict";var QB=$e&&$e.__createBinding||(Object.create?function(t,e,a,i){i===void 0&&(i=a);var r=Object.getOwnPropertyDescriptor(e,a);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[a]}}),Object.defineProperty(t,i,r)}:function(t,e,a,i){i===void 0&&(i=a),t[i]=e[a]}),YB=$e&&$e.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ZB=$e&&$e.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var a in t)a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)&&QB(e,t,a);return YB(e,t),e},el=$e&&$e.__awaiter||function(t,e,a,i){function r(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function o(l){try{d(i.next(l))}catch(c){s(c)}}function p(l){try{d(i.throw(l))}catch(c){s(c)}}function d(l){l.done?n(l.value):r(l.value).then(o,p)}d((i=i.apply(t,e||[])).next())})};Object.defineProperty($e,"__esModule",{value:!0});$e.retryHttpClientResponse=$e.retryTypedResponse=$e.retry=$e.isRetryableStatusCode=$e.isServerErrorStatusCode=$e.isSuccessStatusCode=void 0;var cv=ZB(nt()),Jd=Or(),Pn=Jn();function JB(t){return t?t>=200&&t<300:!1}$e.isSuccessStatusCode=JB;function mv(t){return t?t>=500:!0}$e.isServerErrorStatusCode=mv;function uv(t){return t?[Jd.HttpCodes.BadGateway,Jd.HttpCodes.ServiceUnavailable,Jd.HttpCodes.GatewayTimeout].includes(t):!1}$e.isRetryableStatusCode=uv;function eA(t){return el(this,void 0,void 0,function*(){return new Promise(e=>setTimeout(e,t))})}function y0(t,e,a,i=Pn.DefaultRetryAttempts,r=Pn.DefaultRetryDelay,n=void 0){return el(this,void 0,void 0,function*(){let s="",o=1;for(;o<=i;){let p,d,l=!1;try{p=yield e()}catch(c){n&&(p=n(c)),l=!0,s=c.message}if(p&&(d=a(p),!mv(d)))return p;if(d&&(l=uv(d),s=`Cache service responded with ${d}`),cv.debug(`${t} - Attempt ${o} of ${i} failed with error: ${s}`),!l){cv.debug(`${t} - Error is not retryable`);break}yield eA(r),o++}throw Error(`${t} failed: ${s}`)})}$e.retry=y0;function tA(t,e,a=Pn.DefaultRetryAttempts,i=Pn.DefaultRetryDelay){return el(this,void 0,void 0,function*(){return yield y0(t,e,r=>r.statusCode,a,i,r=>{if(r instanceof Jd.HttpClientError)return{statusCode:r.statusCode,result:null,headers:{},error:r}})})}$e.retryTypedResponse=tA;function aA(t,e,a=Pn.DefaultRetryAttempts,i=Pn.DefaultRetryDelay){return el(this,void 0,void 0,function*(){return yield y0(t,e,r=>r.message.statusCode,a,i)})}$e.retryHttpClientResponse=aA});var vv=T(ft=>{"use strict";var iA=ft&&ft.__createBinding||(Object.create?function(t,e,a,i){i===void 0&&(i=a);var r=Object.getOwnPropertyDescriptor(e,a);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[a]}}),Object.defineProperty(t,i,r)}:function(t,e,a,i){i===void 0&&(i=a),t[i]=e[a]}),rA=ft&&ft.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),On=ft&&ft.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var a in t)a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)&&iA(e,t,a);return rA(e,t),e},sa=ft&&ft.__awaiter||function(t,e,a,i){function r(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function o(l){try{d(i.next(l))}catch(c){s(c)}}function p(l){try{d(i.throw(l))}catch(c){s(c)}}function d(l){l.done?n(l.value):r(l.value).then(o,p)}d((i=i.apply(t,e||[])).next())})};Object.defineProperty(ft,"__esModule",{value:!0});ft.downloadCacheStorageSDK=ft.downloadCacheHttpClientConcurrent=ft.downloadCacheHttpClient=ft.DownloadProgress=void 0;var to=On(nt()),hv=Or(),nA=lv(),sA=On(require("buffer")),eo=On(require("fs")),oA=On(require("stream")),pA=On(require("util")),dA=On(ts()),fv=Jn(),x0=v0(),lA=kr();function cA(t,e){return sa(this,void 0,void 0,function*(){yield pA.promisify(oA.pipeline)(t.message,e)})}var ao=class{constructor(e){this.contentLength=e,this.segmentIndex=0,this.segmentSize=0,this.segmentOffset=0,this.receivedBytes=0,this.displayedComplete=!1,this.startTime=Date.now()}nextSegment(e){this.segmentOffset=this.segmentOffset+this.segmentSize,this.segmentIndex=this.segmentIndex+1,this.segmentSize=e,this.receivedBytes=0,to.debug(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`)}setReceivedBytes(e){this.receivedBytes=e}getTransferredBytes(){return this.segmentOffset+this.receivedBytes}isDone(){return this.getTransferredBytes()===this.contentLength}display(){if(this.displayedComplete)return;let e=this.segmentOffset+this.receivedBytes,a=(100*(e/this.contentLength)).toFixed(1),i=Date.now()-this.startTime,r=(e/(1024*1024)/(i/1e3)).toFixed(1);to.info(`Received ${e} of ${this.contentLength} (${a}%), ${r} MBs/sec`),this.isDone()&&(this.displayedComplete=!0)}onProgress(){return e=>{this.setReceivedBytes(e.loadedBytes)}}startDisplayTimer(e=1e3){let a=()=>{this.display(),this.isDone()||(this.timeoutHandle=setTimeout(a,e))};this.timeoutHandle=setTimeout(a,e)}stopDisplayTimer(){this.timeoutHandle&&(clearTimeout(this.timeoutHandle),this.timeoutHandle=void 0),this.display()}};ft.DownloadProgress=ao;function gv(t,e){return sa(this,void 0,void 0,function*(){let a=eo.createWriteStream(e),i=new hv.HttpClient("actions/cache"),r=yield(0,x0.retryHttpClientResponse)("downloadCache",()=>sa(this,void 0,void 0,function*(){return i.get(t)}));r.message.socket.setTimeout(fv.SocketTimeout,()=>{r.message.destroy(),to.debug(`Aborting download, socket timed out after ${fv.SocketTimeout} ms`)}),yield cA(r,a);let n=r.message.headers["content-length"];if(n){let s=parseInt(n),o=dA.getArchiveFileSizeInBytes(e);if(o!==s)throw new Error(`Incomplete download. Expected file size: ${s}, actual file size: ${o}`)}else to.debug("Unable to validate download, no Content-Length header")})}ft.downloadCacheHttpClient=gv;function mA(t,e,a){var i;return sa(this,void 0,void 0,function*(){let r=yield eo.promises.open(e,"w"),n=new hv.HttpClient("actions/cache",void 0,{socketTimeout:a.timeoutInMs,keepAlive:!0});try{let o=(yield(0,x0.retryHttpClientResponse)("downloadCacheMetadata",()=>sa(this,void 0,void 0,function*(){return yield n.request("HEAD",t,null,{})}))).message.headers["content-length"];if(o==null)throw new Error("Content-Length not found on blob response");let p=parseInt(o);if(Number.isNaN(p))throw new Error(`Could not interpret Content-Length: ${p}`);let d=[],l=4*1024*1024;for(let R=0;Rsa(this,void 0,void 0,function*(){return yield uA(n,t,R,b)})})}d.reverse();let c=0,m=0,u=new ao(p);u.startDisplayTimer();let h=u.onProgress(),v=[],E,S=()=>sa(this,void 0,void 0,function*(){let R=yield Promise.race(Object.values(v));yield r.write(R.buffer,0,R.count,R.offset),c--,delete v[R.offset],m+=R.count,h({loadedBytes:m})});for(;E=d.pop();)v[E.offset]=E.promiseGetter(),c++,c>=((i=a.downloadConcurrency)!==null&&i!==void 0?i:10)&&(yield S());for(;c>0;)yield S()}finally{n.dispose(),yield r.close()}})}ft.downloadCacheHttpClientConcurrent=mA;function uA(t,e,a,i){return sa(this,void 0,void 0,function*(){let n=0;for(;;)try{let o=yield yv(3e4,fA(t,e,a,i));if(typeof o=="string")throw new Error("downloadSegmentRetry failed due to timeout");return o}catch(s){if(n>=5)throw s;n++}})}function fA(t,e,a,i){return sa(this,void 0,void 0,function*(){let r=yield(0,x0.retryHttpClientResponse)("downloadCachePart",()=>sa(this,void 0,void 0,function*(){return yield t.get(e,{Range:`bytes=${a}-${a+i-1}`})}));if(!r.readBodyBuffer)throw new Error("Expected HttpClientResponse to implement readBodyBuffer");return{offset:a,count:i,buffer:yield r.readBodyBuffer()}})}function hA(t,e,a){var i;return sa(this,void 0,void 0,function*(){let r=new nA.BlockBlobClient(t,void 0,{retryOptions:{tryTimeoutInMs:a.timeoutInMs}}),s=(i=(yield r.getProperties()).contentLength)!==null&&i!==void 0?i:-1;if(s<0)to.debug("Unable to determine content length, downloading file with http-client..."),yield gv(t,e);else{let o=Math.min(134217728,sA.constants.MAX_LENGTH),p=new ao(s),d=eo.openSync(e,"w");try{p.startDisplayTimer();let l=new lA.AbortController,c=l.signal;for(;!p.isDone();){let m=p.segmentOffset+p.segmentSize,u=Math.min(o,s-m);p.nextSegment(u);let h=yield yv(a.segmentTimeoutInMs||36e5,r.downloadToBuffer(m,u,{abortSignal:c,concurrency:a.downloadConcurrency,onProgress:p.onProgress()}));if(h==="timeout")throw l.abort(),new Error("Aborting cache download as the download time exceeded the timeout.");Buffer.isBuffer(h)&&eo.writeFileSync(d,h)}}finally{p.stopDisplayTimer(),eo.closeSync(d)}}})}ft.downloadCacheStorageSDK=hA;var yv=(t,e)=>sa(void 0,void 0,void 0,function*(){let a,i=new Promise(r=>{a=setTimeout(()=>r("timeout"),t)});return Promise.race([e,i]).then(r=>(clearTimeout(a),r))})});var xv=T(oa=>{"use strict";var gA=oa&&oa.__createBinding||(Object.create?function(t,e,a,i){i===void 0&&(i=a);var r=Object.getOwnPropertyDescriptor(e,a);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[a]}}),Object.defineProperty(t,i,r)}:function(t,e,a,i){i===void 0&&(i=a),t[i]=e[a]}),yA=oa&&oa.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),vA=oa&&oa.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var a in t)a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)&&gA(e,t,a);return yA(e,t),e};Object.defineProperty(oa,"__esModule",{value:!0});oa.getDownloadOptions=oa.getUploadOptions=void 0;var Vi=vA(nt());function xA(t){let e={uploadConcurrency:4,uploadChunkSize:33554432};return t&&(typeof t.uploadConcurrency=="number"&&(e.uploadConcurrency=t.uploadConcurrency),typeof t.uploadChunkSize=="number"&&(e.uploadChunkSize=t.uploadChunkSize)),Vi.debug(`Upload concurrency: ${e.uploadConcurrency}`),Vi.debug(`Upload chunk size: ${e.uploadChunkSize}`),e}oa.getUploadOptions=xA;function bA(t){let e={useAzureSdk:!1,concurrentBlobDownloads:!0,downloadConcurrency:8,timeoutInMs:3e4,segmentTimeoutInMs:6e5,lookupOnly:!1};t&&(typeof t.useAzureSdk=="boolean"&&(e.useAzureSdk=t.useAzureSdk),typeof t.concurrentBlobDownloads=="boolean"&&(e.concurrentBlobDownloads=t.concurrentBlobDownloads),typeof t.downloadConcurrency=="number"&&(e.downloadConcurrency=t.downloadConcurrency),typeof t.timeoutInMs=="number"&&(e.timeoutInMs=t.timeoutInMs),typeof t.segmentTimeoutInMs=="number"&&(e.segmentTimeoutInMs=t.segmentTimeoutInMs),typeof t.lookupOnly=="boolean"&&(e.lookupOnly=t.lookupOnly));let a=process.env.SEGMENT_DOWNLOAD_TIMEOUT_MINS;return a&&!isNaN(Number(a))&&isFinite(Number(a))&&(e.segmentTimeoutInMs=Number(a)*60*1e3),Vi.debug(`Use Azure SDK: ${e.useAzureSdk}`),Vi.debug(`Download concurrency: ${e.downloadConcurrency}`),Vi.debug(`Request timeout (ms): ${e.timeoutInMs}`),Vi.debug(`Cache segment download timeout mins env var: ${process.env.SEGMENT_DOWNLOAD_TIMEOUT_MINS}`),Vi.debug(`Segment download timeout (ms): ${e.segmentTimeoutInMs}`),Vi.debug(`Lookup only: ${e.lookupOnly}`),e}oa.getDownloadOptions=bA});var Nv=T(Qe=>{"use strict";var wA=Qe&&Qe.__createBinding||(Object.create?function(t,e,a,i){i===void 0&&(i=a);var r=Object.getOwnPropertyDescriptor(e,a);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[a]}}),Object.defineProperty(t,i,r)}:function(t,e,a,i){i===void 0&&(i=a),t[i]=e[a]}),NA=Qe&&Qe.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),il=Qe&&Qe.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var a in t)a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)&&wA(e,t,a);return NA(e,t),e},Ht=Qe&&Qe.__awaiter||function(t,e,a,i){function r(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function o(l){try{d(i.next(l))}catch(c){s(c)}}function p(l){try{d(i.throw(l))}catch(c){s(c)}}function d(l){l.done?n(l.value):r(l.value).then(o,p)}d((i=i.apply(t,e||[])).next())})};Object.defineProperty(Qe,"__esModule",{value:!0});Qe.saveCache=Qe.reserveCache=Qe.downloadCache=Qe.getCacheEntry=Qe.getCacheVersion=void 0;var Wt=il(nt()),_A=Or(),SA=Il(),EA=il(require("crypto")),b0=il(require("fs")),CA=require("url"),al=il(ts()),tl=vv(),wv=xv(),$i=v0(),TA="1.0";function io(t){let e=process.env.ACTIONS_CACHE_URL||"";if(!e)throw new Error("Cache Service Url not found, unable to restore cache.");let a=`${e}_apis/artifactcache/${t}`;return Wt.debug(`Resource Url: ${a}`),a}function PA(t,e){return`${t};api-version=${e}`}function OA(){return{headers:{Accept:PA("application/json","6.0-preview.1")}}}function w0(){let t=process.env.ACTIONS_RUNTIME_TOKEN||"",e=new SA.BearerCredentialHandler(t);return new _A.HttpClient("actions/cache",[e],OA())}function N0(t,e,a=!1){let i=t;return e&&i.push(e),process.platform==="win32"&&!a&&i.push("windows-only"),i.push(TA),EA.createHash("sha256").update(i.join("|")).digest("hex")}Qe.getCacheVersion=N0;function RA(t,e,a){return Ht(this,void 0,void 0,function*(){let i=w0(),r=N0(e,a?.compressionMethod,a?.enableCrossOsArchive),n=`cache?keys=${encodeURIComponent(t.join(","))}&version=${r}`,s=yield(0,$i.retryTypedResponse)("getCacheEntry",()=>Ht(this,void 0,void 0,function*(){return i.getJson(io(n))}));if(s.statusCode===204)return Wt.isDebug()&&(yield DA(t[0],i,r)),null;if(!(0,$i.isSuccessStatusCode)(s.statusCode))throw new Error(`Cache service responded with ${s.statusCode}`);let o=s.result,p=o?.archiveLocation;if(!p)throw new Error("Cache not found.");return Wt.setSecret(p),Wt.debug("Cache Result:"),Wt.debug(JSON.stringify(o)),o})}Qe.getCacheEntry=RA;function DA(t,e,a){return Ht(this,void 0,void 0,function*(){let i=`caches?key=${encodeURIComponent(t)}`,r=yield(0,$i.retryTypedResponse)("listCache",()=>Ht(this,void 0,void 0,function*(){return e.getJson(io(i))}));if(r.statusCode===200){let n=r.result,s=n?.totalCount;if(s&&s>0){Wt.debug(`No matching cache found for cache key '${t}', version '${a} and scope ${process.env.GITHUB_REF}. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key Other caches with similar key:`);for(let o of n?.artifactCaches||[])Wt.debug(`Cache Key: ${o?.cacheKey}, Cache Version: ${o?.cacheVersion}, Cache Scope: ${o?.scope}, Cache Created: ${o?.creationTime}`)}}})}function IA(t,e,a){return Ht(this,void 0,void 0,function*(){let i=new CA.URL(t),r=(0,wv.getDownloadOptions)(a);i.hostname.endsWith(".blob.core.windows.net")?r.useAzureSdk?yield(0,tl.downloadCacheStorageSDK)(t,e,r):r.concurrentBlobDownloads?yield(0,tl.downloadCacheHttpClientConcurrent)(t,e,r):yield(0,tl.downloadCacheHttpClient)(t,e):yield(0,tl.downloadCacheHttpClient)(t,e)})}Qe.downloadCache=IA;function BA(t,e,a){return Ht(this,void 0,void 0,function*(){let i=w0(),r=N0(e,a?.compressionMethod,a?.enableCrossOsArchive),n={key:t,version:r,cacheSize:a?.cacheSize};return yield(0,$i.retryTypedResponse)("reserveCache",()=>Ht(this,void 0,void 0,function*(){return i.postJson(io("caches"),n)}))})}Qe.reserveCache=BA;function bv(t,e){return`bytes ${t}-${e}/*`}function AA(t,e,a,i,r){return Ht(this,void 0,void 0,function*(){Wt.debug(`Uploading chunk of size ${r-i+1} bytes at offset ${i} with content range: ${bv(i,r)}`);let n={"Content-Type":"application/octet-stream","Content-Range":bv(i,r)},s=yield(0,$i.retryHttpClientResponse)(`uploadChunk (start: ${i}, end: ${r})`,()=>Ht(this,void 0,void 0,function*(){return t.sendStream("PATCH",e,a(),n)}));if(!(0,$i.isSuccessStatusCode)(s.message.statusCode))throw new Error(`Cache service responded with ${s.message.statusCode} during upload chunk.`)})}function zA(t,e,a,i){return Ht(this,void 0,void 0,function*(){let r=al.getArchiveFileSizeInBytes(a),n=io(`caches/${e.toString()}`),s=b0.openSync(a,"r"),o=(0,wv.getUploadOptions)(i),p=al.assertDefined("uploadConcurrency",o.uploadConcurrency),d=al.assertDefined("uploadChunkSize",o.uploadChunkSize),l=[...new Array(p).keys()];Wt.debug("Awaiting all uploads");let c=0;try{yield Promise.all(l.map(()=>Ht(this,void 0,void 0,function*(){for(;cb0.createReadStream(a,{fd:s,start:u,end:h,autoClose:!1}).on("error",v=>{throw new Error(`Cache upload failed because file read failed with ${v.message}`)}),u,h)}})))}finally{b0.closeSync(s)}})}function MA(t,e,a){return Ht(this,void 0,void 0,function*(){let i={size:a};return yield(0,$i.retryTypedResponse)("commitCache",()=>Ht(this,void 0,void 0,function*(){return t.postJson(io(`caches/${e.toString()}`),i)}))})}function qA(t,e,a){return Ht(this,void 0,void 0,function*(){let i=w0();Wt.debug("Upload cache"),yield zA(i,t,e,a),Wt.debug("Commiting cache");let r=al.getArchiveFileSizeInBytes(e);Wt.info(`Cache Size: ~${Math.round(r/(1024*1024))} MB (${r} B)`);let n=yield MA(i,t,r);if(!(0,$i.isSuccessStatusCode)(n.statusCode))throw new Error(`Cache service responded with ${n.statusCode} during commit cache.`);Wt.info("Cache saved successfully")})}Qe.saveCache=qA});var Ev=T(_t=>{"use strict";var LA=_t&&_t.__createBinding||(Object.create?function(t,e,a,i){i===void 0&&(i=a);var r=Object.getOwnPropertyDescriptor(e,a);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[a]}}),Object.defineProperty(t,i,r)}:function(t,e,a,i){i===void 0&&(i=a),t[i]=e[a]}),jA=_t&&_t.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),_0=_t&&_t.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var a in t)a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)&&LA(e,t,a);return jA(e,t),e},pi=_t&&_t.__awaiter||function(t,e,a,i){function r(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function o(l){try{d(i.next(l))}catch(c){s(c)}}function p(l){try{d(i.throw(l))}catch(c){s(c)}}function d(l){l.done?n(l.value):r(l.value).then(o,p)}d((i=i.apply(t,e||[])).next())})};Object.defineProperty(_t,"__esModule",{value:!0});_t.createTar=_t.extractTar=_t.listTar=void 0;var kA=kn(),rl=_0(jn()),_v=require("fs"),Na=_0(require("path")),S0=_0(ts()),Ie=Jn(),Gi=process.platform==="win32";function HA(){return pi(this,void 0,void 0,function*(){switch(process.platform){case"win32":{let t=yield S0.getGnuTarPathOnWindows(),e=Ie.SystemTarPathOnWindows;if(t)return{path:t,type:Ie.ArchiveToolType.GNU};if((0,_v.existsSync)(e))return{path:e,type:Ie.ArchiveToolType.BSD};break}case"darwin":{let t=yield rl.which("gtar",!1);return t?{path:t,type:Ie.ArchiveToolType.GNU}:{path:yield rl.which("tar",!0),type:Ie.ArchiveToolType.BSD}}default:break}return{path:yield rl.which("tar",!0),type:Ie.ArchiveToolType.GNU}})}function UA(t,e,a,i=""){return pi(this,void 0,void 0,function*(){let r=[`"${t.path}"`],n=S0.getCacheFileName(e),s="cache.tar",o=Sv(),p=t.type===Ie.ArchiveToolType.BSD&&e!==Ie.CompressionMethod.Gzip&&Gi;switch(a){case"create":r.push("--posix","-cf",p?s:n.replace(new RegExp(`\\${Na.sep}`,"g"),"/"),"--exclude",p?s:n.replace(new RegExp(`\\${Na.sep}`,"g"),"/"),"-P","-C",o.replace(new RegExp(`\\${Na.sep}`,"g"),"/"),"--files-from",Ie.ManifestFilename);break;case"extract":r.push("-xf",p?s:i.replace(new RegExp(`\\${Na.sep}`,"g"),"/"),"-P","-C",o.replace(new RegExp(`\\${Na.sep}`,"g"),"/"));break;case"list":r.push("-tf",p?s:i.replace(new RegExp(`\\${Na.sep}`,"g"),"/"),"-P");break}if(t.type===Ie.ArchiveToolType.GNU)switch(process.platform){case"win32":r.push("--force-local");break;case"darwin":r.push("--delay-directory-restore");break}return r})}function E0(t,e,a=""){return pi(this,void 0,void 0,function*(){let i,r=yield HA(),n=yield UA(r,t,e,a),s=e!=="create"?yield FA(r,t,a):yield VA(r,t),o=r.type===Ie.ArchiveToolType.BSD&&t!==Ie.CompressionMethod.Gzip&&Gi;return o&&e!=="create"?i=[[...s].join(" "),[...n].join(" ")]:i=[[...n].join(" "),[...s].join(" ")],o?i:[i.join(" ")]})}function Sv(){var t;return(t=process.env.GITHUB_WORKSPACE)!==null&&t!==void 0?t:process.cwd()}function FA(t,e,a){return pi(this,void 0,void 0,function*(){let i=t.type===Ie.ArchiveToolType.BSD&&e!==Ie.CompressionMethod.Gzip&&Gi;switch(e){case Ie.CompressionMethod.Zstd:return i?["zstd -d --long=30 --force -o",Ie.TarFilename,a.replace(new RegExp(`\\${Na.sep}`,"g"),"/")]:["--use-compress-program",Gi?'"zstd -d --long=30"':"unzstd --long=30"];case Ie.CompressionMethod.ZstdWithoutLong:return i?["zstd -d --force -o",Ie.TarFilename,a.replace(new RegExp(`\\${Na.sep}`,"g"),"/")]:["--use-compress-program",Gi?'"zstd -d"':"unzstd"];default:return["-z"]}})}function VA(t,e){return pi(this,void 0,void 0,function*(){let a=S0.getCacheFileName(e),i=t.type===Ie.ArchiveToolType.BSD&&e!==Ie.CompressionMethod.Gzip&&Gi;switch(e){case Ie.CompressionMethod.Zstd:return i?["zstd -T0 --long=30 --force -o",a.replace(new RegExp(`\\${Na.sep}`,"g"),"/"),Ie.TarFilename]:["--use-compress-program",Gi?'"zstd -T0 --long=30"':"zstdmt --long=30"];case Ie.CompressionMethod.ZstdWithoutLong:return i?["zstd -T0 --force -o",a.replace(new RegExp(`\\${Na.sep}`,"g"),"/"),Ie.TarFilename]:["--use-compress-program",Gi?'"zstd -T0"':"zstdmt"];default:return["-z"]}})}function C0(t,e){return pi(this,void 0,void 0,function*(){for(let a of t)try{yield(0,kA.exec)(a,void 0,{cwd:e,env:Object.assign(Object.assign({},process.env),{MSYS:"winsymlinks:nativestrict"})})}catch(i){throw new Error(`${a.split(" ")[0]} failed with error: ${i?.message}`)}})}function $A(t,e){return pi(this,void 0,void 0,function*(){let a=yield E0(e,"list",t);yield C0(a)})}_t.listTar=$A;function GA(t,e){return pi(this,void 0,void 0,function*(){let a=Sv();yield rl.mkdirP(a);let i=yield E0(e,"extract",t);yield C0(i)})}_t.extractTar=GA;function XA(t,e,a){return pi(this,void 0,void 0,function*(){(0,_v.writeFileSync)(Na.join(t,Ie.ManifestFilename),e.join(` `));let i=yield E0(a,"create");yield C0(i,t)})}_t.createTar=XA});var Rv=T(Ye=>{"use strict";var WA=Ye&&Ye.__createBinding||(Object.create?function(t,e,a,i){i===void 0&&(i=a);var r=Object.getOwnPropertyDescriptor(e,a);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[a]}}),Object.defineProperty(t,i,r)}:function(t,e,a,i){i===void 0&&(i=a),t[i]=e[a]}),KA=Ye&&Ye.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ol=Ye&&Ye.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var a in t)a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)&&WA(e,t,a);return KA(e,t),e},Cv=Ye&&Ye.__awaiter||function(t,e,a,i){function r(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function o(l){try{d(i.next(l))}catch(c){s(c)}}function p(l){try{d(i.throw(l))}catch(c){s(c)}}function d(l){l.done?n(l.value):r(l.value).then(o,p)}d((i=i.apply(t,e||[])).next())})};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.saveCache=Ye.restoreCache=Ye.isFeatureAvailable=Ye.ReserveCacheError=Ye.ValidationError=void 0;var it=ol(nt()),Tv=ol(require("path")),pa=ol(ts()),nl=ol(Nv()),sl=Ev(),di=class t extends Error{constructor(e){super(e),this.name="ValidationError",Object.setPrototypeOf(this,t.prototype)}};Ye.ValidationError=di;var ro=class t extends Error{constructor(e){super(e),this.name="ReserveCacheError",Object.setPrototypeOf(this,t.prototype)}};Ye.ReserveCacheError=ro;function Pv(t){if(!t||t.length===0)throw new di("Path Validation Error: At least one directory or file path is required")}function Ov(t){if(t.length>512)throw new di(`Key Validation Error: ${t} cannot be larger than 512 characters.`);if(!/^[^,]*$/.test(t))throw new di(`Key Validation Error: ${t} cannot contain commas.`)}function QA(){return!!process.env.ACTIONS_CACHE_URL}Ye.isFeatureAvailable=QA;function YA(t,e,a,i,r=!1){return Cv(this,void 0,void 0,function*(){Pv(t),a=a||[];let n=[e,...a];if(it.debug("Resolved Keys:"),it.debug(JSON.stringify(n)),n.length>10)throw new di("Key Validation Error: Keys are limited to a maximum of 10.");for(let p of n)Ov(p);let s=yield pa.getCompressionMethod(),o="";try{let p=yield nl.getCacheEntry(n,t,{compressionMethod:s,enableCrossOsArchive:r});if(!p?.archiveLocation)return;if(i?.lookupOnly)return it.info("Lookup only - skipping download"),p.cacheKey;o=Tv.join(yield pa.createTempDirectory(),pa.getCacheFileName(s)),it.debug(`Archive Path: ${o}`),yield nl.downloadCache(p.archiveLocation,o,i),it.isDebug()&&(yield(0,sl.listTar)(o,s));let d=pa.getArchiveFileSizeInBytes(o);return it.info(`Cache Size: ~${Math.round(d/(1024*1024))} MB (${d} B)`),yield(0,sl.extractTar)(o,s),it.info("Cache restored successfully"),p.cacheKey}catch(p){if(p.name===di.name)throw p;it.warning(`Failed to restore: ${p.message}`)}finally{try{yield pa.unlinkFile(o)}catch(p){it.debug(`Failed to delete archive: ${p}`)}}})}Ye.restoreCache=YA;function ZA(t,e,a,i=!1){var r,n,s,o,p;return Cv(this,void 0,void 0,function*(){Pv(t),Ov(e);let d=yield pa.getCompressionMethod(),l=-1,c=yield pa.resolvePaths(t);if(it.debug("Cache Paths:"),it.debug(`${JSON.stringify(c)}`),c.length===0)throw new Error("Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.");let m=yield pa.createTempDirectory(),u=Tv.join(m,pa.getCacheFileName(d));it.debug(`Archive Path: ${u}`);try{yield(0,sl.createTar)(m,c,d),it.isDebug()&&(yield(0,sl.listTar)(u,d));let h=10*1024*1024*1024,v=pa.getArchiveFileSizeInBytes(u);if(it.debug(`File Size: ${v}`),v>h&&!pa.isGhes())throw new Error(`Cache size of ~${Math.round(v/(1024*1024))} MB (${v} B) is over the 10GB limit, not saving cache.`);it.debug("Reserving Cache");let E=yield nl.reserveCache(e,t,{compressionMethod:d,enableCrossOsArchive:i,cacheSize:v});if(!((r=E?.result)===null||r===void 0)&&r.cacheId)l=(n=E?.result)===null||n===void 0?void 0:n.cacheId;else throw E?.statusCode===400?new Error((o=(s=E?.error)===null||s===void 0?void 0:s.message)!==null&&o!==void 0?o:`Cache size of ~${Math.round(v/(1024*1024))} MB (${v} B) is over the data cap limit, not saving cache.`):new ro(`Unable to reserve cache with key ${e}, another job may be creating this cache. More details: ${(p=E?.error)===null||p===void 0?void 0:p.message}`);it.debug(`Saving Cache (ID: ${l})`),yield nl.saveCache(l,u,a)}catch(h){let v=h;if(v.name===di.name)throw h;v.name===ro.name?it.info(`Failed to save: ${v.message}`):it.warning(`Failed to save: ${v.message}`)}finally{try{yield pa.unlinkFile(u)}catch(h){it.debug(`Failed to delete archive: ${h}`)}}return l})}Ye.saveCache=ZA});var Bv=T((St,P0)=>{"use strict";var JA=St&&St.__createBinding||(Object.create?function(t,e,a,i){i===void 0&&(i=a),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[a]}})}:function(t,e,a,i){i===void 0&&(i=a),t[i]=e[a]}),ez=St&&St.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),tz=St&&St.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var a in t)a!=="default"&&Object.hasOwnProperty.call(t,a)&&JA(e,t,a);return ez(e,t),e},az=St&&St.__awaiter||function(t,e,a,i){function r(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function o(l){try{d(i.next(l))}catch(c){s(c)}}function p(l){try{d(i.throw(l))}catch(c){s(c)}}function d(l){l.done?n(l.value):r(l.value).then(o,p)}d((i=i.apply(t,e||[])).next())})};Object.defineProperty(St,"__esModule",{value:!0});St._readLinuxVersionFile=St._getOsVersion=St._findMatch=void 0;var Dv=tz(qo()),T0=nt(),Iv=require("os"),iz=require("child_process"),pl=require("fs");function rz(t,e,a,i){return az(this,void 0,void 0,function*(){let r=Iv.platform(),n,s,o;for(let p of a){let d=p.version;if(T0.debug(`check ${d} satisfies ${t}`),Dv.satisfies(d,t)&&(!e||p.stable===e)&&(o=p.files.find(l=>{T0.debug(`${l.arch}===${i} && ${l.platform}===${r}`);let c=l.arch===i&&l.platform===r;if(c&&l.platform_version){let m=P0.exports._getOsVersion();m===l.platform_version?c=!0:c=Dv.satisfies(m,l.platform_version)}return c}),o)){T0.debug(`matched ${p.version}`),s=p;break}}return s&&o&&(n=Object.assign({},s),n.files=[o]),n})}St._findMatch=rz;function nz(){let t=Iv.platform(),e="";if(t==="darwin")e=iz.execSync("sw_vers -productVersion").toString();else if(t==="linux"){let a=P0.exports._readLinuxVersionFile();if(a){let i=a.split(` -`);for(let r of i){let n=r.split("=");if(n.length===2&&(n[0].trim()==="VERSION_ID"||n[0].trim()==="DISTRIB_RELEASE")){e=n[1].trim().replace(/^"/,"").replace(/"$/,"");break}}}}return e}St._getOsVersion=nz;function sz(){let t="/etc/lsb-release",e="/etc/os-release",a="";return pl.existsSync(t)?a=pl.readFileSync(t).toString():pl.existsSync(e)&&(a=pl.readFileSync(e).toString()),a}St._readLinuxVersionFile=sz});var Mv=T(da=>{"use strict";var oz=da&&da.__createBinding||(Object.create?function(t,e,a,i){i===void 0&&(i=a),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[a]}})}:function(t,e,a,i){i===void 0&&(i=a),t[i]=e[a]}),pz=da&&da.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),dz=da&&da.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var a in t)a!=="default"&&Object.hasOwnProperty.call(t,a)&&oz(e,t,a);return pz(e,t),e},Av=da&&da.__awaiter||function(t,e,a,i){function r(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function o(l){try{d(i.next(l))}catch(c){s(c)}}function p(l){try{d(i.throw(l))}catch(c){s(c)}}function d(l){l.done?n(l.value):r(l.value).then(o,p)}d((i=i.apply(t,e||[])).next())})};Object.defineProperty(da,"__esModule",{value:!0});da.RetryHelper=void 0;var zv=dz(nt()),O0=class{constructor(e,a,i){if(e<1)throw new Error("max attempts should be greater than or equal to 1");if(this.maxAttempts=e,this.minSeconds=Math.floor(a),this.maxSeconds=Math.floor(i),this.minSeconds>this.maxSeconds)throw new Error("min seconds should be less than or equal to max seconds")}execute(e,a){return Av(this,void 0,void 0,function*(){let i=1;for(;isetTimeout(a,e*1e3))})}};da.RetryHelper=O0});var Vv=T(re=>{"use strict";var lz=re&&re.__createBinding||(Object.create?function(t,e,a,i){i===void 0&&(i=a),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[a]}})}:function(t,e,a,i){i===void 0&&(i=a),t[i]=e[a]}),cz=re&&re.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ka=re&&re.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var a in t)a!=="default"&&Object.hasOwnProperty.call(t,a)&&lz(e,t,a);return cz(e,t),e},Pt=re&&re.__awaiter||function(t,e,a,i){function r(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function o(l){try{d(i.next(l))}catch(c){s(c)}}function p(l){try{d(i.throw(l))}catch(c){s(c)}}function d(l){l.done?n(l.value):r(l.value).then(o,p)}d((i=i.apply(t,e||[])).next())})},mz=re&&re.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(re,"__esModule",{value:!0});re.evaluateVersions=re.isExplicitVersion=re.findFromManifest=re.getManifestFromRepo=re.findAllVersions=re.find=re.cacheFile=re.cacheDir=re.extractZip=re.extractXar=re.extractTar=re.extract7z=re.downloadTool=re.HTTPError=void 0;var he=ka(nt()),Kt=ka(jn()),la=ka(require("fs")),uz=ka(Bv()),so=ka(require("os")),_a=ka(require("path")),qv=ka(Or()),li=ka(qo()),fz=ka(require("stream")),hz=ka(require("util")),Rn=require("assert"),Lv=mz(xc()),Xi=kn(),gz=Mv(),no=class extends Error{constructor(e){super(`Unexpected HTTP response: ${e}`),this.httpStatusCode=e,Object.setPrototypeOf(this,new.target.prototype)}};re.HTTPError=no;var D0=process.platform==="win32",yz=process.platform==="darwin",vz="actions/tool-cache";function xz(t,e,a,i){return Pt(this,void 0,void 0,function*(){e=e||_a.join(Fv(),Lv.default()),yield Kt.mkdirP(_a.dirname(e)),he.debug(`Downloading ${t}`),he.debug(`Destination ${e}`);let r=3,n=R0("TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS",10),s=R0("TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS",20);return yield new gz.RetryHelper(r,n,s).execute(()=>Pt(this,void 0,void 0,function*(){return yield bz(t,e||"",a,i)}),p=>!(p instanceof no&&p.httpStatusCode&&p.httpStatusCode<500&&p.httpStatusCode!==408&&p.httpStatusCode!==429))})}re.downloadTool=xz;function bz(t,e,a,i){return Pt(this,void 0,void 0,function*(){if(la.existsSync(e))throw new Error(`Destination file path ${e} already exists`);let r=new qv.HttpClient(vz,[],{allowRetries:!1});a&&(he.debug("set auth"),i===void 0&&(i={}),i.authorization=a);let n=yield r.get(t,i);if(n.message.statusCode!==200){let l=new no(n.message.statusCode);throw he.debug(`Failed to download from "${t}". Code(${n.message.statusCode}) Message(${n.message.statusMessage})`),l}let s=hz.promisify(fz.pipeline),p=R0("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY",()=>n.message)(),d=!1;try{return yield s(p,la.createWriteStream(e)),he.debug("download complete"),d=!0,e}finally{if(!d){he.debug("download failed");try{yield Kt.rmRF(e)}catch(l){he.debug(`Failed to delete '${e}'. ${l.message}`)}}}})}function wz(t,e,a){return Pt(this,void 0,void 0,function*(){Rn.ok(D0,"extract7z() not supported on current OS"),Rn.ok(t,'parameter "file" is required'),e=yield dl(e);let i=process.cwd();if(process.chdir(e),a)try{let n=["x",he.isDebug()?"-bb1":"-bb0","-bd","-sccUTF-8",t],s={silent:!0};yield Xi.exec(`"${a}"`,n,s)}finally{process.chdir(i)}else{let r=_a.join(__dirname,"..","scripts","Invoke-7zdec.ps1").replace(/'/g,"''").replace(/"|\n|\r/g,""),n=t.replace(/'/g,"''").replace(/"|\n|\r/g,""),s=e.replace(/'/g,"''").replace(/"|\n|\r/g,""),p=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",`& '${r}' -Source '${n}' -Target '${s}'`],d={silent:!0};try{let l=yield Kt.which("powershell",!0);yield Xi.exec(`"${l}"`,p,d)}finally{process.chdir(i)}}return e})}re.extract7z=wz;function Nz(t,e,a="xz"){return Pt(this,void 0,void 0,function*(){if(!t)throw new Error("parameter 'file' is required");e=yield dl(e),he.debug("Checking tar --version");let i="";yield Xi.exec("tar --version",[],{ignoreReturnCode:!0,silent:!0,listeners:{stdout:p=>i+=p.toString(),stderr:p=>i+=p.toString()}}),he.debug(i.trim());let r=i.toUpperCase().includes("GNU TAR"),n;a instanceof Array?n=a:n=[a],he.isDebug()&&!a.includes("v")&&n.push("-v");let s=e,o=t;return D0&&r&&(n.push("--force-local"),s=e.replace(/\\/g,"/"),o=t.replace(/\\/g,"/")),r&&(n.push("--warning=no-unknown-keyword"),n.push("--overwrite")),n.push("-C",s,"-f",o),yield Xi.exec("tar",n),e})}re.extractTar=Nz;function _z(t,e,a=[]){return Pt(this,void 0,void 0,function*(){Rn.ok(yz,"extractXar() not supported on current OS"),Rn.ok(t,'parameter "file" is required'),e=yield dl(e);let i;a instanceof Array?i=a:i=[a],i.push("-x","-C",e,"-f",t),he.isDebug()&&i.push("-v");let r=yield Kt.which("xar",!0);return yield Xi.exec(`"${r}"`,Iz(i)),e})}re.extractXar=_z;function Sz(t,e){return Pt(this,void 0,void 0,function*(){if(!t)throw new Error("parameter 'file' is required");return e=yield dl(e),D0?yield Ez(t,e):yield Cz(t,e),e})}re.extractZip=Sz;function Ez(t,e){return Pt(this,void 0,void 0,function*(){let a=t.replace(/'/g,"''").replace(/"|\n|\r/g,""),i=e.replace(/'/g,"''").replace(/"|\n|\r/g,""),r=yield Kt.which("pwsh",!1);if(r){let s=["-NoLogo","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",["$ErrorActionPreference = 'Stop' ;","try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;",`try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${a}', '${i}', $true) }`,`catch { if (($_.Exception.GetType().FullName -eq 'System.Management.Automation.MethodException') -or ($_.Exception.GetType().FullName -eq 'System.Management.Automation.RuntimeException') ){ Expand-Archive -LiteralPath '${a}' -DestinationPath '${i}' -Force } else { throw $_ } } ;`].join(" ")];he.debug(`Using pwsh at path: ${r}`),yield Xi.exec(`"${r}"`,s)}else{let s=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",["$ErrorActionPreference = 'Stop' ;","try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;",`if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${a}' -DestinationPath '${i}' -Force }`,`else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${a}', '${i}', $true) }`].join(" ")],o=yield Kt.which("powershell",!0);he.debug(`Using powershell at path: ${o}`),yield Xi.exec(`"${o}"`,s)}})}function Cz(t,e){return Pt(this,void 0,void 0,function*(){let a=yield Kt.which("unzip",!0),i=[t];he.isDebug()||i.unshift("-q"),i.unshift("-o"),yield Xi.exec(`"${a}"`,i,{cwd:e})})}function Tz(t,e,a,i){return Pt(this,void 0,void 0,function*(){if(a=li.clean(a)||a,i=i||so.arch(),he.debug(`Caching tool ${e} ${a} ${i}`),he.debug(`source dir: ${t}`),!la.statSync(t).isDirectory())throw new Error("sourceDir is not a directory");let r=yield kv(e,a,i);for(let n of la.readdirSync(t)){let s=_a.join(t,n);yield Kt.cp(s,r,{recursive:!0})}return Hv(e,a,i),r})}re.cacheDir=Tz;function Pz(t,e,a,i,r){return Pt(this,void 0,void 0,function*(){if(i=li.clean(i)||i,r=r||so.arch(),he.debug(`Caching tool ${a} ${i} ${r}`),he.debug(`source file: ${t}`),!la.statSync(t).isFile())throw new Error("sourceFile is not a file");let n=yield kv(a,i,r),s=_a.join(n,e);return he.debug(`destination file ${s}`),yield Kt.cp(t,s),Hv(a,i,r),n})}re.cacheFile=Pz;function Oz(t,e,a){if(!t)throw new Error("toolName parameter is required");if(!e)throw new Error("versionSpec parameter is required");if(a=a||so.arch(),!I0(e)){let r=jv(t,a);e=Uv(r,e)}let i="";if(e){e=li.clean(e)||"";let r=_a.join(ll(),t,e,a);he.debug(`checking cache: ${r}`),la.existsSync(r)&&la.existsSync(`${r}.complete`)?(he.debug(`Found tool in cache ${t} ${e} ${a}`),i=r):he.debug("not found")}return i}re.find=Oz;function jv(t,e){let a=[];e=e||so.arch();let i=_a.join(ll(),t);if(la.existsSync(i)){let r=la.readdirSync(i);for(let n of r)if(I0(n)){let s=_a.join(i,n,e||"");la.existsSync(s)&&la.existsSync(`${s}.complete`)&&a.push(n)}}return a}re.findAllVersions=jv;function Rz(t,e,a,i="master"){return Pt(this,void 0,void 0,function*(){let r=[],n=`https://api.github.com/repos/${t}/${e}/git/trees/${i}`,s=new qv.HttpClient("tool-cache"),o={};a&&(he.debug("set auth"),o.authorization=a);let p=yield s.getJson(n,o);if(!p.result)return r;let d="";for(let c of p.result.tree)if(c.path==="versions-manifest.json"){d=c.url;break}o.accept="application/vnd.github.VERSION.raw";let l=yield(yield s.get(d,o)).readBody();if(l){l=l.replace(/^\uFEFF/,"");try{r=JSON.parse(l)}catch{he.debug("Invalid json")}}return r})}re.getManifestFromRepo=Rz;function Dz(t,e,a,i=so.arch()){return Pt(this,void 0,void 0,function*(){return yield uz._findMatch(t,e,a,i)})}re.findFromManifest=Dz;function dl(t){return Pt(this,void 0,void 0,function*(){return t||(t=_a.join(Fv(),Lv.default())),yield Kt.mkdirP(t),t})}function kv(t,e,a){return Pt(this,void 0,void 0,function*(){let i=_a.join(ll(),t,li.clean(e)||e,a||"");he.debug(`destination ${i}`);let r=`${i}.complete`;return yield Kt.rmRF(i),yield Kt.rmRF(r),yield Kt.mkdirP(i),i})}function Hv(t,e,a){let r=`${_a.join(ll(),t,li.clean(e)||e,a||"")}.complete`;la.writeFileSync(r,""),he.debug("finished caching tool")}function I0(t){let e=li.clean(t)||"";he.debug(`isExplicit: ${e}`);let a=li.valid(e)!=null;return he.debug(`explicit? ${a}`),a}re.isExplicitVersion=I0;function Uv(t,e){let a="";he.debug(`evaluating ${t.length} versions`),t=t.sort((i,r)=>li.gt(i,r)?1:-1);for(let i=t.length-1;i>=0;i--){let r=t[i];if(li.satisfies(r,e)){a=r;break}}return a?he.debug(`matched: ${a}`):he.debug("match not found"),a}re.evaluateVersions=Uv;function ll(){let t=process.env.RUNNER_TOOL_CACHE||"";return Rn.ok(t,"Expected RUNNER_TOOL_CACHE to be defined"),t}function Fv(){let t=process.env.RUNNER_TEMP||"";return Rn.ok(t,"Expected RUNNER_TEMP to be defined"),t}function R0(t,e){let a=global[t];return a!==void 0?a:e}function Iz(t){return Array.from(new Set(t))}});var tx=require("node:os"),Et=Dt(nt());var Yv=require("node:os"),Bn=require("node:path"),Ha=require("node:fs"),_r=Dt(nt()),ml=Dt(Rv()),po=Dt(Vv()),A0=Dt(kn());var oo=require("node:os"),$v=require("node:fs"),Gv=Dt(nt());function Bz(t){let{registryUrl:e,scope:a}=t,i;if(e)try{i=new URL(e)}catch{throw new Error(`Invalid registry-url: ${e}`)}let r;return a&&(r=a.startsWith("@")?a.toLocaleLowerCase():`@${a.toLocaleLowerCase()}`),i&&r?`[install.scopes]${oo.EOL}'${r}' = { token = "$BUN_AUTH_TOKEN", url = "${i}"}${oo.EOL}`:i&&!r?`[install]${oo.EOL}registry = "${i}"${oo.EOL}`:null}function Xv(t,e){let a=Bz(e);a&&((0,Gv.info)(`Writing bunfig.toml to '${t}'.`),(0,$v.appendFileSync)(t,a,{encoding:"utf8"}))}var Zv=Dt(nt());var Dn=Dt(nt()),Wv=require("node:console"),In=require("node:fs"),cl=require("node:path");function B0(t,e,a=1e4){return t().catch(i=>{if(e<=0)throw i;return new Promise(r=>setTimeout(r,a)).then(()=>B0(t,e-1,a))})}function Kv(t,e){return t.endsWith(e)?t:((0,In.renameSync)(t,t+e),t+e)}var Az={"package.json":t=>JSON.parse(t).packageManager?.split("bun@")?.[1],".tool-versions":t=>t.match(/^bun\s?(?.*?)$/m)?.groups?.version,".bumrc":t=>t,".bun-version":t=>t};function Qv(t){let e=process.env.GITHUB_WORKSPACE;if(!e||!t)return;(0,Dn.debug)(`Reading version from ${t}`);let a=(0,cl.join)(e,t),i=(0,cl.basename)(t);if(!(0,In.existsSync)(a)){(0,Dn.warning)(`File ${a} not found`);return}let r=Az[i]??(()=>{}),n;try{if(n=r((0,In.readFileSync)(a,"utf8"))?.trim(),!n){(0,Dn.warning)(`Failed to read version from ${t}`);return}}catch(s){let{message:o}=s;(0,Dn.warning)(`Failed to read ${t}: ${o}`)}finally{if(n)return(0,Wv.info)(`Obtained version ${n} from ${t}`),n}}var Jv=async t=>{let e=(0,Bn.join)(process.cwd(),"bunfig.toml");Xv(e,t);let a=qz(t),i=Mz(t),r=(0,Bn.join)((0,Yv.homedir)(),".bun","bin");try{(0,Ha.mkdirSync)(r,{recursive:!0})}catch(c){if(c.code!=="EEXIST")throw c}(0,_r.addPath)(r);let n=c=>process.platform==="win32"?`${c}.exe`:c,s=(0,Bn.join)(r,n("bun"));try{(0,Ha.symlinkSync)(s,(0,Bn.join)(r,n("bunx")))}catch(c){if(c.code!=="EEXIST")throw c}let o,p=!1;if(i&&await(0,ml.restoreCache)([s],a)&&(o=await ex(s),o?(p=!0,(0,_r.info)(`Using a cached version of Bun: ${o}`)):(0,_r.warning)(`Found a cached version of Bun: ${o} (but it appears to be corrupted?)`)),p||((0,_r.info)(`Downloading a new version of Bun: ${a}`),o=await B0(async()=>await zz(a,s),3)),!o)throw new Error("Downloaded a new version of Bun, but failed to check its version? Try again.");let[d]=o.split("+");return(0,Zv.saveState)("cache",JSON.stringify({cacheEnabled:i,cacheHit:p,bunPath:s,url:a})),{version:d,revision:o,bunPath:s,url:a,cacheHit:p}};async function zz(t,e){let a=Kv(await(0,po.downloadTool)(t),".zip"),i=await(0,po.extractZip)(a),r=await z0(i);try{(0,Ha.renameSync)(r,e)}catch{(0,Ha.copyFileSync)(r,e)}return await ex(e)}function Mz(t){let{customUrl:e,version:a,noCache:i}=t;return i||e||!a||/latest|canary|action/i.test(a)?!1:(0,ml.isFeatureAvailable)()}function qz(t){let{customUrl:e}=t;if(e)return e;let{version:a,os:i,arch:r,avx2:n,profile:s}=t,o=encodeURIComponent(a??"latest"),p=encodeURIComponent(i??process.platform),d=encodeURIComponent(r??process.arch),l=encodeURIComponent(n??!0),c=encodeURIComponent(s??!1),{href:m}=new URL(`${o}/${p}/${d}?avx2=${l}&profile=${c}`,"https://bun.sh/download/");return m}async function z0(t){for(let e of(0,Ha.readdirSync)(t,{withFileTypes:!0})){let{name:a}=e,i=(0,Bn.join)(t,a);if(e.isFile()){if(a==="bun"||a==="bun.exe")return i;if(/^bun.*\.zip/.test(a)){let r=await(0,po.extractZip)(i);return z0(r)}}if(/^bun/.test(a)&&e.isDirectory())return z0(i)}throw new Error("Could not find executable: bun")}async function ex(t){let e=await(0,A0.getExecOutput)(t,["--revision"],{ignoreReturnCode:!0});if(e.exitCode===0&&/^\d+\.\d+\.\d+/.test(e.stdout))return e.stdout.trim();let a=await(0,A0.getExecOutput)(t,["--version"],{ignoreReturnCode:!0});if(a.exitCode===0&&/^\d+\.\d+\.\d+/.test(a.stdout))return a.stdout.trim()}process.env.RUNNER_TEMP||(process.env.RUNNER_TEMP=(0,tx.tmpdir)());Jv({version:(0,Et.getInput)("bun-version")||Qv((0,Et.getInput)("bun-version-file"))||void 0,customUrl:(0,Et.getInput)("bun-download-url")||void 0,registryUrl:(0,Et.getInput)("registry-url")||void 0,scope:(0,Et.getInput)("scope")||void 0,noCache:(0,Et.getBooleanInput)("no-cache")||!1}).then(({version:t,revision:e,bunPath:a,url:i,cacheHit:r})=>{(0,Et.setOutput)("bun-version",t),(0,Et.setOutput)("bun-revision",e),(0,Et.setOutput)("bun-path",a),(0,Et.setOutput)("bun-download-url",i),(0,Et.setOutput)("cache-hit",r),process.exit(0)}).catch(t=>{(0,Et.setFailed)(t),process.exit(1)}); +`);for(let r of i){let n=r.split("=");if(n.length===2&&(n[0].trim()==="VERSION_ID"||n[0].trim()==="DISTRIB_RELEASE")){e=n[1].trim().replace(/^"/,"").replace(/"$/,"");break}}}}return e}St._getOsVersion=nz;function sz(){let t="/etc/lsb-release",e="/etc/os-release",a="";return pl.existsSync(t)?a=pl.readFileSync(t).toString():pl.existsSync(e)&&(a=pl.readFileSync(e).toString()),a}St._readLinuxVersionFile=sz});var Mv=T(da=>{"use strict";var oz=da&&da.__createBinding||(Object.create?function(t,e,a,i){i===void 0&&(i=a),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[a]}})}:function(t,e,a,i){i===void 0&&(i=a),t[i]=e[a]}),pz=da&&da.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),dz=da&&da.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var a in t)a!=="default"&&Object.hasOwnProperty.call(t,a)&&oz(e,t,a);return pz(e,t),e},Av=da&&da.__awaiter||function(t,e,a,i){function r(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function o(l){try{d(i.next(l))}catch(c){s(c)}}function p(l){try{d(i.throw(l))}catch(c){s(c)}}function d(l){l.done?n(l.value):r(l.value).then(o,p)}d((i=i.apply(t,e||[])).next())})};Object.defineProperty(da,"__esModule",{value:!0});da.RetryHelper=void 0;var zv=dz(nt()),O0=class{constructor(e,a,i){if(e<1)throw new Error("max attempts should be greater than or equal to 1");if(this.maxAttempts=e,this.minSeconds=Math.floor(a),this.maxSeconds=Math.floor(i),this.minSeconds>this.maxSeconds)throw new Error("min seconds should be less than or equal to max seconds")}execute(e,a){return Av(this,void 0,void 0,function*(){let i=1;for(;isetTimeout(a,e*1e3))})}};da.RetryHelper=O0});var Vv=T(re=>{"use strict";var lz=re&&re.__createBinding||(Object.create?function(t,e,a,i){i===void 0&&(i=a),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[a]}})}:function(t,e,a,i){i===void 0&&(i=a),t[i]=e[a]}),cz=re&&re.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ka=re&&re.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var a in t)a!=="default"&&Object.hasOwnProperty.call(t,a)&&lz(e,t,a);return cz(e,t),e},Pt=re&&re.__awaiter||function(t,e,a,i){function r(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function o(l){try{d(i.next(l))}catch(c){s(c)}}function p(l){try{d(i.throw(l))}catch(c){s(c)}}function d(l){l.done?n(l.value):r(l.value).then(o,p)}d((i=i.apply(t,e||[])).next())})},mz=re&&re.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(re,"__esModule",{value:!0});re.evaluateVersions=re.isExplicitVersion=re.findFromManifest=re.getManifestFromRepo=re.findAllVersions=re.find=re.cacheFile=re.cacheDir=re.extractZip=re.extractXar=re.extractTar=re.extract7z=re.downloadTool=re.HTTPError=void 0;var he=ka(nt()),Kt=ka(jn()),la=ka(require("fs")),uz=ka(Bv()),so=ka(require("os")),_a=ka(require("path")),qv=ka(Or()),li=ka(qo()),fz=ka(require("stream")),hz=ka(require("util")),Rn=require("assert"),Lv=mz(xc()),Xi=kn(),gz=Mv(),no=class extends Error{constructor(e){super(`Unexpected HTTP response: ${e}`),this.httpStatusCode=e,Object.setPrototypeOf(this,new.target.prototype)}};re.HTTPError=no;var D0=process.platform==="win32",yz=process.platform==="darwin",vz="actions/tool-cache";function xz(t,e,a,i){return Pt(this,void 0,void 0,function*(){e=e||_a.join(Fv(),Lv.default()),yield Kt.mkdirP(_a.dirname(e)),he.debug(`Downloading ${t}`),he.debug(`Destination ${e}`);let r=3,n=R0("TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS",10),s=R0("TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS",20);return yield new gz.RetryHelper(r,n,s).execute(()=>Pt(this,void 0,void 0,function*(){return yield bz(t,e||"",a,i)}),p=>!(p instanceof no&&p.httpStatusCode&&p.httpStatusCode<500&&p.httpStatusCode!==408&&p.httpStatusCode!==429))})}re.downloadTool=xz;function bz(t,e,a,i){return Pt(this,void 0,void 0,function*(){if(la.existsSync(e))throw new Error(`Destination file path ${e} already exists`);let r=new qv.HttpClient(vz,[],{allowRetries:!1});a&&(he.debug("set auth"),i===void 0&&(i={}),i.authorization=a);let n=yield r.get(t,i);if(n.message.statusCode!==200){let l=new no(n.message.statusCode);throw he.debug(`Failed to download from "${t}". Code(${n.message.statusCode}) Message(${n.message.statusMessage})`),l}let s=hz.promisify(fz.pipeline),p=R0("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY",()=>n.message)(),d=!1;try{return yield s(p,la.createWriteStream(e)),he.debug("download complete"),d=!0,e}finally{if(!d){he.debug("download failed");try{yield Kt.rmRF(e)}catch(l){he.debug(`Failed to delete '${e}'. ${l.message}`)}}}})}function wz(t,e,a){return Pt(this,void 0,void 0,function*(){Rn.ok(D0,"extract7z() not supported on current OS"),Rn.ok(t,'parameter "file" is required'),e=yield dl(e);let i=process.cwd();if(process.chdir(e),a)try{let n=["x",he.isDebug()?"-bb1":"-bb0","-bd","-sccUTF-8",t],s={silent:!0};yield Xi.exec(`"${a}"`,n,s)}finally{process.chdir(i)}else{let r=_a.join(__dirname,"..","scripts","Invoke-7zdec.ps1").replace(/'/g,"''").replace(/"|\n|\r/g,""),n=t.replace(/'/g,"''").replace(/"|\n|\r/g,""),s=e.replace(/'/g,"''").replace(/"|\n|\r/g,""),p=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",`& '${r}' -Source '${n}' -Target '${s}'`],d={silent:!0};try{let l=yield Kt.which("powershell",!0);yield Xi.exec(`"${l}"`,p,d)}finally{process.chdir(i)}}return e})}re.extract7z=wz;function Nz(t,e,a="xz"){return Pt(this,void 0,void 0,function*(){if(!t)throw new Error("parameter 'file' is required");e=yield dl(e),he.debug("Checking tar --version");let i="";yield Xi.exec("tar --version",[],{ignoreReturnCode:!0,silent:!0,listeners:{stdout:p=>i+=p.toString(),stderr:p=>i+=p.toString()}}),he.debug(i.trim());let r=i.toUpperCase().includes("GNU TAR"),n;a instanceof Array?n=a:n=[a],he.isDebug()&&!a.includes("v")&&n.push("-v");let s=e,o=t;return D0&&r&&(n.push("--force-local"),s=e.replace(/\\/g,"/"),o=t.replace(/\\/g,"/")),r&&(n.push("--warning=no-unknown-keyword"),n.push("--overwrite")),n.push("-C",s,"-f",o),yield Xi.exec("tar",n),e})}re.extractTar=Nz;function _z(t,e,a=[]){return Pt(this,void 0,void 0,function*(){Rn.ok(yz,"extractXar() not supported on current OS"),Rn.ok(t,'parameter "file" is required'),e=yield dl(e);let i;a instanceof Array?i=a:i=[a],i.push("-x","-C",e,"-f",t),he.isDebug()&&i.push("-v");let r=yield Kt.which("xar",!0);return yield Xi.exec(`"${r}"`,Iz(i)),e})}re.extractXar=_z;function Sz(t,e){return Pt(this,void 0,void 0,function*(){if(!t)throw new Error("parameter 'file' is required");return e=yield dl(e),D0?yield Ez(t,e):yield Cz(t,e),e})}re.extractZip=Sz;function Ez(t,e){return Pt(this,void 0,void 0,function*(){let a=t.replace(/'/g,"''").replace(/"|\n|\r/g,""),i=e.replace(/'/g,"''").replace(/"|\n|\r/g,""),r=yield Kt.which("pwsh",!1);if(r){let s=["-NoLogo","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",["$ErrorActionPreference = 'Stop' ;","try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;",`try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${a}', '${i}', $true) }`,`catch { if (($_.Exception.GetType().FullName -eq 'System.Management.Automation.MethodException') -or ($_.Exception.GetType().FullName -eq 'System.Management.Automation.RuntimeException') ){ Expand-Archive -LiteralPath '${a}' -DestinationPath '${i}' -Force } else { throw $_ } } ;`].join(" ")];he.debug(`Using pwsh at path: ${r}`),yield Xi.exec(`"${r}"`,s)}else{let s=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",["$ErrorActionPreference = 'Stop' ;","try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;",`if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${a}' -DestinationPath '${i}' -Force }`,`else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${a}', '${i}', $true) }`].join(" ")],o=yield Kt.which("powershell",!0);he.debug(`Using powershell at path: ${o}`),yield Xi.exec(`"${o}"`,s)}})}function Cz(t,e){return Pt(this,void 0,void 0,function*(){let a=yield Kt.which("unzip",!0),i=[t];he.isDebug()||i.unshift("-q"),i.unshift("-o"),yield Xi.exec(`"${a}"`,i,{cwd:e})})}function Tz(t,e,a,i){return Pt(this,void 0,void 0,function*(){if(a=li.clean(a)||a,i=i||so.arch(),he.debug(`Caching tool ${e} ${a} ${i}`),he.debug(`source dir: ${t}`),!la.statSync(t).isDirectory())throw new Error("sourceDir is not a directory");let r=yield kv(e,a,i);for(let n of la.readdirSync(t)){let s=_a.join(t,n);yield Kt.cp(s,r,{recursive:!0})}return Hv(e,a,i),r})}re.cacheDir=Tz;function Pz(t,e,a,i,r){return Pt(this,void 0,void 0,function*(){if(i=li.clean(i)||i,r=r||so.arch(),he.debug(`Caching tool ${a} ${i} ${r}`),he.debug(`source file: ${t}`),!la.statSync(t).isFile())throw new Error("sourceFile is not a file");let n=yield kv(a,i,r),s=_a.join(n,e);return he.debug(`destination file ${s}`),yield Kt.cp(t,s),Hv(a,i,r),n})}re.cacheFile=Pz;function Oz(t,e,a){if(!t)throw new Error("toolName parameter is required");if(!e)throw new Error("versionSpec parameter is required");if(a=a||so.arch(),!I0(e)){let r=jv(t,a);e=Uv(r,e)}let i="";if(e){e=li.clean(e)||"";let r=_a.join(ll(),t,e,a);he.debug(`checking cache: ${r}`),la.existsSync(r)&&la.existsSync(`${r}.complete`)?(he.debug(`Found tool in cache ${t} ${e} ${a}`),i=r):he.debug("not found")}return i}re.find=Oz;function jv(t,e){let a=[];e=e||so.arch();let i=_a.join(ll(),t);if(la.existsSync(i)){let r=la.readdirSync(i);for(let n of r)if(I0(n)){let s=_a.join(i,n,e||"");la.existsSync(s)&&la.existsSync(`${s}.complete`)&&a.push(n)}}return a}re.findAllVersions=jv;function Rz(t,e,a,i="master"){return Pt(this,void 0,void 0,function*(){let r=[],n=`https://api.github.com/repos/${t}/${e}/git/trees/${i}`,s=new qv.HttpClient("tool-cache"),o={};a&&(he.debug("set auth"),o.authorization=a);let p=yield s.getJson(n,o);if(!p.result)return r;let d="";for(let c of p.result.tree)if(c.path==="versions-manifest.json"){d=c.url;break}o.accept="application/vnd.github.VERSION.raw";let l=yield(yield s.get(d,o)).readBody();if(l){l=l.replace(/^\uFEFF/,"");try{r=JSON.parse(l)}catch{he.debug("Invalid json")}}return r})}re.getManifestFromRepo=Rz;function Dz(t,e,a,i=so.arch()){return Pt(this,void 0,void 0,function*(){return yield uz._findMatch(t,e,a,i)})}re.findFromManifest=Dz;function dl(t){return Pt(this,void 0,void 0,function*(){return t||(t=_a.join(Fv(),Lv.default())),yield Kt.mkdirP(t),t})}function kv(t,e,a){return Pt(this,void 0,void 0,function*(){let i=_a.join(ll(),t,li.clean(e)||e,a||"");he.debug(`destination ${i}`);let r=`${i}.complete`;return yield Kt.rmRF(i),yield Kt.rmRF(r),yield Kt.mkdirP(i),i})}function Hv(t,e,a){let r=`${_a.join(ll(),t,li.clean(e)||e,a||"")}.complete`;la.writeFileSync(r,""),he.debug("finished caching tool")}function I0(t){let e=li.clean(t)||"";he.debug(`isExplicit: ${e}`);let a=li.valid(e)!=null;return he.debug(`explicit? ${a}`),a}re.isExplicitVersion=I0;function Uv(t,e){let a="";he.debug(`evaluating ${t.length} versions`),t=t.sort((i,r)=>li.gt(i,r)?1:-1);for(let i=t.length-1;i>=0;i--){let r=t[i];if(li.satisfies(r,e)){a=r;break}}return a?he.debug(`matched: ${a}`):he.debug("match not found"),a}re.evaluateVersions=Uv;function ll(){let t=process.env.RUNNER_TOOL_CACHE||"";return Rn.ok(t,"Expected RUNNER_TOOL_CACHE to be defined"),t}function Fv(){let t=process.env.RUNNER_TEMP||"";return Rn.ok(t,"Expected RUNNER_TEMP to be defined"),t}function R0(t,e){let a=global[t];return a!==void 0?a:e}function Iz(t){return Array.from(new Set(t))}});var tx=require("node:os"),Et=Dt(nt());var Yv=require("node:os"),Bn=require("node:path"),Ha=require("node:fs"),_r=Dt(nt()),ml=Dt(Rv()),po=Dt(Vv()),A0=Dt(kn());var oo=require("node:os"),$v=require("node:fs"),Gv=Dt(nt());function Bz(t){let{registryUrl:e,scope:a}=t,i;if(e)try{i=new URL(e)}catch{throw new Error(`Invalid registry-url: ${e}`)}let r;return a&&(r=a.startsWith("@")?a.toLocaleLowerCase():`@${a.toLocaleLowerCase()}`),i&&r?`[install.scopes]${oo.EOL}'${r}' = { token = "$BUN_AUTH_TOKEN", url = "${i}"}${oo.EOL}`:i&&!r?`[install]${oo.EOL}registry = "${i}"${oo.EOL}`:null}function Xv(t,e){let a=Bz(e);a&&((0,Gv.info)(`Writing bunfig.toml to '${t}'.`),(0,$v.appendFileSync)(t,a,{encoding:"utf8"}))}var Zv=Dt(nt());var Dn=Dt(nt()),Wv=require("node:console"),In=require("node:fs"),cl=require("node:path");function B0(t,e,a=1e4){return t().catch(i=>{if(e<=0)throw i;return new Promise(r=>setTimeout(r,a)).then(()=>B0(t,e-1,a))})}function Kv(t,e){return t.endsWith(e)?t:((0,In.renameSync)(t,t+e),t+e)}var Az={"package.json":t=>JSON.parse(t).packageManager?.split("bun@")?.[1],".tool-versions":t=>t.match(/^bun\s*(?.*?)$/m)?.groups?.version,".bumrc":t=>t,".bun-version":t=>t};function Qv(t){let e=process.env.GITHUB_WORKSPACE;if(!e||!t)return;(0,Dn.debug)(`Reading version from ${t}`);let a=(0,cl.join)(e,t),i=(0,cl.basename)(t);if(!(0,In.existsSync)(a)){(0,Dn.warning)(`File ${a} not found`);return}let r=Az[i]??(()=>{}),n;try{if(n=r((0,In.readFileSync)(a,"utf8"))?.trim(),!n){(0,Dn.warning)(`Failed to read version from ${t}`);return}}catch(s){let{message:o}=s;(0,Dn.warning)(`Failed to read ${t}: ${o}`)}finally{if(n)return(0,Wv.info)(`Obtained version ${n} from ${t}`),n}}var Jv=async t=>{let e=(0,Bn.join)(process.cwd(),"bunfig.toml");Xv(e,t);let a=qz(t),i=Mz(t),r=(0,Bn.join)((0,Yv.homedir)(),".bun","bin");try{(0,Ha.mkdirSync)(r,{recursive:!0})}catch(c){if(c.code!=="EEXIST")throw c}(0,_r.addPath)(r);let n=c=>process.platform==="win32"?`${c}.exe`:c,s=(0,Bn.join)(r,n("bun"));try{(0,Ha.symlinkSync)(s,(0,Bn.join)(r,n("bunx")))}catch(c){if(c.code!=="EEXIST")throw c}let o,p=!1;if(i&&await(0,ml.restoreCache)([s],a)&&(o=await ex(s),o?(p=!0,(0,_r.info)(`Using a cached version of Bun: ${o}`)):(0,_r.warning)(`Found a cached version of Bun: ${o} (but it appears to be corrupted?)`)),p||((0,_r.info)(`Downloading a new version of Bun: ${a}`),o=await B0(async()=>await zz(a,s),3)),!o)throw new Error("Downloaded a new version of Bun, but failed to check its version? Try again.");let[d]=o.split("+");return(0,Zv.saveState)("cache",JSON.stringify({cacheEnabled:i,cacheHit:p,bunPath:s,url:a})),{version:d,revision:o,bunPath:s,url:a,cacheHit:p}};async function zz(t,e){let a=Kv(await(0,po.downloadTool)(t),".zip"),i=await(0,po.extractZip)(a),r=await z0(i);try{(0,Ha.renameSync)(r,e)}catch{(0,Ha.copyFileSync)(r,e)}return await ex(e)}function Mz(t){let{customUrl:e,version:a,noCache:i}=t;return i||e||!a||/latest|canary|action/i.test(a)?!1:(0,ml.isFeatureAvailable)()}function qz(t){let{customUrl:e}=t;if(e)return e;let{version:a,os:i,arch:r,avx2:n,profile:s}=t,o=encodeURIComponent(a??"latest"),p=encodeURIComponent(i??process.platform),d=encodeURIComponent(r??process.arch),l=encodeURIComponent(n??!0),c=encodeURIComponent(s??!1),{href:m}=new URL(`${o}/${p}/${d}?avx2=${l}&profile=${c}`,"https://bun.sh/download/");return m}async function z0(t){for(let e of(0,Ha.readdirSync)(t,{withFileTypes:!0})){let{name:a}=e,i=(0,Bn.join)(t,a);if(e.isFile()){if(a==="bun"||a==="bun.exe")return i;if(/^bun.*\.zip/.test(a)){let r=await(0,po.extractZip)(i);return z0(r)}}if(/^bun/.test(a)&&e.isDirectory())return z0(i)}throw new Error("Could not find executable: bun")}async function ex(t){let e=await(0,A0.getExecOutput)(t,["--revision"],{ignoreReturnCode:!0});if(e.exitCode===0&&/^\d+\.\d+\.\d+/.test(e.stdout))return e.stdout.trim();let a=await(0,A0.getExecOutput)(t,["--version"],{ignoreReturnCode:!0});if(a.exitCode===0&&/^\d+\.\d+\.\d+/.test(a.stdout))return a.stdout.trim()}process.env.RUNNER_TEMP||(process.env.RUNNER_TEMP=(0,tx.tmpdir)());Jv({version:(0,Et.getInput)("bun-version")||Qv((0,Et.getInput)("bun-version-file"))||void 0,customUrl:(0,Et.getInput)("bun-download-url")||void 0,registryUrl:(0,Et.getInput)("registry-url")||void 0,scope:(0,Et.getInput)("scope")||void 0,noCache:(0,Et.getBooleanInput)("no-cache")||!1}).then(({version:t,revision:e,bunPath:a,url:i,cacheHit:r})=>{(0,Et.setOutput)("bun-version",t),(0,Et.setOutput)("bun-revision",e),(0,Et.setOutput)("bun-path",a),(0,Et.setOutput)("bun-download-url",i),(0,Et.setOutput)("cache-hit",r),process.exit(0)}).catch(t=>{(0,Et.setFailed)(t),process.exit(1)}); /*! Bundled license information: sax/lib/sax.js: