fix: allow more spaces for .tool-versions (#94)

* update: allow more spaces for .tool-versions

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Seiya Kokushiandautofix-ci[bot] authored and GitHub committed 2024-07-30 22:30:50 +02:00
1 parent 4bc047ad25
commit 1e54087d4f
3 files changed
+6 -2

No files matched your search

+4
View File
@@ -97,6 +97,10 @@ jobs:
file: .tool-versions
run: |
echo "bun1.1.0" > .tool-versions
- name: .tool-versions (bun 1.1.0)
file: .tool-versions
run: |
echo "bun 1.1.0" > .tool-versions
- name: .bumrc (1.1.0)
file: .bumrc
run: |
Generated Vendored
+1 -1
View File
@@ -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, Line truncated
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(;c<r;){let m=Math.min(r-c,d),u=c,h=c+m-1;c+=d,yield AA(t,n,()=>b0.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"),"/"),"--f Line truncated
`));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?fun Line truncated
`);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(;i<this.maxAttempts;){try{return yield e()}catch(n){if(a&&!a(n))throw n;zv.info(n.message)}let r=this.getSleepAmount();zv.info(`Waiting ${r} seconds before trying again`),yield this.sleep(r),i++}return yield e()})}getSleepAmount(){return Math.floor(Math.random()*(this.maxSeconds-this.minSeconds+1))+this.minSeconds}sleep(e){return Av(this,void 0,void 0,function*(){return new Promise(a=>setTimeout(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.c Line truncated
`);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(;i<this.maxAttempts;){try{return yield e()}catch(n){if(a&&!a(n))throw n;zv.info(n.message)}let r=this.getSleepAmount();zv.info(`Waiting ${r} seconds before trying again`),yield this.sleep(r),i++}return yield e()})}getSleepAmount(){return Math.floor(Math.random()*(this.maxSeconds-this.minSeconds+1))+this.minSeconds}sleep(e){return Av(this,void 0,void 0,function*(){return new Promise(a=>setTimeout(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.c Line truncated
/*! Bundled license information:
sax/lib/sax.js:
+1 -1
View File
@@ -31,7 +31,7 @@ const FILE_VERSION_READERS = {
"package.json": (content: string) =>
JSON.parse(content).packageManager?.split("bun@")?.[1],
".tool-versions": (content: string) =>
content.match(/^bun\s?(?<version>.*?)$/m)?.groups?.version,
content.match(/^bun\s*(?<version>.*?)$/m)?.groups?.version,
".bumrc": (content: string) => content, // https://github.com/owenizedd/bum
".bun-version": (content: string) => content,
};