diff --git a/README.md b/README.md index b61b2e7..644c760 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,37 @@ buildNumber= The build number can remain unset if you are using the default version name generators below. The generated `version_code` output uses the deterministic default formula `major * 10000 + minor * 100 + patch`. +#### Version storage + +The default `version_storage` backend is `version-properties`, which reads and writes `version.properties` in the repository root. +Projects that already keep shared Gradle settings in `gradle.properties` can use the `gradle-properties` backend instead. + +Both supported backends use the same keys: + +```properties +majorVersion=1 +minorVersion=0 +patchVersion=0 +buildNumber= +``` + +| Backend | File | Behavior | +| ------------------ | -------------------- | ----------------------------------------------------------------- | +| version-properties | `version.properties` | Compatibility default. The action writes the version keys file. | +| gradle-properties | `gradle.properties` | The action updates the version keys and preserves unrelated keys. | + +To use `gradle.properties`: + +```yaml +- name: Bump version + id: bump_version + uses: oflynned/android-version-bump@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + version_storage: gradle-properties +``` + #### build.gradle.kts / Kotlin DSL For Kotlin DSL projects, pass the generated values from GitHub Actions into Gradle as project properties. @@ -244,12 +275,13 @@ Enable this field by passing a build number/string/SHA as an input to the action Pass these in the `with:` block -| Tag | Effect | Example | Default value | -|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|--------------------------| -| tag_prefix | Prefix used in the generated release commit message. The git tag, `git_tag`, and `new_tag` outputs remain the unprefixed version. | `tag_prefix: 'release-'` makes the default commit message `release: release-1.0.0` | `v` | -| skip_ci | Affixes `[skip-ci]` to the end of the commit message, even if you provide a custom message | `skip_ci: false` | true | -| build_number | Sets the build run number in the version | `build_number: ${{ github.run_number }}` generates `1.0.0.5` | '' | -| commit_message | Sets the commit message when a release bump is performed. Can optionally use `{{ version }}` to insert the generated version bump with the tag prefix into the commit message. | `ci: {{ version }} was just released into the wild! :tada: :partying_face:` | `release: {{ version }}` | +| Tag | Effect | Example | Default value | +|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|--------------------------| +| version_storage | Selects where version metadata is read from and written to. Supported values are `version-properties` and `gradle-properties`. | `version_storage: gradle-properties` updates `gradle.properties` | `version-properties` | +| tag_prefix | Prefix used in the generated release commit message. The git tag, `git_tag`, and `new_tag` outputs remain the unprefixed version. | `tag_prefix: 'release-'` makes the default commit message `release: release-1.0.0` | `v` | +| skip_ci | Affixes `[skip-ci]` to the end of the commit message, even if you provide a custom message | `skip_ci: false` | true | +| build_number | Sets the build run number in the version | `build_number: ${{ github.run_number }}` generates `1.0.0.5` | '' | +| commit_message | Sets the commit message when a release bump is performed. Can optionally use `{{ version }}` to insert the generated version bump with the tag prefix into the commit message. | `ci: {{ version }} was just released into the wild! :tada: :partying_face:` | `release: {{ version }}` | ## Outputs diff --git a/SECURITY.md b/SECURITY.md index d19c783..d252a10 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -3,7 +3,7 @@ ## Supported Versions | Version | Supported | -| ------- | ------------------ | +|---------|--------------------| | 1.x.x | :white_check_mark: | | < 1.0 | :x: | diff --git a/action.yml b/action.yml index 8a8b08e..38efddc 100644 --- a/action.yml +++ b/action.yml @@ -8,6 +8,10 @@ branding: icon: chevron-up color: blue inputs: + version_storage: + required: false + description: 'Version metadata storage backend: version-properties or gradle-properties' + default: 'version-properties' tag_prefix: required: false description: 'Prefix to add to the generated release commit message' diff --git a/dist/index.js b/dist/index.js index 36a3606..6f97a74 100644 --- a/dist/index.js +++ b/dist/index.js @@ -5,9 +5,9 @@ * content-type * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed - */A={value:true};A=format;t.qg=parse;const r=/^[\u0009\u0020-\u007e\u0080-\u00ff]*$/;const s=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;const o=/[\\"]/g;const n=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;const i=(()=>{const C=function(){};C.prototype=Object.create(null);return C})();function format(e){const{type:t,parameters:A}=e;if(!t||!n.test(t)){throw new TypeError(`Invalid type: ${t}`)}let r=t;if(A){for(const e of Object.keys(A)){if(!s.test(e)){throw new TypeError(`Invalid parameter name: ${e}`)}r+=`; ${e}=${qstring(A[e])}`}}return r}function parse(e,t){const A=e.length;let r=skipOWS(e,0,A);const s=r;r=skipValue(e,r,A);const o=trailingOWS(e,s,r);const n=e.slice(s,o).toLowerCase();const a=t?.parameters===false?new i:parseParameters(e,r,A);return{type:n,parameters:a}}const a=32;const c=9;const l=59;const g=61;const u=34;const E=92;function parseParameters(e,t,A){const r=new i;e:while(tt){const t=e.charCodeAt(A-1);if(t!==a&&t!==c)break;A--}return A}function qstring(e){if(s.test(e))return e;if(r.test(e))return`"${e.replace(o,"\\$&")}"`;throw new TypeError(`Invalid parameter value: ${e}`)}}};var t={};function __nccwpck_require__(A){var r=t[A];if(r!==undefined){return r.exports}var s=t[A]={exports:{}};var o=true;try{e[A].call(s.exports,s,s.exports,__nccwpck_require__);o=false}finally{if(o)delete t[A]}return s.exports}(()=>{__nccwpck_require__.n=e=>{var t=e&&e.__esModule?()=>e["default"]:()=>e;__nccwpck_require__.d(t,{a:t});return t}})();(()=>{__nccwpck_require__.d=(e,t)=>{for(var A in t){if(__nccwpck_require__.o(t,A)&&!__nccwpck_require__.o(e,A)){Object.defineProperty(e,A,{enumerable:true,get:t[A]})}}}})();(()=>{__nccwpck_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var A={};(()=>{"use strict";const e=require("fs/promises");var t=__nccwpck_require__.n(e);const getValue=(e,t,A)=>e.inputs[t]??A??"";const getGradleLocation=e=>getValue(e,"gradle_location","app/build.gradle");const getTagPrefix=e=>getValue(e,"tag_prefix","v");const isSkippingCi=e=>getValue(e,"skip_ci","true")==="true";const getBuildNumber=e=>getValue(e,"build_number","");const getCommitMessage=(e,t,A,r)=>{const s=`${A}${t.name}`;const o=`release: ${s}`;const n=getValue(e,"commit_message",o).replace("{{version}}",s);const i=r?"[skip-ci]":"";return`${n.length>0?n:o} ${i}`.trim()};const A=require("child_process");const r=require("os");const runCommand=async(e,t)=>{const s=process.env.GITHUB_WORKSPACE;return new Promise((o,n)=>{const i=(0,A.spawn)(e,t,{cwd:s});const a=[];let c=false;i.on("error",e=>{if(!c){c=true;n(e)}});i.stderr.on("data",e=>a.push(e));i.on("exit",t=>{if(!c){if(t===0){o()}else{n(`${a.join("")}${r.EOL}${e} exited with code ${t}`)}}})})};const setGitIdentity=async e=>{const t="Automated Version Bump";const A=process.env.GITHUB_USER??t;e.log.log(`Setting git config name to ${A}`);await e.exec("git",["config","user.name",A]);const r="android-semantic-release@users.noreply.github.com";const s=process.env.GITHUB_EMAIL??r;e.log.log(`Setting git config email to ${s}`);await e.exec("git",["config","user.email",s])};const createCommit=async(e,t)=>{try{e.log.log(`Creating version commit`);e.log.log({commit:t});await runCommand("git",["add","version.properties"]);await runCommand("git",["commit","-m",t])}catch{e.log.warn(`Commit failed, but this shouldn't be a problem if you are using actions/checkout@v2`)}};const pushChanges=async(e,t,A)=>{const r=["https://",process.env.GITHUB_ACTOR,":",process.env.GITHUB_TOKEN,"@github.com/",process.env.GITHUB_REPOSITORY,".git"].join("");if(A){e.log.log("Publishing tag");await runCommand("git",["tag",t]);await runCommand("git",["push",r,"--follow-tags"]);await runCommand("git",["push",r,"--tags"])}else{e.log.log("Not publishing tag, pushing instead");await runCommand("git",["push",r])}};const doesVersionPropertiesExist=async e=>{try{const t=await e.readFile("version.properties");return t?.toString().length>0}catch{return false}};const getVersionProperties=async e=>{const t=(await e.readFile("version.properties")).toString();const A=t.match(/(majorVersion=)(\d+)/);const r=t.match(/(minorVersion=)(\d+)/);const s=t.match(/(patchVersion=)(\d+)/);return{major:A&&A.length>1?Number.parseInt(A[2]):0,minor:r&&r.length>1?Number.parseInt(r[2]):0,patch:s&&s.length>1?Number.parseInt(s[2]):0}};const setVersionProperties=async(e,t,{major:A,minor:r,patch:s,build:o})=>{const n=[`majorVersion=${A}`,`minorVersion=${r}`,`patchVersion=${s}`,`buildNumber=${o??""}`].join("\n");await e.writeFile("version.properties",n);t.log.log(n)};function utils_toCommandValue(e){if(e===null||e===undefined){return""}else if(typeof e==="string"||e instanceof String){return e}return JSON.stringify(e)}function utils_toCommandProperties(e){if(!Object.keys(e).length){return{}}return{title:e.title,file:e.file,line:e.startLine,endLine:e.endLine,col:e.startColumn,endColumn:e.endColumn}}function command_issueCommand(e,t,A){const s=new Command(e,t,A);process.stdout.write(s.toString()+r.EOL)}function command_issue(e,t=""){command_issueCommand(e,{},t)}const s="::";class Command{constructor(e,t,A){if(!e){e="missing.command"}this.command=e;this.properties=t;this.message=A}toString(){let e=s+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";let t=true;for(const A in this.properties){if(this.properties.hasOwnProperty(A)){const r=this.properties[A];if(r){if(t){t=false}else{e+=","}e+=`${A}=${escapeProperty(r)}`}}}}e+=`${s}${escapeData(this.message)}`;return e}}function escapeData(e){return utils_toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(e){return utils_toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}const o=require("crypto");const n=require("fs");function file_command_issueFileCommand(e,t){const A=process.env[`GITHUB_${e}`];if(!A){throw new Error(`Unable to find environment variable for file command ${e}`)}if(!n.existsSync(A)){throw new Error(`Missing file at path: ${A}`)}n.appendFileSync(A,`${utils_toCommandValue(t)}${r.EOL}`,{encoding:"utf8"})}function file_command_prepareKeyValueMessage(e,t){const A=`ghadelimiter_${o.randomUUID()}`;const s=utils_toCommandValue(t);if(e.includes(A)){throw new Error(`Unexpected input: name should not contain the delimiter "${A}"`)}if(s.includes(A)){throw new Error(`Unexpected input: value should not contain the delimiter "${A}"`)}return`${e}<<${A}${r.EOL}${s}${r.EOL}${A}`}const i=require("path");var a=__nccwpck_require__(8611);var c=__nccwpck_require__(5692);function getProxyUrl(e){const t=e.protocol==="https:";if(checkBypass(e)){return undefined}const A=(()=>{if(t){return process.env["https_proxy"]||process.env["HTTPS_PROXY"]}else{return process.env["http_proxy"]||process.env["HTTP_PROXY"]}})();if(A){try{return new DecodedURL(A)}catch(e){if(!A.startsWith("http://")&&!A.startsWith("https://"))return new DecodedURL(`http://${A}`)}}else{return undefined}}function checkBypass(e){if(!e.hostname){return false}const t=e.hostname;if(isLoopbackAddress(t)){return true}const A=process.env["no_proxy"]||process.env["NO_PROXY"]||"";if(!A){return false}let r;if(e.port){r=Number(e.port)}else if(e.protocol==="http:"){r=80}else if(e.protocol==="https:"){r=443}const s=[e.hostname.toUpperCase()];if(typeof r==="number"){s.push(`${s[0]}:${r}`)}for(const e of A.split(",").map(e=>e.trim().toUpperCase()).filter(e=>e)){if(e==="*"||s.some(t=>t===e||t.endsWith(`.${e}`)||e.startsWith(".")&&t.endsWith(`${e}`))){return true}}return false}function isLoopbackAddress(e){const t=e.toLowerCase();return t==="localhost"||t.startsWith("127.")||t.startsWith("[::1]")||t.startsWith("[0:0:0:0:0:0:0:1]")}class DecodedURL extends URL{constructor(e,t){super(e,t);this._decodedUsername=decodeURIComponent(super.username);this._decodedPassword=decodeURIComponent(super.password)}get username(){return this._decodedUsername}get password(){return this._decodedPassword}}var l=__nccwpck_require__(770);var g=__nccwpck_require__(6752);var u=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A(function(t){t(e)})}return new(A||(A=Promise))(function(A,s){function fulfilled(e){try{step(r.next(e))}catch(e){s(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){s(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};var E;(function(e){e[e["OK"]=200]="OK";e[e["MultipleChoices"]=300]="MultipleChoices";e[e["MovedPermanently"]=301]="MovedPermanently";e[e["ResourceMoved"]=302]="ResourceMoved";e[e["SeeOther"]=303]="SeeOther";e[e["NotModified"]=304]="NotModified";e[e["UseProxy"]=305]="UseProxy";e[e["SwitchProxy"]=306]="SwitchProxy";e[e["TemporaryRedirect"]=307]="TemporaryRedirect";e[e["PermanentRedirect"]=308]="PermanentRedirect";e[e["BadRequest"]=400]="BadRequest";e[e["Unauthorized"]=401]="Unauthorized";e[e["PaymentRequired"]=402]="PaymentRequired";e[e["Forbidden"]=403]="Forbidden";e[e["NotFound"]=404]="NotFound";e[e["MethodNotAllowed"]=405]="MethodNotAllowed";e[e["NotAcceptable"]=406]="NotAcceptable";e[e["ProxyAuthenticationRequired"]=407]="ProxyAuthenticationRequired";e[e["RequestTimeout"]=408]="RequestTimeout";e[e["Conflict"]=409]="Conflict";e[e["Gone"]=410]="Gone";e[e["TooManyRequests"]=429]="TooManyRequests";e[e["InternalServerError"]=500]="InternalServerError";e[e["NotImplemented"]=501]="NotImplemented";e[e["BadGateway"]=502]="BadGateway";e[e["ServiceUnavailable"]=503]="ServiceUnavailable";e[e["GatewayTimeout"]=504]="GatewayTimeout"})(E||(E={}));var h;(function(e){e["Accept"]="accept";e["ContentType"]="content-type"})(h||(h={}));var d;(function(e){e["ApplicationJson"]="application/json"})(d||(d={}));function lib_getProxyUrl(e){const t=pm.getProxyUrl(new URL(e));return t?t.href:""}const Q=[E.MovedPermanently,E.ResourceMoved,E.SeeOther,E.TemporaryRedirect,E.PermanentRedirect];const B=[E.BadGateway,E.ServiceUnavailable,E.GatewayTimeout];const I=null&&["OPTIONS","GET","DELETE","HEAD"];const p=10;const f=5;class HttpClientError extends Error{constructor(e,t){super(e);this.name="HttpClientError";this.statusCode=t;Object.setPrototypeOf(this,HttpClientError.prototype)}}class HttpClientResponse{constructor(e){this.message=e}readBody(){return u(this,void 0,void 0,function*(){return new Promise(e=>u(this,void 0,void 0,function*(){let t=Buffer.alloc(0);this.message.on("data",e=>{t=Buffer.concat([t,e])});this.message.on("end",()=>{e(t.toString())})}))})}readBodyBuffer(){return u(this,void 0,void 0,function*(){return new Promise(e=>u(this,void 0,void 0,function*(){const t=[];this.message.on("data",e=>{t.push(e)});this.message.on("end",()=>{e(Buffer.concat(t))})}))})}}function isHttps(e){const t=new URL(e);return t.protocol==="https:"}class lib_HttpClient{constructor(e,t,A){this._ignoreSslError=false;this._allowRedirects=true;this._allowRedirectDowngrade=false;this._maxRedirects=50;this._allowRetries=false;this._maxRetries=1;this._keepAlive=false;this._disposed=false;this.userAgent=this._getUserAgentWithOrchestrationId(e);this.handlers=t||[];this.requestOptions=A;if(A){if(A.ignoreSslError!=null){this._ignoreSslError=A.ignoreSslError}this._socketTimeout=A.socketTimeout;if(A.allowRedirects!=null){this._allowRedirects=A.allowRedirects}if(A.allowRedirectDowngrade!=null){this._allowRedirectDowngrade=A.allowRedirectDowngrade}if(A.maxRedirects!=null){this._maxRedirects=Math.max(A.maxRedirects,0)}if(A.keepAlive!=null){this._keepAlive=A.keepAlive}if(A.allowRetries!=null){this._allowRetries=A.allowRetries}if(A.maxRetries!=null){this._maxRetries=A.maxRetries}}}options(e,t){return u(this,void 0,void 0,function*(){return this.request("OPTIONS",e,null,t||{})})}get(e,t){return u(this,void 0,void 0,function*(){return this.request("GET",e,null,t||{})})}del(e,t){return u(this,void 0,void 0,function*(){return this.request("DELETE",e,null,t||{})})}post(e,t,A){return u(this,void 0,void 0,function*(){return this.request("POST",e,t,A||{})})}patch(e,t,A){return u(this,void 0,void 0,function*(){return this.request("PATCH",e,t,A||{})})}put(e,t,A){return u(this,void 0,void 0,function*(){return this.request("PUT",e,t,A||{})})}head(e,t){return u(this,void 0,void 0,function*(){return this.request("HEAD",e,null,t||{})})}sendStream(e,t,A,r){return u(this,void 0,void 0,function*(){return this.request(e,t,A,r)})}getJson(e){return u(this,arguments,void 0,function*(e,t={}){t[h.Accept]=this._getExistingOrDefaultHeader(t,h.Accept,d.ApplicationJson);const A=yield this.get(e,t);return this._processResponse(A,this.requestOptions)})}postJson(e,t){return u(this,arguments,void 0,function*(e,t,A={}){const r=JSON.stringify(t,null,2);A[h.Accept]=this._getExistingOrDefaultHeader(A,h.Accept,d.ApplicationJson);A[h.ContentType]=this._getExistingOrDefaultContentTypeHeader(A,d.ApplicationJson);const s=yield this.post(e,r,A);return this._processResponse(s,this.requestOptions)})}putJson(e,t){return u(this,arguments,void 0,function*(e,t,A={}){const r=JSON.stringify(t,null,2);A[h.Accept]=this._getExistingOrDefaultHeader(A,h.Accept,d.ApplicationJson);A[h.ContentType]=this._getExistingOrDefaultContentTypeHeader(A,d.ApplicationJson);const s=yield this.put(e,r,A);return this._processResponse(s,this.requestOptions)})}patchJson(e,t){return u(this,arguments,void 0,function*(e,t,A={}){const r=JSON.stringify(t,null,2);A[h.Accept]=this._getExistingOrDefaultHeader(A,h.Accept,d.ApplicationJson);A[h.ContentType]=this._getExistingOrDefaultContentTypeHeader(A,d.ApplicationJson);const s=yield this.patch(e,r,A);return this._processResponse(s,this.requestOptions)})}request(e,t,A,r){return u(this,void 0,void 0,function*(){if(this._disposed){throw new Error("Client has already been disposed.")}const s=new URL(t);let o=this._prepareRequest(e,s,r);const n=this._allowRetries&&I.includes(e)?this._maxRetries+1:1;let i=0;let a;do{a=yield this.requestRaw(o,A);if(a&&a.message&&a.message.statusCode===E.Unauthorized){let e;for(const t of this.handlers){if(t.canHandleAuthentication(a)){e=t;break}}if(e){return e.handleAuthentication(this,o,A)}else{return a}}let t=this._maxRedirects;while(a.message.statusCode&&Q.includes(a.message.statusCode)&&this._allowRedirects&&t>0){const n=a.message.headers["location"];if(!n){break}const i=new URL(n);if(s.protocol==="https:"&&s.protocol!==i.protocol&&!this._allowRedirectDowngrade){throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.")}yield a.readBody();if(i.hostname!==s.hostname){for(const e in r){if(e.toLowerCase()==="authorization"){delete r[e]}}}o=this._prepareRequest(e,i,r);a=yield this.requestRaw(o,A);t--}if(!a.message.statusCode||!B.includes(a.message.statusCode)){return a}i+=1;if(i{function callbackForResult(e,t){if(e){r(e)}else if(!t){r(new Error("Unknown error"))}else{A(t)}}this.requestRawWithCallback(e,t,callbackForResult)})})}requestRawWithCallback(e,t,A){if(typeof t==="string"){if(!e.options.headers){e.options.headers={}}e.options.headers["Content-Length"]=Buffer.byteLength(t,"utf8")}let r=false;function handleResult(e,t){if(!r){r=true;A(e,t)}}const s=e.httpModule.request(e.options,e=>{const t=new HttpClientResponse(e);handleResult(undefined,t)});let o;s.on("socket",e=>{o=e});s.setTimeout(this._socketTimeout||3*6e4,()=>{if(o){o.end()}handleResult(new Error(`Request timeout: ${e.options.path}`))});s.on("error",function(e){handleResult(e)});if(t&&typeof t==="string"){s.write(t,"utf8")}if(t&&typeof t!=="string"){t.on("close",function(){s.end()});t.pipe(s)}else{s.end()}}getAgent(e){const t=new URL(e);return this._getAgent(t)}getAgentDispatcher(e){const t=new URL(e);const A=pm.getProxyUrl(t);const r=A&&A.hostname;if(!r){return}return this._getProxyAgentDispatcher(t,A)}_prepareRequest(e,t,A){const r={};r.parsedUrl=t;const s=r.parsedUrl.protocol==="https:";r.httpModule=s?https:http;const o=s?443:80;r.options={};r.options.host=r.parsedUrl.hostname;r.options.port=r.parsedUrl.port?parseInt(r.parsedUrl.port):o;r.options.path=(r.parsedUrl.pathname||"")+(r.parsedUrl.search||"");r.options.method=e;r.options.headers=this._mergeHeaders(A);if(this.userAgent!=null){r.options.headers["user-agent"]=this.userAgent}r.options.agent=this._getAgent(r.parsedUrl);if(this.handlers){for(const e of this.handlers){e.prepareRequest(r.options)}}return r}_mergeHeaders(e){if(this.requestOptions&&this.requestOptions.headers){return Object.assign({},lowercaseKeys(this.requestOptions.headers),lowercaseKeys(e||{}))}return lowercaseKeys(e||{})}_getExistingOrDefaultHeader(e,t,A){let r;if(this.requestOptions&&this.requestOptions.headers){const e=lowercaseKeys(this.requestOptions.headers)[t];if(e){r=typeof e==="number"?e.toString():e}}const s=e[t];if(s!==undefined){return typeof s==="number"?s.toString():s}if(r!==undefined){return r}return A}_getExistingOrDefaultContentTypeHeader(e,t){let A;if(this.requestOptions&&this.requestOptions.headers){const e=lowercaseKeys(this.requestOptions.headers)[h.ContentType];if(e){if(typeof e==="number"){A=String(e)}else if(Array.isArray(e)){A=e.join(", ")}else{A=e}}}const r=e[h.ContentType];if(r!==undefined){if(typeof r==="number"){return String(r)}else if(Array.isArray(r)){return r.join(", ")}else{return r}}if(A!==undefined){return A}return t}_getAgent(e){let t;const A=pm.getProxyUrl(e);const r=A&&A.hostname;if(this._keepAlive&&r){t=this._proxyAgent}if(!r){t=this._agent}if(t){return t}const s=e.protocol==="https:";let o=100;if(this.requestOptions){o=this.requestOptions.maxSockets||http.globalAgent.maxSockets}if(A&&A.hostname){const e={maxSockets:o,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(A.username||A.password)&&{proxyAuth:`${A.username}:${A.password}`}),{host:A.hostname,port:A.port})};let r;const n=A.protocol==="https:";if(s){r=n?tunnel.httpsOverHttps:tunnel.httpsOverHttp}else{r=n?tunnel.httpOverHttps:tunnel.httpOverHttp}t=r(e);this._proxyAgent=t}if(!t){const e={keepAlive:this._keepAlive,maxSockets:o};t=s?new https.Agent(e):new http.Agent(e);this._agent=t}if(s&&this._ignoreSslError){t.options=Object.assign(t.options||{},{rejectUnauthorized:false})}return t}_getProxyAgentDispatcher(e,t){let A;if(this._keepAlive){A=this._proxyAgentDispatcher}if(A){return A}const r=e.protocol==="https:";A=new ProxyAgent(Object.assign({uri:t.href,pipelining:!this._keepAlive?0:1},(t.username||t.password)&&{token:`Basic ${Buffer.from(`${t.username}:${t.password}`).toString("base64")}`}));this._proxyAgentDispatcher=A;if(r&&this._ignoreSslError){A.options=Object.assign(A.options.requestTls||{},{rejectUnauthorized:false})}return A}_getUserAgentWithOrchestrationId(e){const t=e||"actions/http-client";const A=process.env["ACTIONS_ORCHESTRATION_ID"];if(A){const e=A.replace(/[^a-z0-9_.-]/gi,"_");return`${t} actions_orchestration_id/${e}`}return t}_performExponentialBackoff(e){return u(this,void 0,void 0,function*(){e=Math.min(p,e);const t=f*Math.pow(2,e);return new Promise(e=>setTimeout(()=>e(),t))})}_processResponse(e,t){return u(this,void 0,void 0,function*(){return new Promise((A,r)=>u(this,void 0,void 0,function*(){const s=e.message.statusCode||0;const o={statusCode:s,result:null,headers:{}};if(s===E.NotFound){A(o)}function dateTimeDeserializer(e,t){if(typeof t==="string"){const e=new Date(t);if(!isNaN(e.valueOf())){return e}}return t}let n;let i;try{i=yield e.readBody();if(i&&i.length>0){if(t&&t.deserializeDates){n=JSON.parse(i,dateTimeDeserializer)}else{n=JSON.parse(i)}o.result=n}o.headers=e.message.headers}catch(e){}if(s>299){let e;if(n&&n.message){e=n.message}else if(i&&i.length>0){e=i}else{e=`Failed request: (${s})`}const t=new HttpClientError(e,s);t.result=o.result;r(t)}else{A(o)}}))})}}const lowercaseKeys=e=>Object.keys(e).reduce((t,A)=>(t[A.toLowerCase()]=e[A],t),{});var m=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A(function(t){t(e)})}return new(A||(A=Promise))(function(A,s){function fulfilled(e){try{step(r.next(e))}catch(e){s(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){s(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};class BasicCredentialHandler{constructor(e,t){this.username=e;this.password=t}prepareRequest(e){if(!e.headers){throw Error("The request has no headers")}e.headers["Authorization"]=`Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`}canHandleAuthentication(){return false}handleAuthentication(){return m(this,void 0,void 0,function*(){throw new Error("not implemented")})}}class auth_BearerCredentialHandler{constructor(e){this.token=e}prepareRequest(e){if(!e.headers){throw Error("The request has no headers")}e.headers["Authorization"]=`Bearer ${this.token}`}canHandleAuthentication(){return false}handleAuthentication(){return m(this,void 0,void 0,function*(){throw new Error("not implemented")})}}class PersonalAccessTokenCredentialHandler{constructor(e){this.token=e}prepareRequest(e){if(!e.headers){throw Error("The request has no headers")}e.headers["Authorization"]=`Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`}canHandleAuthentication(){return false}handleAuthentication(){return m(this,void 0,void 0,function*(){throw new Error("not implemented")})}}var w=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A(function(t){t(e)})}return new(A||(A=Promise))(function(A,s){function fulfilled(e){try{step(r.next(e))}catch(e){s(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){s(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};class oidc_utils_OidcClient{static createHttpClient(e=true,t=10){const A={allowRetries:e,maxRetries:t};return new HttpClient("actions/oidc-client",[new BearerCredentialHandler(oidc_utils_OidcClient.getRequestToken())],A)}static getRequestToken(){const e=process.env["ACTIONS_ID_TOKEN_REQUEST_TOKEN"];if(!e){throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable")}return e}static getIDTokenUrl(){const e=process.env["ACTIONS_ID_TOKEN_REQUEST_URL"];if(!e){throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable")}return e}static getCall(e){return w(this,void 0,void 0,function*(){var t;const A=oidc_utils_OidcClient.createHttpClient();const r=yield A.getJson(e).catch(e=>{throw new Error(`Failed to get ID Token. \n \n Error Code : ${e.statusCode}\n \n Error Message: ${e.message}`)});const s=(t=r.result)===null||t===void 0?void 0:t.value;if(!s){throw new Error("Response json body do not have ID Token field")}return s})}static getIDToken(e){return w(this,void 0,void 0,function*(){try{let t=oidc_utils_OidcClient.getIDTokenUrl();if(e){const A=encodeURIComponent(e);t=`${t}&audience=${A}`}debug(`ID token url is ${t}`);const A=yield oidc_utils_OidcClient.getCall(t);setSecret(A);return A}catch(e){throw new Error(`Error message: ${e.message}`)}})}}var y=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A(function(t){t(e)})}return new(A||(A=Promise))(function(A,s){function fulfilled(e){try{step(r.next(e))}catch(e){s(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){s(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};const{access:b,appendFile:k,writeFile:D}=n.promises;const R="GITHUB_STEP_SUMMARY";const T="https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";class Summary{constructor(){this._buffer=""}filePath(){return y(this,void 0,void 0,function*(){if(this._filePath){return this._filePath}const e=process.env[R];if(!e){throw new Error(`Unable to find environment variable for $${R}. Check if your runtime environment supports job summaries.`)}try{yield b(e,n.constants.R_OK|n.constants.W_OK)}catch(t){throw new Error(`Unable to access summary file: '${e}'. Check if the file has correct read/write permissions.`)}this._filePath=e;return this._filePath})}wrap(e,t,A={}){const r=Object.entries(A).map(([e,t])=>` ${e}="${t}"`).join("");if(!t){return`<${e}${r}>`}return`<${e}${r}>${t}`}write(e){return y(this,void 0,void 0,function*(){const t=!!(e===null||e===void 0?void 0:e.overwrite);const A=yield this.filePath();const r=t?D:k;yield r(A,this._buffer,{encoding:"utf8"});return this.emptyBuffer()})}clear(){return y(this,void 0,void 0,function*(){return this.emptyBuffer().write({overwrite:true})})}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){this._buffer="";return this}addRaw(e,t=false){this._buffer+=e;return t?this.addEOL():this}addEOL(){return this.addRaw(r.EOL)}addCodeBlock(e,t){const A=Object.assign({},t&&{lang:t});const r=this.wrap("pre",this.wrap("code",e),A);return this.addRaw(r).addEOL()}addList(e,t=false){const A=t?"ol":"ul";const r=e.map(e=>this.wrap("li",e)).join("");const s=this.wrap(A,r);return this.addRaw(s).addEOL()}addTable(e){const t=e.map(e=>{const t=e.map(e=>{if(typeof e==="string"){return this.wrap("td",e)}const{header:t,data:A,colspan:r,rowspan:s}=e;const o=t?"th":"td";const n=Object.assign(Object.assign({},r&&{colspan:r}),s&&{rowspan:s});return this.wrap(o,A,n)}).join("");return this.wrap("tr",t)}).join("");const A=this.wrap("table",t);return this.addRaw(A).addEOL()}addDetails(e,t){const A=this.wrap("details",this.wrap("summary",e)+t);return this.addRaw(A).addEOL()}addImage(e,t,A){const{width:r,height:s}=A||{};const o=Object.assign(Object.assign({},r&&{width:r}),s&&{height:s});const n=this.wrap("img",null,Object.assign({src:e,alt:t},o));return this.addRaw(n).addEOL()}addHeading(e,t){const A=`h${t}`;const r=["h1","h2","h3","h4","h5","h6"].includes(A)?A:"h1";const s=this.wrap(r,e);return this.addRaw(s).addEOL()}addSeparator(){const e=this.wrap("hr",null);return this.addRaw(e).addEOL()}addBreak(){const e=this.wrap("br",null);return this.addRaw(e).addEOL()}addQuote(e,t){const A=Object.assign({},t&&{cite:t});const r=this.wrap("blockquote",e,A);return this.addRaw(r).addEOL()}addLink(e,t){const A=this.wrap("a",e,{href:t});return this.addRaw(A).addEOL()}}const F=new Summary;const S=null&&F;const U=null&&F;function toPosixPath(e){return e.replace(/[\\]/g,"/")}function toWin32Path(e){return e.replace(/[/]/g,"\\")}function toPlatformPath(e){return e.replace(/[/\\]/g,path.sep)}var N=__nccwpck_require__(3193);var M=__nccwpck_require__(4434);var G=__nccwpck_require__(2613);var L=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A(function(t){t(e)})}return new(A||(A=Promise))(function(A,s){function fulfilled(e){try{step(r.next(e))}catch(e){s(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){s(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};const{chmod:v,copyFile:H,lstat:_,mkdir:O,open:Y,readdir:P,rename:x,rm:J,rmdir:V,stat:W,symlink:q,unlink:z}=n.promises;const j=process.platform==="win32";function readlink(e){return L(this,void 0,void 0,function*(){const t=yield fs.promises.readlink(e);if(j&&!t.endsWith("\\")){return`${t}\\`}return t})}const Z=268435456;const K=n.constants.O_RDONLY;function exists(e){return L(this,void 0,void 0,function*(){try{yield W(e)}catch(e){if(e.code==="ENOENT"){return false}throw e}return true})}function isDirectory(e){return L(this,arguments,void 0,function*(e,t=false){const A=t?yield W(e):yield _(e);return A.isDirectory()})}function isRooted(e){e=normalizeSeparators(e);if(!e){throw new Error('isRooted() parameter "p" cannot be empty')}if(j){return e.startsWith("\\")||/^[A-Z]:/i.test(e)}return e.startsWith("/")}function tryGetExecutablePath(e,t){return L(this,void 0,void 0,function*(){let A=undefined;try{A=yield W(e)}catch(t){if(t.code!=="ENOENT"){console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${t}`)}}if(A&&A.isFile()){if(j){const A=i.extname(e).toUpperCase();if(t.some(e=>e.toUpperCase()===A)){return e}}else{if(isUnixExecutable(A)){return e}}}const r=e;for(const s of t){e=r+s;A=undefined;try{A=yield W(e)}catch(t){if(t.code!=="ENOENT"){console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${t}`)}}if(A&&A.isFile()){if(j){try{const t=i.dirname(e);const A=i.basename(e).toUpperCase();for(const r of yield P(t)){if(A===r.toUpperCase()){e=i.join(t,r);break}}}catch(t){console.log(`Unexpected error attempting to determine the actual case of the file '${e}': ${t}`)}return e}else{if(isUnixExecutable(A)){return e}}}}return""})}function normalizeSeparators(e){e=e||"";if(j){e=e.replace(/\//g,"\\");return e.replace(/\\\\+/g,"\\")}return e.replace(/\/\/+/g,"/")}function isUnixExecutable(e){return(e.mode&1)>0||(e.mode&8)>0&&process.getgid!==undefined&&e.gid===process.getgid()||(e.mode&64)>0&&process.getuid!==undefined&&e.uid===process.getuid()}function getCmdPath(){var e;return(e=process.env["COMSPEC"])!==null&&e!==void 0?e:`cmd.exe`}var X=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A(function(t){t(e)})}return new(A||(A=Promise))(function(A,s){function fulfilled(e){try{step(r.next(e))}catch(e){s(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){s(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};function cp(e,t){return X(this,arguments,void 0,function*(e,t,A={}){const{force:r,recursive:s,copySourceDirectory:o}=readCopyOptions(A);const n=(yield ioUtil.exists(t))?yield ioUtil.stat(t):null;if(n&&n.isFile()&&!r){return}const i=n&&n.isDirectory()&&o?path.join(t,path.basename(e)):t;if(!(yield ioUtil.exists(e))){throw new Error(`no such file or directory: ${e}`)}const a=yield ioUtil.stat(e);if(a.isDirectory()){if(!s){throw new Error(`Failed to copy. ${e} is a directory, but tried to copy without recursive flag.`)}else{yield cpDirRecursive(e,i,0,r)}}else{if(path.relative(e,i)===""){throw new Error(`'${i}' and '${e}' are the same file`)}yield io_copyFile(e,i,r)}})}function mv(e,t){return X(this,arguments,void 0,function*(e,t,A={}){if(yield ioUtil.exists(t)){let r=true;if(yield ioUtil.isDirectory(t)){t=path.join(t,path.basename(e));r=yield ioUtil.exists(t)}if(r){if(A.force==null||A.force){yield rmRF(t)}else{throw new Error("Destination already exists")}}}yield mkdirP(path.dirname(t));yield ioUtil.rename(e,t)})}function rmRF(e){return X(this,void 0,void 0,function*(){if(ioUtil.IS_WINDOWS){if(/[*"<>|]/.test(e)){throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows')}}try{yield ioUtil.rm(e,{force:true,maxRetries:3,recursive:true,retryDelay:300})}catch(e){throw new Error(`File was unable to be removed ${e}`)}})}function mkdirP(e){return X(this,void 0,void 0,function*(){ok(e,"a path argument must be provided");yield ioUtil.mkdir(e,{recursive:true})})}function which(e,t){return X(this,void 0,void 0,function*(){if(!e){throw new Error("parameter 'tool' is required")}if(t){const t=yield which(e,false);if(!t){if(j){throw new Error(`Unable to locate executable file: ${e}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`)}else{throw new Error(`Unable to locate executable file: ${e}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`)}}return t}const A=yield findInPath(e);if(A&&A.length>0){return A[0]}return""})}function findInPath(e){return X(this,void 0,void 0,function*(){if(!e){throw new Error("parameter 'tool' is required")}const t=[];if(j&&process.env["PATHEXT"]){for(const e of process.env["PATHEXT"].split(i.delimiter)){if(e){t.push(e)}}}if(isRooted(e)){const A=yield tryGetExecutablePath(e,t);if(A){return[A]}return[]}if(e.includes(i.sep)){return[]}const A=[];if(process.env.PATH){for(const e of process.env.PATH.split(i.delimiter)){if(e){A.push(e)}}}const r=[];for(const s of A){const A=yield tryGetExecutablePath(i.join(s,e),t);if(A){r.push(A)}}return r})}function readCopyOptions(e){const t=e.force==null?true:e.force;const A=Boolean(e.recursive);const r=e.copySourceDirectory==null?true:Boolean(e.copySourceDirectory);return{force:t,recursive:A,copySourceDirectory:r}}function cpDirRecursive(e,t,A,r){return X(this,void 0,void 0,function*(){if(A>=255)return;A++;yield mkdirP(t);const s=yield ioUtil.readdir(e);for(const o of s){const s=`${e}/${o}`;const n=`${t}/${o}`;const i=yield ioUtil.lstat(s);if(i.isDirectory()){yield cpDirRecursive(s,n,A,r)}else{yield io_copyFile(s,n,r)}}yield ioUtil.chmod(t,(yield ioUtil.stat(e)).mode)})}function io_copyFile(e,t,A){return X(this,void 0,void 0,function*(){if((yield ioUtil.lstat(e)).isSymbolicLink()){try{yield ioUtil.lstat(t);yield ioUtil.unlink(t)}catch(e){if(e.code==="EPERM"){yield ioUtil.chmod(t,"0666");yield ioUtil.unlink(t)}}const A=yield ioUtil.readlink(e);yield ioUtil.symlink(A,t,ioUtil.IS_WINDOWS?"junction":null)}else if(!(yield ioUtil.exists(t))||A){yield ioUtil.copyFile(e,t)}})}const $=require("timers");var ee=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A(function(t){t(e)})}return new(A||(A=Promise))(function(A,s){function fulfilled(e){try{step(r.next(e))}catch(e){s(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){s(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};const te=process.platform==="win32";class ToolRunner extends M.EventEmitter{constructor(e,t,A){super();if(!e){throw new Error("Parameter 'toolPath' cannot be null or empty.")}this.toolPath=e;this.args=t||[];this.options=A||{}}_debug(e){if(this.options.listeners&&this.options.listeners.debug){this.options.listeners.debug(e)}}_getCommandString(e,t){const A=this._getSpawnFileName();const r=this._getSpawnArgs(e);let s=t?"":"[command]";if(te){if(this._isCmdFile()){s+=A;for(const e of r){s+=` ${e}`}}else if(e.windowsVerbatimArguments){s+=`"${A}"`;for(const e of r){s+=` ${e}`}}else{s+=this._windowsQuoteCmdArg(A);for(const e of r){s+=` ${this._windowsQuoteCmdArg(e)}`}}}else{s+=A;for(const e of r){s+=` ${e}`}}return s}_processLineBuffer(e,t,A){try{let s=t+e.toString();let o=s.indexOf(r.EOL);while(o>-1){const e=s.substring(0,o);A(e);s=s.substring(o+r.EOL.length);o=s.indexOf(r.EOL)}return s}catch(e){this._debug(`error processing line. Failed with error ${e}`);return""}}_getSpawnFileName(){if(te){if(this._isCmdFile()){return process.env["COMSPEC"]||"cmd.exe"}}return this.toolPath}_getSpawnArgs(e){if(te){if(this._isCmdFile()){let t=`/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;for(const A of this.args){t+=" ";t+=e.windowsVerbatimArguments?A:this._windowsQuoteCmdArg(A)}t+='"';return[t]}}return this.args}_endsWith(e,t){return e.endsWith(t)}_isCmdFile(){const e=this.toolPath.toUpperCase();return this._endsWith(e,".CMD")||this._endsWith(e,".BAT")}_windowsQuoteCmdArg(e){if(!this._isCmdFile()){return this._uvQuoteCmdArg(e)}if(!e){return'""'}const t=[" ","\t","&","(",")","[","]","{","}","^","=",";","!","'","+",",","`","~","|","<",">",'"'];let A=false;for(const r of e){if(t.some(e=>e===r)){A=true;break}}if(!A){return e}let r='"';let s=true;for(let t=e.length;t>0;t--){r+=e[t-1];if(s&&e[t-1]==="\\"){r+="\\"}else if(e[t-1]==='"'){s=true;r+='"'}else{s=false}}r+='"';return r.split("").reverse().join("")}_uvQuoteCmdArg(e){if(!e){return'""'}if(!e.includes(" ")&&!e.includes("\t")&&!e.includes('"')){return e}if(!e.includes('"')&&!e.includes("\\")){return`"${e}"`}let t='"';let A=true;for(let r=e.length;r>0;r--){t+=e[r-1];if(A&&e[r-1]==="\\"){t+="\\"}else if(e[r-1]==='"'){A=true;t+="\\"}else{A=false}}t+='"';return t.split("").reverse().join("")}_cloneExecOptions(e){e=e||{};const t={cwd:e.cwd||process.cwd(),env:e.env||process.env,silent:e.silent||false,windowsVerbatimArguments:e.windowsVerbatimArguments||false,failOnStdErr:e.failOnStdErr||false,ignoreReturnCode:e.ignoreReturnCode||false,delay:e.delay||1e4};t.outStream=e.outStream||process.stdout;t.errStream=e.errStream||process.stderr;return t}_getSpawnOptions(e,t){e=e||{};const A={};A.cwd=e.cwd;A.env=e.env;A["windowsVerbatimArguments"]=e.windowsVerbatimArguments||this._isCmdFile();if(e.windowsVerbatimArguments){A.argv0=`"${t}"`}return A}exec(){return ee(this,void 0,void 0,function*(){if(!isRooted(this.toolPath)&&(this.toolPath.includes("/")||te&&this.toolPath.includes("\\"))){this.toolPath=i.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)}this.toolPath=yield which(this.toolPath,true);return new Promise((e,t)=>ee(this,void 0,void 0,function*(){this._debug(`exec tool: ${this.toolPath}`);this._debug("arguments:");for(const e of this.args){this._debug(` ${e}`)}const s=this._cloneExecOptions(this.options);if(!s.silent&&s.outStream){s.outStream.write(this._getCommandString(s)+r.EOL)}const o=new ExecState(s,this.toolPath);o.on("debug",e=>{this._debug(e)});if(this.options.cwd&&!(yield exists(this.options.cwd))){return t(new Error(`The cwd: ${this.options.cwd} does not exist!`))}const n=this._getSpawnFileName();const i=A.spawn(n,this._getSpawnArgs(s),this._getSpawnOptions(this.options,n));let a="";if(i.stdout){i.stdout.on("data",e=>{if(this.options.listeners&&this.options.listeners.stdout){this.options.listeners.stdout(e)}if(!s.silent&&s.outStream){s.outStream.write(e)}a=this._processLineBuffer(e,a,e=>{if(this.options.listeners&&this.options.listeners.stdline){this.options.listeners.stdline(e)}})})}let c="";if(i.stderr){i.stderr.on("data",e=>{o.processStderr=true;if(this.options.listeners&&this.options.listeners.stderr){this.options.listeners.stderr(e)}if(!s.silent&&s.errStream&&s.outStream){const t=s.failOnStdErr?s.errStream:s.outStream;t.write(e)}c=this._processLineBuffer(e,c,e=>{if(this.options.listeners&&this.options.listeners.errline){this.options.listeners.errline(e)}})})}i.on("error",e=>{o.processError=e.message;o.processExited=true;o.processClosed=true;o.CheckComplete()});i.on("exit",e=>{o.processExitCode=e;o.processExited=true;this._debug(`Exit code ${e} received from tool '${this.toolPath}'`);o.CheckComplete()});i.on("close",e=>{o.processExitCode=e;o.processExited=true;o.processClosed=true;this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);o.CheckComplete()});o.on("done",(A,r)=>{if(a.length>0){this.emit("stdline",a)}if(c.length>0){this.emit("errline",c)}i.removeAllListeners();if(A){t(A)}else{e(r)}});if(this.options.input){if(!i.stdin){throw new Error("child process missing stdin")}i.stdin.end(this.options.input)}}))})}}function argStringToArray(e){const t=[];let A=false;let r=false;let s="";function append(e){if(r&&e!=='"'){s+="\\"}s+=e;r=false}for(let o=0;o0){t.push(s);s=""}continue}append(n)}if(s.length>0){t.push(s.trim())}return t}class ExecState extends M.EventEmitter{constructor(e,t){super();this.processClosed=false;this.processError="";this.processExitCode=0;this.processExited=false;this.processStderr=false;this.delay=1e4;this.done=false;this.timeout=null;if(!t){throw new Error("toolPath must not be empty")}this.options=e;this.toolPath=t;if(e.delay){this.delay=e.delay}}CheckComplete(){if(this.done){return}if(this.processClosed){this._setResult()}else if(this.processExited){this.timeout=(0,$.setTimeout)(ExecState.HandleTimeout,this.delay,this)}}_debug(e){this.emit("debug",e)}_setResult(){let e;if(this.processExited){if(this.processError){e=new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`)}else if(this.processExitCode!==0&&!this.options.ignoreReturnCode){e=new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`)}else if(this.processStderr&&this.options.failOnStdErr){e=new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`)}}if(this.timeout){clearTimeout(this.timeout);this.timeout=null}this.done=true;this.emit("done",e,this.processExitCode)}static HandleTimeout(e){if(e.done){return}if(!e.processClosed&&e.processExited){const t=`The STDIO streams did not close within ${e.delay/1e3} seconds of the exit event from process '${e.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;e._debug(t)}e._setResult()}}var Ae=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A(function(t){t(e)})}return new(A||(A=Promise))(function(A,s){function fulfilled(e){try{step(r.next(e))}catch(e){s(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){s(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};function exec_exec(e,t,A){return Ae(this,void 0,void 0,function*(){const r=argStringToArray(e);if(r.length===0){throw new Error(`Parameter 'commandLine' cannot be null or empty.`)}const s=r[0];t=r.slice(1).concat(t||[]);const o=new ToolRunner(s,t,A);return o.exec()})}function getExecOutput(e,t,A){return Ae(this,void 0,void 0,function*(){var r,s;let o="";let n="";const i=new StringDecoder("utf8");const a=new StringDecoder("utf8");const c=(r=A===null||A===void 0?void 0:A.listeners)===null||r===void 0?void 0:r.stdout;const l=(s=A===null||A===void 0?void 0:A.listeners)===null||s===void 0?void 0:s.stderr;const stdErrListener=e=>{n+=a.write(e);if(l){l(e)}};const stdOutListener=e=>{o+=i.write(e);if(c){c(e)}};const g=Object.assign(Object.assign({},A===null||A===void 0?void 0:A.listeners),{stdout:stdOutListener,stderr:stdErrListener});const u=yield exec_exec(e,t,Object.assign(Object.assign({},A),{listeners:g}));o+=i.end();n+=a.end();return{exitCode:u,stdout:o,stderr:n}})}var re=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A(function(t){t(e)})}return new(A||(A=Promise))(function(A,s){function fulfilled(e){try{step(r.next(e))}catch(e){s(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){s(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};const getWindowsInfo=()=>re(void 0,void 0,void 0,function*(){const{stdout:e}=yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"',undefined,{silent:true});const{stdout:t}=yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"',undefined,{silent:true});return{name:t.trim(),version:e.trim()}});const getMacOsInfo=()=>re(void 0,void 0,void 0,function*(){var e,t,A,r;const{stdout:s}=yield exec.getExecOutput("sw_vers",undefined,{silent:true});const o=(t=(e=s.match(/ProductVersion:\s*(.+)/))===null||e===void 0?void 0:e[1])!==null&&t!==void 0?t:"";const n=(r=(A=s.match(/ProductName:\s*(.+)/))===null||A===void 0?void 0:A[1])!==null&&r!==void 0?r:"";return{name:n,version:o}});const getLinuxInfo=()=>re(void 0,void 0,void 0,function*(){const{stdout:e}=yield exec.getExecOutput("lsb_release",["-i","-r","-s"],{silent:true});const[t,A]=e.trim().split("\n");return{name:t,version:A}});const se=r.platform();const oe=r.arch();const ne=se==="win32";const ie=se==="darwin";const ae=se==="linux";function getDetails(){return re(this,void 0,void 0,function*(){return Object.assign(Object.assign({},yield ne?getWindowsInfo():ie?getMacOsInfo():getLinuxInfo()),{platform:se,arch:oe,isWindows:ne,isMacOS:ie,isLinux:ae})})}var ce=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A(function(t){t(e)})}return new(A||(A=Promise))(function(A,s){function fulfilled(e){try{step(r.next(e))}catch(e){s(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){s(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};var le;(function(e){e[e["Success"]=0]="Success";e[e["Failure"]=1]="Failure"})(le||(le={}));function exportVariable(e,t){const A=toCommandValue(t);process.env[e]=A;const r=process.env["GITHUB_ENV"]||"";if(r){return issueFileCommand("ENV",prepareKeyValueMessage(e,t))}issueCommand("set-env",{name:e},A)}function core_setSecret(e){issueCommand("add-mask",{},e)}function addPath(e){const t=process.env["GITHUB_PATH"]||"";if(t){issueFileCommand("PATH",e)}else{issueCommand("add-path",{},e)}process.env["PATH"]=`${e}${path.delimiter}${process.env["PATH"]}`}function getInput(e,t){const A=process.env[`INPUT_${e.replace(/ /g,"_").toUpperCase()}`]||"";if(t&&t.required&&!A){throw new Error(`Input required and not supplied: ${e}`)}if(t&&t.trimWhitespace===false){return A}return A.trim()}function getMultilineInput(e,t){const A=getInput(e,t).split("\n").filter(e=>e!=="");if(t&&t.trimWhitespace===false){return A}return A.map(e=>e.trim())}function getBooleanInput(e,t){const A=["true","True","TRUE"];const r=["false","False","FALSE"];const s=getInput(e,t);if(A.includes(s))return true;if(r.includes(s))return false;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${e}\n`+`Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}function setOutput(e,t){const A=process.env["GITHUB_OUTPUT"]||"";if(A){return file_command_issueFileCommand("OUTPUT",file_command_prepareKeyValueMessage(e,t))}process.stdout.write(r.EOL);command_issueCommand("set-output",{name:e},utils_toCommandValue(t))}function setCommandEcho(e){issue("echo",e?"on":"off")}function setFailed(e){process.exitCode=le.Failure;error(e)}function isDebug(){return process.env["RUNNER_DEBUG"]==="1"}function core_debug(e){issueCommand("debug",{},e)}function error(e,t={}){command_issueCommand("error",utils_toCommandProperties(t),e instanceof Error?e.toString():e)}function warning(e,t={}){command_issueCommand("warning",utils_toCommandProperties(t),e instanceof Error?e.toString():e)}function notice(e,t={}){issueCommand("notice",toCommandProperties(t),e instanceof Error?e.toString():e)}function info(e){process.stdout.write(e+r.EOL)}function startGroup(e){issue("group",e)}function endGroup(){issue("endgroup")}function group(e,t){return ce(this,void 0,void 0,function*(){startGroup(e);let A;try{A=yield t()}finally{endGroup()}return A})}function saveState(e,t){const A=process.env["GITHUB_STATE"]||"";if(A){return issueFileCommand("STATE",prepareKeyValueMessage(e,t))}issueCommand("save-state",{name:e},toCommandValue(t))}function getState(e){return process.env[`STATE_${e}`]||""}function getIDToken(e){return ce(this,void 0,void 0,function*(){return yield OidcClient.getIDToken(e)})}class Context{constructor(){var e,t,A;this.payload={};if(process.env.GITHUB_EVENT_PATH){if((0,n.existsSync)(process.env.GITHUB_EVENT_PATH)){this.payload=JSON.parse((0,n.readFileSync)(process.env.GITHUB_EVENT_PATH,{encoding:"utf8"}))}else{const e=process.env.GITHUB_EVENT_PATH;process.stdout.write(`GITHUB_EVENT_PATH ${e} does not exist${r.EOL}`)}}this.eventName=process.env.GITHUB_EVENT_NAME;this.sha=process.env.GITHUB_SHA;this.ref=process.env.GITHUB_REF;this.workflow=process.env.GITHUB_WORKFLOW;this.action=process.env.GITHUB_ACTION;this.actor=process.env.GITHUB_ACTOR;this.job=process.env.GITHUB_JOB;this.runAttempt=parseInt(process.env.GITHUB_RUN_ATTEMPT,10);this.runNumber=parseInt(process.env.GITHUB_RUN_NUMBER,10);this.runId=parseInt(process.env.GITHUB_RUN_ID,10);this.apiUrl=(e=process.env.GITHUB_API_URL)!==null&&e!==void 0?e:`https://api.github.com`;this.serverUrl=(t=process.env.GITHUB_SERVER_URL)!==null&&t!==void 0?t:`https://github.com`;this.graphqlUrl=(A=process.env.GITHUB_GRAPHQL_URL)!==null&&A!==void 0?A:`https://api.github.com/graphql`}get issue(){const e=this.payload;return Object.assign(Object.assign({},this.repo),{number:(e.issue||e.pull_request||e).number})}get repo(){if(process.env.GITHUB_REPOSITORY){const[e,t]=process.env.GITHUB_REPOSITORY.split("/");return{owner:e,repo:t}}if(this.payload.repository){return{owner:this.payload.repository.owner.login,repo:this.payload.repository.name}}throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'")}}var ge=__nccwpck_require__(9659);var ue=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A(function(t){t(e)})}return new(A||(A=Promise))(function(A,s){function fulfilled(e){try{step(r.next(e))}catch(e){s(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){s(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};function getAuthString(e,t){if(!e&&!t.auth){throw new Error("Parameter token or opts.auth is required")}else if(e&&t.auth){throw new Error("Parameters token and opts.auth may not both be specified")}return typeof t.auth==="string"?t.auth:`token ${e}`}function getProxyAgent(e){const t=new ge.HttpClient;return t.getAgent(e)}function getProxyAgentDispatcher(e){const t=new ge.HttpClient;return t.getAgentDispatcher(e)}function getProxyFetch(e){const t=getProxyAgentDispatcher(e);const proxyFetch=(e,A)=>ue(this,void 0,void 0,function*(){return(0,g.fetch)(e,Object.assign(Object.assign({},A),{dispatcher:t}))});return proxyFetch}function getApiBaseUrl(){return process.env["GITHUB_API_URL"]||"https://api.github.com"}function getUserAgentWithOrchestrationId(e){var t;const A=(t=process.env["ACTIONS_ORCHESTRATION_ID"])===null||t===void 0?void 0:t.trim();if(A){const t=A.replace(/[^a-z0-9_.-]/gi,"_");const r=`actions_orchestration_id/${t}`;if(e===null||e===void 0?void 0:e.includes(r))return e;const s=e?`${e} `:"";return`${s}${r}`}return e}function getUserAgent(){if(typeof navigator==="object"&&"userAgent"in navigator){return navigator.userAgent}if(typeof process==="object"&&process.version!==undefined){return`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`}return""}function register(e,t,A,r){if(typeof A!=="function"){throw new Error("method for before hook must be a function")}if(!r){r={}}if(Array.isArray(t)){return t.reverse().reduce((t,A)=>register.bind(null,e,A,t,r),A)()}return Promise.resolve().then(()=>{if(!e.registry[t]){return A(r)}return e.registry[t].reduce((e,t)=>t.hook.bind(null,e,r),A)()})}function addHook(e,t,A,r){const s=r;if(!e.registry[A]){e.registry[A]=[]}if(t==="before"){r=(e,t)=>Promise.resolve().then(s.bind(null,t)).then(e.bind(null,t))}if(t==="after"){r=(e,t)=>{let A;return Promise.resolve().then(e.bind(null,t)).then(e=>{A=e;return s(A,t)}).then(()=>A)}}if(t==="error"){r=(e,t)=>Promise.resolve().then(e.bind(null,t)).catch(e=>s(e,t))}e.registry[A].push({hook:r,orig:s})}function removeHook(e,t,A){if(!e.registry[t]){return}const r=e.registry[t].map(e=>e.orig).indexOf(A);if(r===-1){return}e.registry[t].splice(r,1)}const Ee=Function.bind;const he=Ee.bind(Ee);function bindApi(e,t,A){const r=he(removeHook,null).apply(null,A?[t,A]:[t]);e.api={remove:r};e.remove=r;["before","error","after","wrap"].forEach(r=>{const s=A?[t,r,A]:[t,r];e[r]=e.api[r]=he(addHook,null).apply(null,s)})}function Singular(){const e=Symbol("Singular");const t={registry:{}};const A=register.bind(null,t,e);bindApi(A,t,e);return A}function Collection(){const e={registry:{}};const t=register.bind(null,e);bindApi(t,e);return t}const de={Singular:Singular,Collection:Collection};var Qe="0.0.0-development";var Ce=`octokit-endpoint.js/${Qe} ${getUserAgent()}`;var Be={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":Ce},mediaType:{format:""}};function dist_bundle_lowercaseKeys(e){if(!e){return{}}return Object.keys(e).reduce((t,A)=>{t[A.toLowerCase()]=e[A];return t},{})}function isPlainObject(e){if(typeof e!=="object"||e===null)return false;if(Object.prototype.toString.call(e)!=="[object Object]")return false;const t=Object.getPrototypeOf(e);if(t===null)return true;const A=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof A==="function"&&A instanceof A&&Function.prototype.call(A)===Function.prototype.call(e)}function mergeDeep(e,t){const A=Object.assign({},e);Object.keys(t).forEach(r=>{if(isPlainObject(t[r])){if(!(r in e))Object.assign(A,{[r]:t[r]});else A[r]=mergeDeep(e[r],t[r])}else{Object.assign(A,{[r]:t[r]})}});return A}function removeUndefinedProperties(e){for(const t in e){if(e[t]===void 0){delete e[t]}}return e}function merge(e,t,A){if(typeof t==="string"){let[e,r]=t.split(" ");A=Object.assign(r?{method:e,url:r}:{url:e},A)}else{A=Object.assign({},t)}A.headers=dist_bundle_lowercaseKeys(A.headers);removeUndefinedProperties(A);removeUndefinedProperties(A.headers);const r=mergeDeep(e||{},A);if(A.url==="/graphql"){if(e&&e.mediaType.previews?.length){r.mediaType.previews=e.mediaType.previews.filter(e=>!r.mediaType.previews.includes(e)).concat(r.mediaType.previews)}r.mediaType.previews=(r.mediaType.previews||[]).map(e=>e.replace(/-preview/,""))}return r}function addQueryParameters(e,t){const A=/\?/.test(e)?"&":"?";const r=Object.keys(t);if(r.length===0){return e}return e+A+r.map(e=>{if(e==="q"){return"q="+t.q.split("+").map(encodeURIComponent).join("+")}return`${e}=${encodeURIComponent(t[e])}`}).join("&")}var Ie=/\{[^{}}]+\}/g;function removeNonChars(e){return e.replace(/(?:^\W+)|(?:(?e.concat(t),[])}function omit(e,t){const A={__proto__:null};for(const r of Object.keys(e)){if(t.indexOf(r)===-1){A[r]=e[r]}}return A}function encodeReserved(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(e){if(!/%[0-9A-Fa-f]/.test(e)){e=encodeURI(e).replace(/%5B/g,"[").replace(/%5D/g,"]")}return e}).join("")}function encodeUnreserved(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function encodeValue(e,t,A){t=e==="+"||e==="#"?encodeReserved(t):encodeUnreserved(t);if(A){return encodeUnreserved(A)+"="+t}else{return t}}function isDefined(e){return e!==void 0&&e!==null}function isKeyOperator(e){return e===";"||e==="&"||e==="?"}function getValues(e,t,A,r){var s=e[A],o=[];if(isDefined(s)&&s!==""){if(typeof s==="string"||typeof s==="number"||typeof s==="bigint"||typeof s==="boolean"){s=s.toString();if(r&&r!=="*"){s=s.substring(0,parseInt(r,10))}o.push(encodeValue(t,s,isKeyOperator(t)?A:""))}else{if(r==="*"){if(Array.isArray(s)){s.filter(isDefined).forEach(function(e){o.push(encodeValue(t,e,isKeyOperator(t)?A:""))})}else{Object.keys(s).forEach(function(e){if(isDefined(s[e])){o.push(encodeValue(t,s[e],e))}})}}else{const e=[];if(Array.isArray(s)){s.filter(isDefined).forEach(function(A){e.push(encodeValue(t,A))})}else{Object.keys(s).forEach(function(A){if(isDefined(s[A])){e.push(encodeUnreserved(A));e.push(encodeValue(t,s[A].toString()))}})}if(isKeyOperator(t)){o.push(encodeUnreserved(A)+"="+e.join(","))}else if(e.length!==0){o.push(e.join(","))}}}}else{if(t===";"){if(isDefined(s)){o.push(encodeUnreserved(A))}}else if(s===""&&(t==="&"||t==="?")){o.push(encodeUnreserved(A)+"=")}else if(s===""){o.push("")}}return o}function parseUrl(e){return{expand:expand.bind(null,e)}}function expand(e,t){var A=["+","#",".","/",";","?","&"];e=e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(e,r,s){if(r){let e="";const s=[];if(A.indexOf(r.charAt(0))!==-1){e=r.charAt(0);r=r.substr(1)}r.split(/,/g).forEach(function(A){var r=/([^:\*]*)(?::(\d+)|(\*))?/.exec(A);s.push(getValues(t,e,r[1],r[2]||r[3]))});if(e&&e!=="+"){var o=",";if(e==="?"){o="&"}else if(e!=="#"){o=e}return(s.length!==0?e:"")+s.join(o)}else{return s.join(",")}}else{return encodeReserved(s)}});if(e==="/"){return e}else{return e.replace(/\/$/,"")}}function parse(e){let t=e.method.toUpperCase();let A=(e.url||"/").replace(/:([a-z]\w+)/g,"{$1}");let r=Object.assign({},e.headers);let s;let o=omit(e,["method","baseUrl","url","headers","request","mediaType"]);const n=extractUrlVariableNames(A);A=parseUrl(A).expand(o);if(!/^http/.test(A)){A=e.baseUrl+A}const i=Object.keys(e).filter(e=>n.includes(e)).concat("baseUrl");const a=omit(o,i);const c=/application\/octet-stream/i.test(r.accept);if(!c){if(e.mediaType.format){r.accept=r.accept.split(/,/).map(t=>t.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${e.mediaType.format}`)).join(",")}if(A.endsWith("/graphql")){if(e.mediaType.previews?.length){const t=r.accept.match(/(?{const A=e.mediaType.format?`.${e.mediaType.format}`:"+json";return`application/vnd.github.${t}-preview${A}`}).join(",")}}}if(["GET","HEAD"].includes(t)){A=addQueryParameters(A,a)}else{if("data"in a){s=a.data}else{if(Object.keys(a).length){s=a}}}if(!r["content-type"]&&typeof s!=="undefined"){r["content-type"]="application/json; charset=utf-8"}if(["PATCH","PUT"].includes(t)&&typeof s==="undefined"){s=""}return Object.assign({method:t,url:A,headers:r},typeof s!=="undefined"?{body:s}:null,e.request?{request:e.request}:null)}function endpointWithDefaults(e,t,A){return parse(merge(e,t,A))}function withDefaults(e,t){const A=merge(e,t);const r=endpointWithDefaults.bind(null,A);return Object.assign(r,{DEFAULTS:A,defaults:withDefaults.bind(null,A),merge:merge.bind(null,A),parse:parse})}var pe=withDefaults(null,Be);var fe=__nccwpck_require__(4649);const me=/^-?\d+$/;const we=/^-?\d+n+$/;const ye=JSON.stringify;const be=JSON.parse;const ke=/^-?\d+n$/;const De=/([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g;const Re=/([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g;const JSONStringify=(e,t,A)=>{if("rawJSON"in JSON){return ye(e,(e,A)=>{if(typeof A==="bigint")return JSON.rawJSON(A.toString());if(typeof t==="function")return t(e,A);if(Array.isArray(t)&&t.includes(e))return A;return A},A)}if(!e)return ye(e,t,A);const r=ye(e,(e,A)=>{const r=typeof A==="string"&&we.test(A);if(r)return A.toString()+"n";if(typeof A==="bigint")return A.toString()+"n";if(typeof t==="function")return t(e,A);if(Array.isArray(t)&&t.includes(e))return A;return A},A);const s=r.replace(De,"$1$2$3");const o=s.replace(Re,"$1$2$3");return o};const Te=new Map;const isContextSourceSupported=()=>{const e=JSON.parse.toString();if(Te.has(e)){return Te.get(e)}try{const t=JSON.parse("1",(e,t,A)=>!!A?.source&&A.source==="1");Te.set(e,t);return t}catch{Te.set(e,false);return false}};const convertMarkedBigIntsReviver=(e,t,A,r)=>{const s=typeof t==="string"&&ke.test(t);if(s)return BigInt(t.slice(0,-1));const o=typeof t==="string"&&we.test(t);if(o)return t.slice(0,-1);if(typeof r!=="function")return t;return r(e,t,A)};const JSONParseV2=(e,t)=>JSON.parse(e,(e,A,r)=>{const s=typeof A==="number"&&(A>Number.MAX_SAFE_INTEGER||A{if(!e)return be(e,t);if(isContextSourceSupported())return JSONParseV2(e,t);const A=e.replace(Ue,(e,t,A,r)=>{const s=e[0]==='"';const o=s&&Ne.test(e);if(o)return e.substring(0,e.length-1)+'n"';const n=A||r;const i=t&&(t.lengthconvertMarkedBigIntsReviver(e,A,r,t))};class RequestError extends Error{name;status;request;response;constructor(e,t,A){super(e,{cause:A.cause});this.name="HttpError";this.status=Number.parseInt(t);if(Number.isNaN(this.status)){this.status=0} -/* v8 ignore else -- @preserve -- Bug with vitest coverage where it sees an else branch that doesn't exist */if("response"in A){this.response=A.response}const r=Object.assign({},A.request);if(A.request.headers.authorization){r.headers=Object.assign({},A.request.headers,{authorization:A.request.headers.authorization.replace(/(?"";async function fetchWrapper(e){const t=e.request?.fetch||globalThis.fetch;if(!t){throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing")}const A=e.request?.log||console;const r=e.request?.parseSuccessResponseBody!==false;const s=dist_bundle_isPlainObject(e.body)||Array.isArray(e.body)?JSONStringify(e.body):e.body;const o=Object.fromEntries(Object.entries(e.headers).map(([e,t])=>[e,String(t)]));let n;try{n=await t(e.url,{method:e.method,body:s,redirect:e.request?.redirect,headers:o,signal:e.request?.signal,...e.body&&{duplex:"half"}})}catch(t){let A="Unknown Error";if(t instanceof Error){if(t.name==="AbortError"){t.status=500;throw t}A=t.message;if(t.name==="TypeError"&&"cause"in t){if(t.cause instanceof Error){A=t.cause.message}else if(typeof t.cause==="string"){A=t.cause}}}const r=new RequestError(A,500,{request:e});r.cause=t;throw r}const i=n.status;const a=n.url;const c={};for(const[e,t]of n.headers){c[e]=t}const l={url:a,status:i,headers:c,data:""};if("deprecation"in c){const t=c.link&&c.link.match(/<([^<>]+)>; rel="deprecation"/);const r=t&&t.pop();A.warn(`[@octokit/request] "${e.method} ${e.url}" is deprecated. It is scheduled to be removed on ${c.sunset}${r?`. See ${r}`:""}`)}if(i===204||i===205){return l}if(e.method==="HEAD"){if(i<400){return l}throw new RequestError(n.statusText,i,{response:l,request:e})}if(i===304){l.data=await getResponseData(n);throw new RequestError("Not modified",i,{response:l,request:e})}if(i>=400){l.data=await getResponseData(n);throw new RequestError(toErrorMessage(l.data),i,{response:l,request:e})}l.data=r?await getResponseData(n):n.body;return l}async function getResponseData(e){const t=e.headers.get("content-type");if(!t){return e.text().catch(noop)}const A=(0,fe.qg)(t);if(isJSONResponse(A)){let t="";try{t=await e.text();return JSONParse(t)}catch(e){return t}}else if(A.type.startsWith("text/")||A.parameters.charset?.toLowerCase()==="utf-8"){return e.text().catch(noop)}else{return e.arrayBuffer().catch( + */A={value:true};A=format;t.qg=parse;const r=/^[\u0009\u0020-\u007e\u0080-\u00ff]*$/;const s=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;const o=/[\\"]/g;const n=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;const i=(()=>{const C=function(){};C.prototype=Object.create(null);return C})();function format(e){const{type:t,parameters:A}=e;if(!t||!n.test(t)){throw new TypeError(`Invalid type: ${t}`)}let r=t;if(A){for(const e of Object.keys(A)){if(!s.test(e)){throw new TypeError(`Invalid parameter name: ${e}`)}r+=`; ${e}=${qstring(A[e])}`}}return r}function parse(e,t){const A=e.length;let r=skipOWS(e,0,A);const s=r;r=skipValue(e,r,A);const o=trailingOWS(e,s,r);const n=e.slice(s,o).toLowerCase();const a=t?.parameters===false?new i:parseParameters(e,r,A);return{type:n,parameters:a}}const a=32;const c=9;const l=59;const g=61;const u=34;const E=92;function parseParameters(e,t,A){const r=new i;e:while(tt){const t=e.charCodeAt(A-1);if(t!==a&&t!==c)break;A--}return A}function qstring(e){if(s.test(e))return e;if(r.test(e))return`"${e.replace(o,"\\$&")}"`;throw new TypeError(`Invalid parameter value: ${e}`)}}};var t={};function __nccwpck_require__(A){var r=t[A];if(r!==undefined){return r.exports}var s=t[A]={exports:{}};var o=true;try{e[A].call(s.exports,s,s.exports,__nccwpck_require__);o=false}finally{if(o)delete t[A]}return s.exports}(()=>{__nccwpck_require__.n=e=>{var t=e&&e.__esModule?()=>e["default"]:()=>e;__nccwpck_require__.d(t,{a:t});return t}})();(()=>{__nccwpck_require__.d=(e,t)=>{for(var A in t){if(__nccwpck_require__.o(t,A)&&!__nccwpck_require__.o(e,A)){Object.defineProperty(e,A,{enumerable:true,get:t[A]})}}}})();(()=>{__nccwpck_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var A={};(()=>{"use strict";const e=require("fs/promises");var t=__nccwpck_require__.n(e);const A=["version-properties","gradle-properties"];const getValue=(e,t,A)=>e.inputs[t]??A??"";const getGradleLocation=e=>getValue(e,"gradle_location","app/build.gradle");const getTagPrefix=e=>getValue(e,"tag_prefix","v");const isSkippingCi=e=>getValue(e,"skip_ci","true")==="true";const getBuildNumber=e=>getValue(e,"build_number","");const getVersionStorageBackend=e=>{const t=getValue(e,"version_storage","version-properties");if(A.includes(t)){return t}throw new Error(`Invalid version storage backend "${t}". Expected one of: ${A.join(", ")}`)};const getCommitMessage=(e,t,A,r)=>{const s=`${A}${t.name}`;const o=`release: ${s}`;const n=getValue(e,"commit_message",o).replace("{{version}}",s);const i=r?"[skip-ci]":"";return`${n.length>0?n:o} ${i}`.trim()};const r=require("child_process");const s=require("os");const runCommand=async(e,t)=>{const A=process.env.GITHUB_WORKSPACE;return new Promise((o,n)=>{const i=(0,r.spawn)(e,t,{cwd:A});const a=[];let c=false;i.on("error",e=>{if(!c){c=true;n(e)}});i.stderr.on("data",e=>a.push(e));i.on("exit",t=>{if(!c){if(t===0){o()}else{n(`${a.join("")}${s.EOL}${e} exited with code ${t}`)}}})})};const setGitIdentity=async e=>{const t="Automated Version Bump";const A=process.env.GITHUB_USER??t;e.log.log(`Setting git config name to ${A}`);await e.exec("git",["config","user.name",A]);const r="android-semantic-release@users.noreply.github.com";const s=process.env.GITHUB_EMAIL??r;e.log.log(`Setting git config email to ${s}`);await e.exec("git",["config","user.email",s])};const createCommit=async(e,t,A=["version.properties"])=>{try{e.log.log(`Creating version commit`);e.log.log({commit:t});await runCommand("git",["add",...A]);await runCommand("git",["commit","-m",t])}catch{e.log.warn(`Commit failed, but this shouldn't be a problem if you are using actions/checkout@v2`)}};const pushChanges=async(e,t,A)=>{const r=["https://",process.env.GITHUB_ACTOR,":",process.env.GITHUB_TOKEN,"@github.com/",process.env.GITHUB_REPOSITORY,".git"].join("");if(A){e.log.log("Publishing tag");await runCommand("git",["tag",t]);await runCommand("git",["push",r,"--follow-tags"]);await runCommand("git",["push",r,"--tags"])}else{e.log.log("Not publishing tag, pushing instead");await runCommand("git",["push",r])}};const o={"version-properties":{path:"version.properties"},"gradle-properties":{path:"gradle.properties"}};const getVersionStorage=(e="version-properties")=>o[e];const getVersionStoragePath=(e="version-properties")=>getVersionStorage(e).path;const getProperty=(e,t)=>{const A=new RegExp(`^\\s*${t}\\s*=\\s*(.*?)\\s*$`,"m");const r=e.match(A);return r?.[1]};const getIntegerProperty=(e,t)=>{const A=Number.parseInt(getProperty(e,t)??"0");return Number.isNaN(A)?0:A};const getVersionFromProperties=e=>({major:getIntegerProperty(e,"majorVersion"),minor:getIntegerProperty(e,"minorVersion"),patch:getIntegerProperty(e,"patchVersion")});const setProperty=(e,t,A)=>{const r=new RegExp(`^(\\s*${t}\\s*=\\s*).*$`,"m");if(r.test(e)){return e.replace(r,`$1${A}`)}return`${e}${e.endsWith("\n")||e.length===0?"":"\n"}${t}=${A}`};const setProperties=(e,t)=>{const A={majorVersion:t.major.toString(),minorVersion:t.minor.toString(),patchVersion:t.patch.toString(),buildNumber:t.build?.toString()??""};return Object.entries(A).reduce((e,[t,A])=>setProperty(e,t,A),e)};const doesVersionPropertiesExist=async(e,t="version-properties")=>{try{const A=await e.readFile(getVersionStoragePath(t));return A?.toString().length>0}catch{return false}};const getVersionProperties=async(e,t="version-properties")=>{const A=(await e.readFile(getVersionStoragePath(t))).toString();return getVersionFromProperties(A)};const setVersionProperties=async(e,t,A,r="version-properties")=>{const s=getVersionStoragePath(r);let o="";if(r==="gradle-properties"){try{o=(await e.readFile(s)).toString()}catch{o=""}}const n=setProperties(o,A);await e.writeFile(s,n);t.log.log(n)};function utils_toCommandValue(e){if(e===null||e===undefined){return""}else if(typeof e==="string"||e instanceof String){return e}return JSON.stringify(e)}function utils_toCommandProperties(e){if(!Object.keys(e).length){return{}}return{title:e.title,file:e.file,line:e.startLine,endLine:e.endLine,col:e.startColumn,endColumn:e.endColumn}}function command_issueCommand(e,t,A){const r=new Command(e,t,A);process.stdout.write(r.toString()+s.EOL)}function command_issue(e,t=""){command_issueCommand(e,{},t)}const n="::";class Command{constructor(e,t,A){if(!e){e="missing.command"}this.command=e;this.properties=t;this.message=A}toString(){let e=n+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";let t=true;for(const A in this.properties){if(this.properties.hasOwnProperty(A)){const r=this.properties[A];if(r){if(t){t=false}else{e+=","}e+=`${A}=${escapeProperty(r)}`}}}}e+=`${n}${escapeData(this.message)}`;return e}}function escapeData(e){return utils_toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(e){return utils_toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}const i=require("crypto");const a=require("fs");function file_command_issueFileCommand(e,t){const A=process.env[`GITHUB_${e}`];if(!A){throw new Error(`Unable to find environment variable for file command ${e}`)}if(!a.existsSync(A)){throw new Error(`Missing file at path: ${A}`)}a.appendFileSync(A,`${utils_toCommandValue(t)}${s.EOL}`,{encoding:"utf8"})}function file_command_prepareKeyValueMessage(e,t){const A=`ghadelimiter_${i.randomUUID()}`;const r=utils_toCommandValue(t);if(e.includes(A)){throw new Error(`Unexpected input: name should not contain the delimiter "${A}"`)}if(r.includes(A)){throw new Error(`Unexpected input: value should not contain the delimiter "${A}"`)}return`${e}<<${A}${s.EOL}${r}${s.EOL}${A}`}const c=require("path");var l=__nccwpck_require__(8611);var g=__nccwpck_require__(5692);function getProxyUrl(e){const t=e.protocol==="https:";if(checkBypass(e)){return undefined}const A=(()=>{if(t){return process.env["https_proxy"]||process.env["HTTPS_PROXY"]}else{return process.env["http_proxy"]||process.env["HTTP_PROXY"]}})();if(A){try{return new DecodedURL(A)}catch(e){if(!A.startsWith("http://")&&!A.startsWith("https://"))return new DecodedURL(`http://${A}`)}}else{return undefined}}function checkBypass(e){if(!e.hostname){return false}const t=e.hostname;if(isLoopbackAddress(t)){return true}const A=process.env["no_proxy"]||process.env["NO_PROXY"]||"";if(!A){return false}let r;if(e.port){r=Number(e.port)}else if(e.protocol==="http:"){r=80}else if(e.protocol==="https:"){r=443}const s=[e.hostname.toUpperCase()];if(typeof r==="number"){s.push(`${s[0]}:${r}`)}for(const e of A.split(",").map(e=>e.trim().toUpperCase()).filter(e=>e)){if(e==="*"||s.some(t=>t===e||t.endsWith(`.${e}`)||e.startsWith(".")&&t.endsWith(`${e}`))){return true}}return false}function isLoopbackAddress(e){const t=e.toLowerCase();return t==="localhost"||t.startsWith("127.")||t.startsWith("[::1]")||t.startsWith("[0:0:0:0:0:0:0:1]")}class DecodedURL extends URL{constructor(e,t){super(e,t);this._decodedUsername=decodeURIComponent(super.username);this._decodedPassword=decodeURIComponent(super.password)}get username(){return this._decodedUsername}get password(){return this._decodedPassword}}var u=__nccwpck_require__(770);var E=__nccwpck_require__(6752);var h=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A(function(t){t(e)})}return new(A||(A=Promise))(function(A,s){function fulfilled(e){try{step(r.next(e))}catch(e){s(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){s(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};var d;(function(e){e[e["OK"]=200]="OK";e[e["MultipleChoices"]=300]="MultipleChoices";e[e["MovedPermanently"]=301]="MovedPermanently";e[e["ResourceMoved"]=302]="ResourceMoved";e[e["SeeOther"]=303]="SeeOther";e[e["NotModified"]=304]="NotModified";e[e["UseProxy"]=305]="UseProxy";e[e["SwitchProxy"]=306]="SwitchProxy";e[e["TemporaryRedirect"]=307]="TemporaryRedirect";e[e["PermanentRedirect"]=308]="PermanentRedirect";e[e["BadRequest"]=400]="BadRequest";e[e["Unauthorized"]=401]="Unauthorized";e[e["PaymentRequired"]=402]="PaymentRequired";e[e["Forbidden"]=403]="Forbidden";e[e["NotFound"]=404]="NotFound";e[e["MethodNotAllowed"]=405]="MethodNotAllowed";e[e["NotAcceptable"]=406]="NotAcceptable";e[e["ProxyAuthenticationRequired"]=407]="ProxyAuthenticationRequired";e[e["RequestTimeout"]=408]="RequestTimeout";e[e["Conflict"]=409]="Conflict";e[e["Gone"]=410]="Gone";e[e["TooManyRequests"]=429]="TooManyRequests";e[e["InternalServerError"]=500]="InternalServerError";e[e["NotImplemented"]=501]="NotImplemented";e[e["BadGateway"]=502]="BadGateway";e[e["ServiceUnavailable"]=503]="ServiceUnavailable";e[e["GatewayTimeout"]=504]="GatewayTimeout"})(d||(d={}));var Q;(function(e){e["Accept"]="accept";e["ContentType"]="content-type"})(Q||(Q={}));var B;(function(e){e["ApplicationJson"]="application/json"})(B||(B={}));function lib_getProxyUrl(e){const t=pm.getProxyUrl(new URL(e));return t?t.href:""}const I=[d.MovedPermanently,d.ResourceMoved,d.SeeOther,d.TemporaryRedirect,d.PermanentRedirect];const p=[d.BadGateway,d.ServiceUnavailable,d.GatewayTimeout];const f=null&&["OPTIONS","GET","DELETE","HEAD"];const m=10;const w=5;class HttpClientError extends Error{constructor(e,t){super(e);this.name="HttpClientError";this.statusCode=t;Object.setPrototypeOf(this,HttpClientError.prototype)}}class HttpClientResponse{constructor(e){this.message=e}readBody(){return h(this,void 0,void 0,function*(){return new Promise(e=>h(this,void 0,void 0,function*(){let t=Buffer.alloc(0);this.message.on("data",e=>{t=Buffer.concat([t,e])});this.message.on("end",()=>{e(t.toString())})}))})}readBodyBuffer(){return h(this,void 0,void 0,function*(){return new Promise(e=>h(this,void 0,void 0,function*(){const t=[];this.message.on("data",e=>{t.push(e)});this.message.on("end",()=>{e(Buffer.concat(t))})}))})}}function isHttps(e){const t=new URL(e);return t.protocol==="https:"}class lib_HttpClient{constructor(e,t,A){this._ignoreSslError=false;this._allowRedirects=true;this._allowRedirectDowngrade=false;this._maxRedirects=50;this._allowRetries=false;this._maxRetries=1;this._keepAlive=false;this._disposed=false;this.userAgent=this._getUserAgentWithOrchestrationId(e);this.handlers=t||[];this.requestOptions=A;if(A){if(A.ignoreSslError!=null){this._ignoreSslError=A.ignoreSslError}this._socketTimeout=A.socketTimeout;if(A.allowRedirects!=null){this._allowRedirects=A.allowRedirects}if(A.allowRedirectDowngrade!=null){this._allowRedirectDowngrade=A.allowRedirectDowngrade}if(A.maxRedirects!=null){this._maxRedirects=Math.max(A.maxRedirects,0)}if(A.keepAlive!=null){this._keepAlive=A.keepAlive}if(A.allowRetries!=null){this._allowRetries=A.allowRetries}if(A.maxRetries!=null){this._maxRetries=A.maxRetries}}}options(e,t){return h(this,void 0,void 0,function*(){return this.request("OPTIONS",e,null,t||{})})}get(e,t){return h(this,void 0,void 0,function*(){return this.request("GET",e,null,t||{})})}del(e,t){return h(this,void 0,void 0,function*(){return this.request("DELETE",e,null,t||{})})}post(e,t,A){return h(this,void 0,void 0,function*(){return this.request("POST",e,t,A||{})})}patch(e,t,A){return h(this,void 0,void 0,function*(){return this.request("PATCH",e,t,A||{})})}put(e,t,A){return h(this,void 0,void 0,function*(){return this.request("PUT",e,t,A||{})})}head(e,t){return h(this,void 0,void 0,function*(){return this.request("HEAD",e,null,t||{})})}sendStream(e,t,A,r){return h(this,void 0,void 0,function*(){return this.request(e,t,A,r)})}getJson(e){return h(this,arguments,void 0,function*(e,t={}){t[Q.Accept]=this._getExistingOrDefaultHeader(t,Q.Accept,B.ApplicationJson);const A=yield this.get(e,t);return this._processResponse(A,this.requestOptions)})}postJson(e,t){return h(this,arguments,void 0,function*(e,t,A={}){const r=JSON.stringify(t,null,2);A[Q.Accept]=this._getExistingOrDefaultHeader(A,Q.Accept,B.ApplicationJson);A[Q.ContentType]=this._getExistingOrDefaultContentTypeHeader(A,B.ApplicationJson);const s=yield this.post(e,r,A);return this._processResponse(s,this.requestOptions)})}putJson(e,t){return h(this,arguments,void 0,function*(e,t,A={}){const r=JSON.stringify(t,null,2);A[Q.Accept]=this._getExistingOrDefaultHeader(A,Q.Accept,B.ApplicationJson);A[Q.ContentType]=this._getExistingOrDefaultContentTypeHeader(A,B.ApplicationJson);const s=yield this.put(e,r,A);return this._processResponse(s,this.requestOptions)})}patchJson(e,t){return h(this,arguments,void 0,function*(e,t,A={}){const r=JSON.stringify(t,null,2);A[Q.Accept]=this._getExistingOrDefaultHeader(A,Q.Accept,B.ApplicationJson);A[Q.ContentType]=this._getExistingOrDefaultContentTypeHeader(A,B.ApplicationJson);const s=yield this.patch(e,r,A);return this._processResponse(s,this.requestOptions)})}request(e,t,A,r){return h(this,void 0,void 0,function*(){if(this._disposed){throw new Error("Client has already been disposed.")}const s=new URL(t);let o=this._prepareRequest(e,s,r);const n=this._allowRetries&&f.includes(e)?this._maxRetries+1:1;let i=0;let a;do{a=yield this.requestRaw(o,A);if(a&&a.message&&a.message.statusCode===d.Unauthorized){let e;for(const t of this.handlers){if(t.canHandleAuthentication(a)){e=t;break}}if(e){return e.handleAuthentication(this,o,A)}else{return a}}let t=this._maxRedirects;while(a.message.statusCode&&I.includes(a.message.statusCode)&&this._allowRedirects&&t>0){const n=a.message.headers["location"];if(!n){break}const i=new URL(n);if(s.protocol==="https:"&&s.protocol!==i.protocol&&!this._allowRedirectDowngrade){throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.")}yield a.readBody();if(i.hostname!==s.hostname){for(const e in r){if(e.toLowerCase()==="authorization"){delete r[e]}}}o=this._prepareRequest(e,i,r);a=yield this.requestRaw(o,A);t--}if(!a.message.statusCode||!p.includes(a.message.statusCode)){return a}i+=1;if(i{function callbackForResult(e,t){if(e){r(e)}else if(!t){r(new Error("Unknown error"))}else{A(t)}}this.requestRawWithCallback(e,t,callbackForResult)})})}requestRawWithCallback(e,t,A){if(typeof t==="string"){if(!e.options.headers){e.options.headers={}}e.options.headers["Content-Length"]=Buffer.byteLength(t,"utf8")}let r=false;function handleResult(e,t){if(!r){r=true;A(e,t)}}const s=e.httpModule.request(e.options,e=>{const t=new HttpClientResponse(e);handleResult(undefined,t)});let o;s.on("socket",e=>{o=e});s.setTimeout(this._socketTimeout||3*6e4,()=>{if(o){o.end()}handleResult(new Error(`Request timeout: ${e.options.path}`))});s.on("error",function(e){handleResult(e)});if(t&&typeof t==="string"){s.write(t,"utf8")}if(t&&typeof t!=="string"){t.on("close",function(){s.end()});t.pipe(s)}else{s.end()}}getAgent(e){const t=new URL(e);return this._getAgent(t)}getAgentDispatcher(e){const t=new URL(e);const A=pm.getProxyUrl(t);const r=A&&A.hostname;if(!r){return}return this._getProxyAgentDispatcher(t,A)}_prepareRequest(e,t,A){const r={};r.parsedUrl=t;const s=r.parsedUrl.protocol==="https:";r.httpModule=s?https:http;const o=s?443:80;r.options={};r.options.host=r.parsedUrl.hostname;r.options.port=r.parsedUrl.port?parseInt(r.parsedUrl.port):o;r.options.path=(r.parsedUrl.pathname||"")+(r.parsedUrl.search||"");r.options.method=e;r.options.headers=this._mergeHeaders(A);if(this.userAgent!=null){r.options.headers["user-agent"]=this.userAgent}r.options.agent=this._getAgent(r.parsedUrl);if(this.handlers){for(const e of this.handlers){e.prepareRequest(r.options)}}return r}_mergeHeaders(e){if(this.requestOptions&&this.requestOptions.headers){return Object.assign({},lowercaseKeys(this.requestOptions.headers),lowercaseKeys(e||{}))}return lowercaseKeys(e||{})}_getExistingOrDefaultHeader(e,t,A){let r;if(this.requestOptions&&this.requestOptions.headers){const e=lowercaseKeys(this.requestOptions.headers)[t];if(e){r=typeof e==="number"?e.toString():e}}const s=e[t];if(s!==undefined){return typeof s==="number"?s.toString():s}if(r!==undefined){return r}return A}_getExistingOrDefaultContentTypeHeader(e,t){let A;if(this.requestOptions&&this.requestOptions.headers){const e=lowercaseKeys(this.requestOptions.headers)[Q.ContentType];if(e){if(typeof e==="number"){A=String(e)}else if(Array.isArray(e)){A=e.join(", ")}else{A=e}}}const r=e[Q.ContentType];if(r!==undefined){if(typeof r==="number"){return String(r)}else if(Array.isArray(r)){return r.join(", ")}else{return r}}if(A!==undefined){return A}return t}_getAgent(e){let t;const A=pm.getProxyUrl(e);const r=A&&A.hostname;if(this._keepAlive&&r){t=this._proxyAgent}if(!r){t=this._agent}if(t){return t}const s=e.protocol==="https:";let o=100;if(this.requestOptions){o=this.requestOptions.maxSockets||http.globalAgent.maxSockets}if(A&&A.hostname){const e={maxSockets:o,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(A.username||A.password)&&{proxyAuth:`${A.username}:${A.password}`}),{host:A.hostname,port:A.port})};let r;const n=A.protocol==="https:";if(s){r=n?tunnel.httpsOverHttps:tunnel.httpsOverHttp}else{r=n?tunnel.httpOverHttps:tunnel.httpOverHttp}t=r(e);this._proxyAgent=t}if(!t){const e={keepAlive:this._keepAlive,maxSockets:o};t=s?new https.Agent(e):new http.Agent(e);this._agent=t}if(s&&this._ignoreSslError){t.options=Object.assign(t.options||{},{rejectUnauthorized:false})}return t}_getProxyAgentDispatcher(e,t){let A;if(this._keepAlive){A=this._proxyAgentDispatcher}if(A){return A}const r=e.protocol==="https:";A=new ProxyAgent(Object.assign({uri:t.href,pipelining:!this._keepAlive?0:1},(t.username||t.password)&&{token:`Basic ${Buffer.from(`${t.username}:${t.password}`).toString("base64")}`}));this._proxyAgentDispatcher=A;if(r&&this._ignoreSslError){A.options=Object.assign(A.options.requestTls||{},{rejectUnauthorized:false})}return A}_getUserAgentWithOrchestrationId(e){const t=e||"actions/http-client";const A=process.env["ACTIONS_ORCHESTRATION_ID"];if(A){const e=A.replace(/[^a-z0-9_.-]/gi,"_");return`${t} actions_orchestration_id/${e}`}return t}_performExponentialBackoff(e){return h(this,void 0,void 0,function*(){e=Math.min(m,e);const t=w*Math.pow(2,e);return new Promise(e=>setTimeout(()=>e(),t))})}_processResponse(e,t){return h(this,void 0,void 0,function*(){return new Promise((A,r)=>h(this,void 0,void 0,function*(){const s=e.message.statusCode||0;const o={statusCode:s,result:null,headers:{}};if(s===d.NotFound){A(o)}function dateTimeDeserializer(e,t){if(typeof t==="string"){const e=new Date(t);if(!isNaN(e.valueOf())){return e}}return t}let n;let i;try{i=yield e.readBody();if(i&&i.length>0){if(t&&t.deserializeDates){n=JSON.parse(i,dateTimeDeserializer)}else{n=JSON.parse(i)}o.result=n}o.headers=e.message.headers}catch(e){}if(s>299){let e;if(n&&n.message){e=n.message}else if(i&&i.length>0){e=i}else{e=`Failed request: (${s})`}const t=new HttpClientError(e,s);t.result=o.result;r(t)}else{A(o)}}))})}}const lowercaseKeys=e=>Object.keys(e).reduce((t,A)=>(t[A.toLowerCase()]=e[A],t),{});var y=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A(function(t){t(e)})}return new(A||(A=Promise))(function(A,s){function fulfilled(e){try{step(r.next(e))}catch(e){s(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){s(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};class BasicCredentialHandler{constructor(e,t){this.username=e;this.password=t}prepareRequest(e){if(!e.headers){throw Error("The request has no headers")}e.headers["Authorization"]=`Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`}canHandleAuthentication(){return false}handleAuthentication(){return y(this,void 0,void 0,function*(){throw new Error("not implemented")})}}class auth_BearerCredentialHandler{constructor(e){this.token=e}prepareRequest(e){if(!e.headers){throw Error("The request has no headers")}e.headers["Authorization"]=`Bearer ${this.token}`}canHandleAuthentication(){return false}handleAuthentication(){return y(this,void 0,void 0,function*(){throw new Error("not implemented")})}}class PersonalAccessTokenCredentialHandler{constructor(e){this.token=e}prepareRequest(e){if(!e.headers){throw Error("The request has no headers")}e.headers["Authorization"]=`Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`}canHandleAuthentication(){return false}handleAuthentication(){return y(this,void 0,void 0,function*(){throw new Error("not implemented")})}}var b=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A(function(t){t(e)})}return new(A||(A=Promise))(function(A,s){function fulfilled(e){try{step(r.next(e))}catch(e){s(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){s(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};class oidc_utils_OidcClient{static createHttpClient(e=true,t=10){const A={allowRetries:e,maxRetries:t};return new HttpClient("actions/oidc-client",[new BearerCredentialHandler(oidc_utils_OidcClient.getRequestToken())],A)}static getRequestToken(){const e=process.env["ACTIONS_ID_TOKEN_REQUEST_TOKEN"];if(!e){throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable")}return e}static getIDTokenUrl(){const e=process.env["ACTIONS_ID_TOKEN_REQUEST_URL"];if(!e){throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable")}return e}static getCall(e){return b(this,void 0,void 0,function*(){var t;const A=oidc_utils_OidcClient.createHttpClient();const r=yield A.getJson(e).catch(e=>{throw new Error(`Failed to get ID Token. \n \n Error Code : ${e.statusCode}\n \n Error Message: ${e.message}`)});const s=(t=r.result)===null||t===void 0?void 0:t.value;if(!s){throw new Error("Response json body do not have ID Token field")}return s})}static getIDToken(e){return b(this,void 0,void 0,function*(){try{let t=oidc_utils_OidcClient.getIDTokenUrl();if(e){const A=encodeURIComponent(e);t=`${t}&audience=${A}`}debug(`ID token url is ${t}`);const A=yield oidc_utils_OidcClient.getCall(t);setSecret(A);return A}catch(e){throw new Error(`Error message: ${e.message}`)}})}}var k=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A(function(t){t(e)})}return new(A||(A=Promise))(function(A,s){function fulfilled(e){try{step(r.next(e))}catch(e){s(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){s(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};const{access:D,appendFile:R,writeFile:T}=a.promises;const F="GITHUB_STEP_SUMMARY";const S="https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";class Summary{constructor(){this._buffer=""}filePath(){return k(this,void 0,void 0,function*(){if(this._filePath){return this._filePath}const e=process.env[F];if(!e){throw new Error(`Unable to find environment variable for $${F}. Check if your runtime environment supports job summaries.`)}try{yield D(e,a.constants.R_OK|a.constants.W_OK)}catch(t){throw new Error(`Unable to access summary file: '${e}'. Check if the file has correct read/write permissions.`)}this._filePath=e;return this._filePath})}wrap(e,t,A={}){const r=Object.entries(A).map(([e,t])=>` ${e}="${t}"`).join("");if(!t){return`<${e}${r}>`}return`<${e}${r}>${t}`}write(e){return k(this,void 0,void 0,function*(){const t=!!(e===null||e===void 0?void 0:e.overwrite);const A=yield this.filePath();const r=t?T:R;yield r(A,this._buffer,{encoding:"utf8"});return this.emptyBuffer()})}clear(){return k(this,void 0,void 0,function*(){return this.emptyBuffer().write({overwrite:true})})}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){this._buffer="";return this}addRaw(e,t=false){this._buffer+=e;return t?this.addEOL():this}addEOL(){return this.addRaw(s.EOL)}addCodeBlock(e,t){const A=Object.assign({},t&&{lang:t});const r=this.wrap("pre",this.wrap("code",e),A);return this.addRaw(r).addEOL()}addList(e,t=false){const A=t?"ol":"ul";const r=e.map(e=>this.wrap("li",e)).join("");const s=this.wrap(A,r);return this.addRaw(s).addEOL()}addTable(e){const t=e.map(e=>{const t=e.map(e=>{if(typeof e==="string"){return this.wrap("td",e)}const{header:t,data:A,colspan:r,rowspan:s}=e;const o=t?"th":"td";const n=Object.assign(Object.assign({},r&&{colspan:r}),s&&{rowspan:s});return this.wrap(o,A,n)}).join("");return this.wrap("tr",t)}).join("");const A=this.wrap("table",t);return this.addRaw(A).addEOL()}addDetails(e,t){const A=this.wrap("details",this.wrap("summary",e)+t);return this.addRaw(A).addEOL()}addImage(e,t,A){const{width:r,height:s}=A||{};const o=Object.assign(Object.assign({},r&&{width:r}),s&&{height:s});const n=this.wrap("img",null,Object.assign({src:e,alt:t},o));return this.addRaw(n).addEOL()}addHeading(e,t){const A=`h${t}`;const r=["h1","h2","h3","h4","h5","h6"].includes(A)?A:"h1";const s=this.wrap(r,e);return this.addRaw(s).addEOL()}addSeparator(){const e=this.wrap("hr",null);return this.addRaw(e).addEOL()}addBreak(){const e=this.wrap("br",null);return this.addRaw(e).addEOL()}addQuote(e,t){const A=Object.assign({},t&&{cite:t});const r=this.wrap("blockquote",e,A);return this.addRaw(r).addEOL()}addLink(e,t){const A=this.wrap("a",e,{href:t});return this.addRaw(A).addEOL()}}const U=new Summary;const N=null&&U;const M=null&&U;function toPosixPath(e){return e.replace(/[\\]/g,"/")}function toWin32Path(e){return e.replace(/[/]/g,"\\")}function toPlatformPath(e){return e.replace(/[/\\]/g,path.sep)}var G=__nccwpck_require__(3193);var L=__nccwpck_require__(4434);var v=__nccwpck_require__(2613);var H=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A(function(t){t(e)})}return new(A||(A=Promise))(function(A,s){function fulfilled(e){try{step(r.next(e))}catch(e){s(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){s(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};const{chmod:_,copyFile:O,lstat:Y,mkdir:P,open:x,readdir:J,rename:V,rm:W,rmdir:q,stat:z,symlink:j,unlink:Z}=a.promises;const K=process.platform==="win32";function readlink(e){return H(this,void 0,void 0,function*(){const t=yield fs.promises.readlink(e);if(K&&!t.endsWith("\\")){return`${t}\\`}return t})}const X=268435456;const $=a.constants.O_RDONLY;function exists(e){return H(this,void 0,void 0,function*(){try{yield z(e)}catch(e){if(e.code==="ENOENT"){return false}throw e}return true})}function isDirectory(e){return H(this,arguments,void 0,function*(e,t=false){const A=t?yield z(e):yield Y(e);return A.isDirectory()})}function isRooted(e){e=normalizeSeparators(e);if(!e){throw new Error('isRooted() parameter "p" cannot be empty')}if(K){return e.startsWith("\\")||/^[A-Z]:/i.test(e)}return e.startsWith("/")}function tryGetExecutablePath(e,t){return H(this,void 0,void 0,function*(){let A=undefined;try{A=yield z(e)}catch(t){if(t.code!=="ENOENT"){console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${t}`)}}if(A&&A.isFile()){if(K){const A=c.extname(e).toUpperCase();if(t.some(e=>e.toUpperCase()===A)){return e}}else{if(isUnixExecutable(A)){return e}}}const r=e;for(const s of t){e=r+s;A=undefined;try{A=yield z(e)}catch(t){if(t.code!=="ENOENT"){console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${t}`)}}if(A&&A.isFile()){if(K){try{const t=c.dirname(e);const A=c.basename(e).toUpperCase();for(const r of yield J(t)){if(A===r.toUpperCase()){e=c.join(t,r);break}}}catch(t){console.log(`Unexpected error attempting to determine the actual case of the file '${e}': ${t}`)}return e}else{if(isUnixExecutable(A)){return e}}}}return""})}function normalizeSeparators(e){e=e||"";if(K){e=e.replace(/\//g,"\\");return e.replace(/\\\\+/g,"\\")}return e.replace(/\/\/+/g,"/")}function isUnixExecutable(e){return(e.mode&1)>0||(e.mode&8)>0&&process.getgid!==undefined&&e.gid===process.getgid()||(e.mode&64)>0&&process.getuid!==undefined&&e.uid===process.getuid()}function getCmdPath(){var e;return(e=process.env["COMSPEC"])!==null&&e!==void 0?e:`cmd.exe`}var ee=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A(function(t){t(e)})}return new(A||(A=Promise))(function(A,s){function fulfilled(e){try{step(r.next(e))}catch(e){s(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){s(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};function cp(e,t){return ee(this,arguments,void 0,function*(e,t,A={}){const{force:r,recursive:s,copySourceDirectory:o}=readCopyOptions(A);const n=(yield ioUtil.exists(t))?yield ioUtil.stat(t):null;if(n&&n.isFile()&&!r){return}const i=n&&n.isDirectory()&&o?path.join(t,path.basename(e)):t;if(!(yield ioUtil.exists(e))){throw new Error(`no such file or directory: ${e}`)}const a=yield ioUtil.stat(e);if(a.isDirectory()){if(!s){throw new Error(`Failed to copy. ${e} is a directory, but tried to copy without recursive flag.`)}else{yield cpDirRecursive(e,i,0,r)}}else{if(path.relative(e,i)===""){throw new Error(`'${i}' and '${e}' are the same file`)}yield io_copyFile(e,i,r)}})}function mv(e,t){return ee(this,arguments,void 0,function*(e,t,A={}){if(yield ioUtil.exists(t)){let r=true;if(yield ioUtil.isDirectory(t)){t=path.join(t,path.basename(e));r=yield ioUtil.exists(t)}if(r){if(A.force==null||A.force){yield rmRF(t)}else{throw new Error("Destination already exists")}}}yield mkdirP(path.dirname(t));yield ioUtil.rename(e,t)})}function rmRF(e){return ee(this,void 0,void 0,function*(){if(ioUtil.IS_WINDOWS){if(/[*"<>|]/.test(e)){throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows')}}try{yield ioUtil.rm(e,{force:true,maxRetries:3,recursive:true,retryDelay:300})}catch(e){throw new Error(`File was unable to be removed ${e}`)}})}function mkdirP(e){return ee(this,void 0,void 0,function*(){ok(e,"a path argument must be provided");yield ioUtil.mkdir(e,{recursive:true})})}function which(e,t){return ee(this,void 0,void 0,function*(){if(!e){throw new Error("parameter 'tool' is required")}if(t){const t=yield which(e,false);if(!t){if(K){throw new Error(`Unable to locate executable file: ${e}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`)}else{throw new Error(`Unable to locate executable file: ${e}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`)}}return t}const A=yield findInPath(e);if(A&&A.length>0){return A[0]}return""})}function findInPath(e){return ee(this,void 0,void 0,function*(){if(!e){throw new Error("parameter 'tool' is required")}const t=[];if(K&&process.env["PATHEXT"]){for(const e of process.env["PATHEXT"].split(c.delimiter)){if(e){t.push(e)}}}if(isRooted(e)){const A=yield tryGetExecutablePath(e,t);if(A){return[A]}return[]}if(e.includes(c.sep)){return[]}const A=[];if(process.env.PATH){for(const e of process.env.PATH.split(c.delimiter)){if(e){A.push(e)}}}const r=[];for(const s of A){const A=yield tryGetExecutablePath(c.join(s,e),t);if(A){r.push(A)}}return r})}function readCopyOptions(e){const t=e.force==null?true:e.force;const A=Boolean(e.recursive);const r=e.copySourceDirectory==null?true:Boolean(e.copySourceDirectory);return{force:t,recursive:A,copySourceDirectory:r}}function cpDirRecursive(e,t,A,r){return ee(this,void 0,void 0,function*(){if(A>=255)return;A++;yield mkdirP(t);const s=yield ioUtil.readdir(e);for(const o of s){const s=`${e}/${o}`;const n=`${t}/${o}`;const i=yield ioUtil.lstat(s);if(i.isDirectory()){yield cpDirRecursive(s,n,A,r)}else{yield io_copyFile(s,n,r)}}yield ioUtil.chmod(t,(yield ioUtil.stat(e)).mode)})}function io_copyFile(e,t,A){return ee(this,void 0,void 0,function*(){if((yield ioUtil.lstat(e)).isSymbolicLink()){try{yield ioUtil.lstat(t);yield ioUtil.unlink(t)}catch(e){if(e.code==="EPERM"){yield ioUtil.chmod(t,"0666");yield ioUtil.unlink(t)}}const A=yield ioUtil.readlink(e);yield ioUtil.symlink(A,t,ioUtil.IS_WINDOWS?"junction":null)}else if(!(yield ioUtil.exists(t))||A){yield ioUtil.copyFile(e,t)}})}const te=require("timers");var Ae=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A(function(t){t(e)})}return new(A||(A=Promise))(function(A,s){function fulfilled(e){try{step(r.next(e))}catch(e){s(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){s(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};const re=process.platform==="win32";class ToolRunner extends L.EventEmitter{constructor(e,t,A){super();if(!e){throw new Error("Parameter 'toolPath' cannot be null or empty.")}this.toolPath=e;this.args=t||[];this.options=A||{}}_debug(e){if(this.options.listeners&&this.options.listeners.debug){this.options.listeners.debug(e)}}_getCommandString(e,t){const A=this._getSpawnFileName();const r=this._getSpawnArgs(e);let s=t?"":"[command]";if(re){if(this._isCmdFile()){s+=A;for(const e of r){s+=` ${e}`}}else if(e.windowsVerbatimArguments){s+=`"${A}"`;for(const e of r){s+=` ${e}`}}else{s+=this._windowsQuoteCmdArg(A);for(const e of r){s+=` ${this._windowsQuoteCmdArg(e)}`}}}else{s+=A;for(const e of r){s+=` ${e}`}}return s}_processLineBuffer(e,t,A){try{let r=t+e.toString();let o=r.indexOf(s.EOL);while(o>-1){const e=r.substring(0,o);A(e);r=r.substring(o+s.EOL.length);o=r.indexOf(s.EOL)}return r}catch(e){this._debug(`error processing line. Failed with error ${e}`);return""}}_getSpawnFileName(){if(re){if(this._isCmdFile()){return process.env["COMSPEC"]||"cmd.exe"}}return this.toolPath}_getSpawnArgs(e){if(re){if(this._isCmdFile()){let t=`/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;for(const A of this.args){t+=" ";t+=e.windowsVerbatimArguments?A:this._windowsQuoteCmdArg(A)}t+='"';return[t]}}return this.args}_endsWith(e,t){return e.endsWith(t)}_isCmdFile(){const e=this.toolPath.toUpperCase();return this._endsWith(e,".CMD")||this._endsWith(e,".BAT")}_windowsQuoteCmdArg(e){if(!this._isCmdFile()){return this._uvQuoteCmdArg(e)}if(!e){return'""'}const t=[" ","\t","&","(",")","[","]","{","}","^","=",";","!","'","+",",","`","~","|","<",">",'"'];let A=false;for(const r of e){if(t.some(e=>e===r)){A=true;break}}if(!A){return e}let r='"';let s=true;for(let t=e.length;t>0;t--){r+=e[t-1];if(s&&e[t-1]==="\\"){r+="\\"}else if(e[t-1]==='"'){s=true;r+='"'}else{s=false}}r+='"';return r.split("").reverse().join("")}_uvQuoteCmdArg(e){if(!e){return'""'}if(!e.includes(" ")&&!e.includes("\t")&&!e.includes('"')){return e}if(!e.includes('"')&&!e.includes("\\")){return`"${e}"`}let t='"';let A=true;for(let r=e.length;r>0;r--){t+=e[r-1];if(A&&e[r-1]==="\\"){t+="\\"}else if(e[r-1]==='"'){A=true;t+="\\"}else{A=false}}t+='"';return t.split("").reverse().join("")}_cloneExecOptions(e){e=e||{};const t={cwd:e.cwd||process.cwd(),env:e.env||process.env,silent:e.silent||false,windowsVerbatimArguments:e.windowsVerbatimArguments||false,failOnStdErr:e.failOnStdErr||false,ignoreReturnCode:e.ignoreReturnCode||false,delay:e.delay||1e4};t.outStream=e.outStream||process.stdout;t.errStream=e.errStream||process.stderr;return t}_getSpawnOptions(e,t){e=e||{};const A={};A.cwd=e.cwd;A.env=e.env;A["windowsVerbatimArguments"]=e.windowsVerbatimArguments||this._isCmdFile();if(e.windowsVerbatimArguments){A.argv0=`"${t}"`}return A}exec(){return Ae(this,void 0,void 0,function*(){if(!isRooted(this.toolPath)&&(this.toolPath.includes("/")||re&&this.toolPath.includes("\\"))){this.toolPath=c.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)}this.toolPath=yield which(this.toolPath,true);return new Promise((e,t)=>Ae(this,void 0,void 0,function*(){this._debug(`exec tool: ${this.toolPath}`);this._debug("arguments:");for(const e of this.args){this._debug(` ${e}`)}const A=this._cloneExecOptions(this.options);if(!A.silent&&A.outStream){A.outStream.write(this._getCommandString(A)+s.EOL)}const o=new ExecState(A,this.toolPath);o.on("debug",e=>{this._debug(e)});if(this.options.cwd&&!(yield exists(this.options.cwd))){return t(new Error(`The cwd: ${this.options.cwd} does not exist!`))}const n=this._getSpawnFileName();const i=r.spawn(n,this._getSpawnArgs(A),this._getSpawnOptions(this.options,n));let a="";if(i.stdout){i.stdout.on("data",e=>{if(this.options.listeners&&this.options.listeners.stdout){this.options.listeners.stdout(e)}if(!A.silent&&A.outStream){A.outStream.write(e)}a=this._processLineBuffer(e,a,e=>{if(this.options.listeners&&this.options.listeners.stdline){this.options.listeners.stdline(e)}})})}let c="";if(i.stderr){i.stderr.on("data",e=>{o.processStderr=true;if(this.options.listeners&&this.options.listeners.stderr){this.options.listeners.stderr(e)}if(!A.silent&&A.errStream&&A.outStream){const t=A.failOnStdErr?A.errStream:A.outStream;t.write(e)}c=this._processLineBuffer(e,c,e=>{if(this.options.listeners&&this.options.listeners.errline){this.options.listeners.errline(e)}})})}i.on("error",e=>{o.processError=e.message;o.processExited=true;o.processClosed=true;o.CheckComplete()});i.on("exit",e=>{o.processExitCode=e;o.processExited=true;this._debug(`Exit code ${e} received from tool '${this.toolPath}'`);o.CheckComplete()});i.on("close",e=>{o.processExitCode=e;o.processExited=true;o.processClosed=true;this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);o.CheckComplete()});o.on("done",(A,r)=>{if(a.length>0){this.emit("stdline",a)}if(c.length>0){this.emit("errline",c)}i.removeAllListeners();if(A){t(A)}else{e(r)}});if(this.options.input){if(!i.stdin){throw new Error("child process missing stdin")}i.stdin.end(this.options.input)}}))})}}function argStringToArray(e){const t=[];let A=false;let r=false;let s="";function append(e){if(r&&e!=='"'){s+="\\"}s+=e;r=false}for(let o=0;o0){t.push(s);s=""}continue}append(n)}if(s.length>0){t.push(s.trim())}return t}class ExecState extends L.EventEmitter{constructor(e,t){super();this.processClosed=false;this.processError="";this.processExitCode=0;this.processExited=false;this.processStderr=false;this.delay=1e4;this.done=false;this.timeout=null;if(!t){throw new Error("toolPath must not be empty")}this.options=e;this.toolPath=t;if(e.delay){this.delay=e.delay}}CheckComplete(){if(this.done){return}if(this.processClosed){this._setResult()}else if(this.processExited){this.timeout=(0,te.setTimeout)(ExecState.HandleTimeout,this.delay,this)}}_debug(e){this.emit("debug",e)}_setResult(){let e;if(this.processExited){if(this.processError){e=new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`)}else if(this.processExitCode!==0&&!this.options.ignoreReturnCode){e=new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`)}else if(this.processStderr&&this.options.failOnStdErr){e=new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`)}}if(this.timeout){clearTimeout(this.timeout);this.timeout=null}this.done=true;this.emit("done",e,this.processExitCode)}static HandleTimeout(e){if(e.done){return}if(!e.processClosed&&e.processExited){const t=`The STDIO streams did not close within ${e.delay/1e3} seconds of the exit event from process '${e.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;e._debug(t)}e._setResult()}}var se=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A(function(t){t(e)})}return new(A||(A=Promise))(function(A,s){function fulfilled(e){try{step(r.next(e))}catch(e){s(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){s(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};function exec_exec(e,t,A){return se(this,void 0,void 0,function*(){const r=argStringToArray(e);if(r.length===0){throw new Error(`Parameter 'commandLine' cannot be null or empty.`)}const s=r[0];t=r.slice(1).concat(t||[]);const o=new ToolRunner(s,t,A);return o.exec()})}function getExecOutput(e,t,A){return se(this,void 0,void 0,function*(){var r,s;let o="";let n="";const i=new StringDecoder("utf8");const a=new StringDecoder("utf8");const c=(r=A===null||A===void 0?void 0:A.listeners)===null||r===void 0?void 0:r.stdout;const l=(s=A===null||A===void 0?void 0:A.listeners)===null||s===void 0?void 0:s.stderr;const stdErrListener=e=>{n+=a.write(e);if(l){l(e)}};const stdOutListener=e=>{o+=i.write(e);if(c){c(e)}};const g=Object.assign(Object.assign({},A===null||A===void 0?void 0:A.listeners),{stdout:stdOutListener,stderr:stdErrListener});const u=yield exec_exec(e,t,Object.assign(Object.assign({},A),{listeners:g}));o+=i.end();n+=a.end();return{exitCode:u,stdout:o,stderr:n}})}var oe=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A(function(t){t(e)})}return new(A||(A=Promise))(function(A,s){function fulfilled(e){try{step(r.next(e))}catch(e){s(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){s(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};const getWindowsInfo=()=>oe(void 0,void 0,void 0,function*(){const{stdout:e}=yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"',undefined,{silent:true});const{stdout:t}=yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"',undefined,{silent:true});return{name:t.trim(),version:e.trim()}});const getMacOsInfo=()=>oe(void 0,void 0,void 0,function*(){var e,t,A,r;const{stdout:s}=yield exec.getExecOutput("sw_vers",undefined,{silent:true});const o=(t=(e=s.match(/ProductVersion:\s*(.+)/))===null||e===void 0?void 0:e[1])!==null&&t!==void 0?t:"";const n=(r=(A=s.match(/ProductName:\s*(.+)/))===null||A===void 0?void 0:A[1])!==null&&r!==void 0?r:"";return{name:n,version:o}});const getLinuxInfo=()=>oe(void 0,void 0,void 0,function*(){const{stdout:e}=yield exec.getExecOutput("lsb_release",["-i","-r","-s"],{silent:true});const[t,A]=e.trim().split("\n");return{name:t,version:A}});const ne=s.platform();const ie=s.arch();const ae=ne==="win32";const ce=ne==="darwin";const le=ne==="linux";function getDetails(){return oe(this,void 0,void 0,function*(){return Object.assign(Object.assign({},yield ae?getWindowsInfo():ce?getMacOsInfo():getLinuxInfo()),{platform:ne,arch:ie,isWindows:ae,isMacOS:ce,isLinux:le})})}var ge=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A(function(t){t(e)})}return new(A||(A=Promise))(function(A,s){function fulfilled(e){try{step(r.next(e))}catch(e){s(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){s(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};var ue;(function(e){e[e["Success"]=0]="Success";e[e["Failure"]=1]="Failure"})(ue||(ue={}));function exportVariable(e,t){const A=toCommandValue(t);process.env[e]=A;const r=process.env["GITHUB_ENV"]||"";if(r){return issueFileCommand("ENV",prepareKeyValueMessage(e,t))}issueCommand("set-env",{name:e},A)}function core_setSecret(e){issueCommand("add-mask",{},e)}function addPath(e){const t=process.env["GITHUB_PATH"]||"";if(t){issueFileCommand("PATH",e)}else{issueCommand("add-path",{},e)}process.env["PATH"]=`${e}${path.delimiter}${process.env["PATH"]}`}function getInput(e,t){const A=process.env[`INPUT_${e.replace(/ /g,"_").toUpperCase()}`]||"";if(t&&t.required&&!A){throw new Error(`Input required and not supplied: ${e}`)}if(t&&t.trimWhitespace===false){return A}return A.trim()}function getMultilineInput(e,t){const A=getInput(e,t).split("\n").filter(e=>e!=="");if(t&&t.trimWhitespace===false){return A}return A.map(e=>e.trim())}function getBooleanInput(e,t){const A=["true","True","TRUE"];const r=["false","False","FALSE"];const s=getInput(e,t);if(A.includes(s))return true;if(r.includes(s))return false;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${e}\n`+`Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}function setOutput(e,t){const A=process.env["GITHUB_OUTPUT"]||"";if(A){return file_command_issueFileCommand("OUTPUT",file_command_prepareKeyValueMessage(e,t))}process.stdout.write(s.EOL);command_issueCommand("set-output",{name:e},utils_toCommandValue(t))}function setCommandEcho(e){issue("echo",e?"on":"off")}function setFailed(e){process.exitCode=ue.Failure;error(e)}function isDebug(){return process.env["RUNNER_DEBUG"]==="1"}function core_debug(e){issueCommand("debug",{},e)}function error(e,t={}){command_issueCommand("error",utils_toCommandProperties(t),e instanceof Error?e.toString():e)}function warning(e,t={}){command_issueCommand("warning",utils_toCommandProperties(t),e instanceof Error?e.toString():e)}function notice(e,t={}){issueCommand("notice",toCommandProperties(t),e instanceof Error?e.toString():e)}function info(e){process.stdout.write(e+s.EOL)}function startGroup(e){issue("group",e)}function endGroup(){issue("endgroup")}function group(e,t){return ge(this,void 0,void 0,function*(){startGroup(e);let A;try{A=yield t()}finally{endGroup()}return A})}function saveState(e,t){const A=process.env["GITHUB_STATE"]||"";if(A){return issueFileCommand("STATE",prepareKeyValueMessage(e,t))}issueCommand("save-state",{name:e},toCommandValue(t))}function getState(e){return process.env[`STATE_${e}`]||""}function getIDToken(e){return ge(this,void 0,void 0,function*(){return yield OidcClient.getIDToken(e)})}class Context{constructor(){var e,t,A;this.payload={};if(process.env.GITHUB_EVENT_PATH){if((0,a.existsSync)(process.env.GITHUB_EVENT_PATH)){this.payload=JSON.parse((0,a.readFileSync)(process.env.GITHUB_EVENT_PATH,{encoding:"utf8"}))}else{const e=process.env.GITHUB_EVENT_PATH;process.stdout.write(`GITHUB_EVENT_PATH ${e} does not exist${s.EOL}`)}}this.eventName=process.env.GITHUB_EVENT_NAME;this.sha=process.env.GITHUB_SHA;this.ref=process.env.GITHUB_REF;this.workflow=process.env.GITHUB_WORKFLOW;this.action=process.env.GITHUB_ACTION;this.actor=process.env.GITHUB_ACTOR;this.job=process.env.GITHUB_JOB;this.runAttempt=parseInt(process.env.GITHUB_RUN_ATTEMPT,10);this.runNumber=parseInt(process.env.GITHUB_RUN_NUMBER,10);this.runId=parseInt(process.env.GITHUB_RUN_ID,10);this.apiUrl=(e=process.env.GITHUB_API_URL)!==null&&e!==void 0?e:`https://api.github.com`;this.serverUrl=(t=process.env.GITHUB_SERVER_URL)!==null&&t!==void 0?t:`https://github.com`;this.graphqlUrl=(A=process.env.GITHUB_GRAPHQL_URL)!==null&&A!==void 0?A:`https://api.github.com/graphql`}get issue(){const e=this.payload;return Object.assign(Object.assign({},this.repo),{number:(e.issue||e.pull_request||e).number})}get repo(){if(process.env.GITHUB_REPOSITORY){const[e,t]=process.env.GITHUB_REPOSITORY.split("/");return{owner:e,repo:t}}if(this.payload.repository){return{owner:this.payload.repository.owner.login,repo:this.payload.repository.name}}throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'")}}var Ee=__nccwpck_require__(9659);var he=undefined&&undefined.__awaiter||function(e,t,A,r){function adopt(e){return e instanceof A?e:new A(function(t){t(e)})}return new(A||(A=Promise))(function(A,s){function fulfilled(e){try{step(r.next(e))}catch(e){s(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){s(e)}}function step(e){e.done?A(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};function getAuthString(e,t){if(!e&&!t.auth){throw new Error("Parameter token or opts.auth is required")}else if(e&&t.auth){throw new Error("Parameters token and opts.auth may not both be specified")}return typeof t.auth==="string"?t.auth:`token ${e}`}function getProxyAgent(e){const t=new Ee.HttpClient;return t.getAgent(e)}function getProxyAgentDispatcher(e){const t=new Ee.HttpClient;return t.getAgentDispatcher(e)}function getProxyFetch(e){const t=getProxyAgentDispatcher(e);const proxyFetch=(e,A)=>he(this,void 0,void 0,function*(){return(0,E.fetch)(e,Object.assign(Object.assign({},A),{dispatcher:t}))});return proxyFetch}function getApiBaseUrl(){return process.env["GITHUB_API_URL"]||"https://api.github.com"}function getUserAgentWithOrchestrationId(e){var t;const A=(t=process.env["ACTIONS_ORCHESTRATION_ID"])===null||t===void 0?void 0:t.trim();if(A){const t=A.replace(/[^a-z0-9_.-]/gi,"_");const r=`actions_orchestration_id/${t}`;if(e===null||e===void 0?void 0:e.includes(r))return e;const s=e?`${e} `:"";return`${s}${r}`}return e}function getUserAgent(){if(typeof navigator==="object"&&"userAgent"in navigator){return navigator.userAgent}if(typeof process==="object"&&process.version!==undefined){return`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`}return""}function register(e,t,A,r){if(typeof A!=="function"){throw new Error("method for before hook must be a function")}if(!r){r={}}if(Array.isArray(t)){return t.reverse().reduce((t,A)=>register.bind(null,e,A,t,r),A)()}return Promise.resolve().then(()=>{if(!e.registry[t]){return A(r)}return e.registry[t].reduce((e,t)=>t.hook.bind(null,e,r),A)()})}function addHook(e,t,A,r){const s=r;if(!e.registry[A]){e.registry[A]=[]}if(t==="before"){r=(e,t)=>Promise.resolve().then(s.bind(null,t)).then(e.bind(null,t))}if(t==="after"){r=(e,t)=>{let A;return Promise.resolve().then(e.bind(null,t)).then(e=>{A=e;return s(A,t)}).then(()=>A)}}if(t==="error"){r=(e,t)=>Promise.resolve().then(e.bind(null,t)).catch(e=>s(e,t))}e.registry[A].push({hook:r,orig:s})}function removeHook(e,t,A){if(!e.registry[t]){return}const r=e.registry[t].map(e=>e.orig).indexOf(A);if(r===-1){return}e.registry[t].splice(r,1)}const de=Function.bind;const Qe=de.bind(de);function bindApi(e,t,A){const r=Qe(removeHook,null).apply(null,A?[t,A]:[t]);e.api={remove:r};e.remove=r;["before","error","after","wrap"].forEach(r=>{const s=A?[t,r,A]:[t,r];e[r]=e.api[r]=Qe(addHook,null).apply(null,s)})}function Singular(){const e=Symbol("Singular");const t={registry:{}};const A=register.bind(null,t,e);bindApi(A,t,e);return A}function Collection(){const e={registry:{}};const t=register.bind(null,e);bindApi(t,e);return t}const Ce={Singular:Singular,Collection:Collection};var Be="0.0.0-development";var Ie=`octokit-endpoint.js/${Be} ${getUserAgent()}`;var pe={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":Ie},mediaType:{format:""}};function dist_bundle_lowercaseKeys(e){if(!e){return{}}return Object.keys(e).reduce((t,A)=>{t[A.toLowerCase()]=e[A];return t},{})}function isPlainObject(e){if(typeof e!=="object"||e===null)return false;if(Object.prototype.toString.call(e)!=="[object Object]")return false;const t=Object.getPrototypeOf(e);if(t===null)return true;const A=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof A==="function"&&A instanceof A&&Function.prototype.call(A)===Function.prototype.call(e)}function mergeDeep(e,t){const A=Object.assign({},e);Object.keys(t).forEach(r=>{if(isPlainObject(t[r])){if(!(r in e))Object.assign(A,{[r]:t[r]});else A[r]=mergeDeep(e[r],t[r])}else{Object.assign(A,{[r]:t[r]})}});return A}function removeUndefinedProperties(e){for(const t in e){if(e[t]===void 0){delete e[t]}}return e}function merge(e,t,A){if(typeof t==="string"){let[e,r]=t.split(" ");A=Object.assign(r?{method:e,url:r}:{url:e},A)}else{A=Object.assign({},t)}A.headers=dist_bundle_lowercaseKeys(A.headers);removeUndefinedProperties(A);removeUndefinedProperties(A.headers);const r=mergeDeep(e||{},A);if(A.url==="/graphql"){if(e&&e.mediaType.previews?.length){r.mediaType.previews=e.mediaType.previews.filter(e=>!r.mediaType.previews.includes(e)).concat(r.mediaType.previews)}r.mediaType.previews=(r.mediaType.previews||[]).map(e=>e.replace(/-preview/,""))}return r}function addQueryParameters(e,t){const A=/\?/.test(e)?"&":"?";const r=Object.keys(t);if(r.length===0){return e}return e+A+r.map(e=>{if(e==="q"){return"q="+t.q.split("+").map(encodeURIComponent).join("+")}return`${e}=${encodeURIComponent(t[e])}`}).join("&")}var fe=/\{[^{}}]+\}/g;function removeNonChars(e){return e.replace(/(?:^\W+)|(?:(?e.concat(t),[])}function omit(e,t){const A={__proto__:null};for(const r of Object.keys(e)){if(t.indexOf(r)===-1){A[r]=e[r]}}return A}function encodeReserved(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(e){if(!/%[0-9A-Fa-f]/.test(e)){e=encodeURI(e).replace(/%5B/g,"[").replace(/%5D/g,"]")}return e}).join("")}function encodeUnreserved(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function encodeValue(e,t,A){t=e==="+"||e==="#"?encodeReserved(t):encodeUnreserved(t);if(A){return encodeUnreserved(A)+"="+t}else{return t}}function isDefined(e){return e!==void 0&&e!==null}function isKeyOperator(e){return e===";"||e==="&"||e==="?"}function getValues(e,t,A,r){var s=e[A],o=[];if(isDefined(s)&&s!==""){if(typeof s==="string"||typeof s==="number"||typeof s==="bigint"||typeof s==="boolean"){s=s.toString();if(r&&r!=="*"){s=s.substring(0,parseInt(r,10))}o.push(encodeValue(t,s,isKeyOperator(t)?A:""))}else{if(r==="*"){if(Array.isArray(s)){s.filter(isDefined).forEach(function(e){o.push(encodeValue(t,e,isKeyOperator(t)?A:""))})}else{Object.keys(s).forEach(function(e){if(isDefined(s[e])){o.push(encodeValue(t,s[e],e))}})}}else{const e=[];if(Array.isArray(s)){s.filter(isDefined).forEach(function(A){e.push(encodeValue(t,A))})}else{Object.keys(s).forEach(function(A){if(isDefined(s[A])){e.push(encodeUnreserved(A));e.push(encodeValue(t,s[A].toString()))}})}if(isKeyOperator(t)){o.push(encodeUnreserved(A)+"="+e.join(","))}else if(e.length!==0){o.push(e.join(","))}}}}else{if(t===";"){if(isDefined(s)){o.push(encodeUnreserved(A))}}else if(s===""&&(t==="&"||t==="?")){o.push(encodeUnreserved(A)+"=")}else if(s===""){o.push("")}}return o}function parseUrl(e){return{expand:expand.bind(null,e)}}function expand(e,t){var A=["+","#",".","/",";","?","&"];e=e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(e,r,s){if(r){let e="";const s=[];if(A.indexOf(r.charAt(0))!==-1){e=r.charAt(0);r=r.substr(1)}r.split(/,/g).forEach(function(A){var r=/([^:\*]*)(?::(\d+)|(\*))?/.exec(A);s.push(getValues(t,e,r[1],r[2]||r[3]))});if(e&&e!=="+"){var o=",";if(e==="?"){o="&"}else if(e!=="#"){o=e}return(s.length!==0?e:"")+s.join(o)}else{return s.join(",")}}else{return encodeReserved(s)}});if(e==="/"){return e}else{return e.replace(/\/$/,"")}}function parse(e){let t=e.method.toUpperCase();let A=(e.url||"/").replace(/:([a-z]\w+)/g,"{$1}");let r=Object.assign({},e.headers);let s;let o=omit(e,["method","baseUrl","url","headers","request","mediaType"]);const n=extractUrlVariableNames(A);A=parseUrl(A).expand(o);if(!/^http/.test(A)){A=e.baseUrl+A}const i=Object.keys(e).filter(e=>n.includes(e)).concat("baseUrl");const a=omit(o,i);const c=/application\/octet-stream/i.test(r.accept);if(!c){if(e.mediaType.format){r.accept=r.accept.split(/,/).map(t=>t.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${e.mediaType.format}`)).join(",")}if(A.endsWith("/graphql")){if(e.mediaType.previews?.length){const t=r.accept.match(/(?{const A=e.mediaType.format?`.${e.mediaType.format}`:"+json";return`application/vnd.github.${t}-preview${A}`}).join(",")}}}if(["GET","HEAD"].includes(t)){A=addQueryParameters(A,a)}else{if("data"in a){s=a.data}else{if(Object.keys(a).length){s=a}}}if(!r["content-type"]&&typeof s!=="undefined"){r["content-type"]="application/json; charset=utf-8"}if(["PATCH","PUT"].includes(t)&&typeof s==="undefined"){s=""}return Object.assign({method:t,url:A,headers:r},typeof s!=="undefined"?{body:s}:null,e.request?{request:e.request}:null)}function endpointWithDefaults(e,t,A){return parse(merge(e,t,A))}function withDefaults(e,t){const A=merge(e,t);const r=endpointWithDefaults.bind(null,A);return Object.assign(r,{DEFAULTS:A,defaults:withDefaults.bind(null,A),merge:merge.bind(null,A),parse:parse})}var me=withDefaults(null,pe);var we=__nccwpck_require__(4649);const ye=/^-?\d+$/;const be=/^-?\d+n+$/;const ke=JSON.stringify;const De=JSON.parse;const Re=/^-?\d+n$/;const Te=/([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g;const Fe=/([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g;const JSONStringify=(e,t,A)=>{if("rawJSON"in JSON){return ke(e,(e,A)=>{if(typeof A==="bigint")return JSON.rawJSON(A.toString());if(typeof t==="function")return t(e,A);if(Array.isArray(t)&&t.includes(e))return A;return A},A)}if(!e)return ke(e,t,A);const r=ke(e,(e,A)=>{const r=typeof A==="string"&&be.test(A);if(r)return A.toString()+"n";if(typeof A==="bigint")return A.toString()+"n";if(typeof t==="function")return t(e,A);if(Array.isArray(t)&&t.includes(e))return A;return A},A);const s=r.replace(Te,"$1$2$3");const o=s.replace(Fe,"$1$2$3");return o};const Se=new Map;const isContextSourceSupported=()=>{const e=JSON.parse.toString();if(Se.has(e)){return Se.get(e)}try{const t=JSON.parse("1",(e,t,A)=>!!A?.source&&A.source==="1");Se.set(e,t);return t}catch{Se.set(e,false);return false}};const convertMarkedBigIntsReviver=(e,t,A,r)=>{const s=typeof t==="string"&&Re.test(t);if(s)return BigInt(t.slice(0,-1));const o=typeof t==="string"&&be.test(t);if(o)return t.slice(0,-1);if(typeof r!=="function")return t;return r(e,t,A)};const JSONParseV2=(e,t)=>JSON.parse(e,(e,A,r)=>{const s=typeof A==="number"&&(A>Number.MAX_SAFE_INTEGER||A{if(!e)return De(e,t);if(isContextSourceSupported())return JSONParseV2(e,t);const A=e.replace(Me,(e,t,A,r)=>{const s=e[0]==='"';const o=s&&Ge.test(e);if(o)return e.substring(0,e.length-1)+'n"';const n=A||r;const i=t&&(t.lengthconvertMarkedBigIntsReviver(e,A,r,t))};class RequestError extends Error{name;status;request;response;constructor(e,t,A){super(e,{cause:A.cause});this.name="HttpError";this.status=Number.parseInt(t);if(Number.isNaN(this.status)){this.status=0} +/* v8 ignore else -- @preserve -- Bug with vitest coverage where it sees an else branch that doesn't exist */if("response"in A){this.response=A.response}const r=Object.assign({},A.request);if(A.request.headers.authorization){r.headers=Object.assign({},A.request.headers,{authorization:A.request.headers.authorization.replace(/(?"";async function fetchWrapper(e){const t=e.request?.fetch||globalThis.fetch;if(!t){throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing")}const A=e.request?.log||console;const r=e.request?.parseSuccessResponseBody!==false;const s=dist_bundle_isPlainObject(e.body)||Array.isArray(e.body)?JSONStringify(e.body):e.body;const o=Object.fromEntries(Object.entries(e.headers).map(([e,t])=>[e,String(t)]));let n;try{n=await t(e.url,{method:e.method,body:s,redirect:e.request?.redirect,headers:o,signal:e.request?.signal,...e.body&&{duplex:"half"}})}catch(t){let A="Unknown Error";if(t instanceof Error){if(t.name==="AbortError"){t.status=500;throw t}A=t.message;if(t.name==="TypeError"&&"cause"in t){if(t.cause instanceof Error){A=t.cause.message}else if(typeof t.cause==="string"){A=t.cause}}}const r=new RequestError(A,500,{request:e});r.cause=t;throw r}const i=n.status;const a=n.url;const c={};for(const[e,t]of n.headers){c[e]=t}const l={url:a,status:i,headers:c,data:""};if("deprecation"in c){const t=c.link&&c.link.match(/<([^<>]+)>; rel="deprecation"/);const r=t&&t.pop();A.warn(`[@octokit/request] "${e.method} ${e.url}" is deprecated. It is scheduled to be removed on ${c.sunset}${r?`. See ${r}`:""}`)}if(i===204||i===205){return l}if(e.method==="HEAD"){if(i<400){return l}throw new RequestError(n.statusText,i,{response:l,request:e})}if(i===304){l.data=await getResponseData(n);throw new RequestError("Not modified",i,{response:l,request:e})}if(i>=400){l.data=await getResponseData(n);throw new RequestError(toErrorMessage(l.data),i,{response:l,request:e})}l.data=r?await getResponseData(n):n.body;return l}async function getResponseData(e){const t=e.headers.get("content-type");if(!t){return e.text().catch(noop)}const A=(0,we.qg)(t);if(isJSONResponse(A)){let t="";try{t=await e.text();return JSONParse(t)}catch(e){return t}}else if(A.type.startsWith("text/")||A.parameters.charset?.toLowerCase()==="utf-8"){return e.text().catch(noop)}else{return e.arrayBuffer().catch( /* v8 ignore next -- @preserve */ -()=>new ArrayBuffer(0))}}function isJSONResponse(e){return e.type==="application/json"||e.type==="application/scim+json"}function toErrorMessage(e){if(typeof e==="string"){return e}if(e instanceof ArrayBuffer){return"Unknown error"}if("message"in e){const t="documentation_url"in e?` - ${e.documentation_url}`:"";return Array.isArray(e.errors)?`${e.message}: ${e.errors.map(e=>JSON.stringify(e)).join(", ")}${t}`:`${e.message}${t}`}return`Unknown error: ${JSON.stringify(e)}`}function dist_bundle_withDefaults(e,t){const A=e.defaults(t);const newApi=function(e,t){const r=A.merge(e,t);if(!r.request||!r.request.hook){return fetchWrapper(A.parse(r))}const request2=(e,t)=>fetchWrapper(A.parse(A.merge(e,t)));Object.assign(request2,{endpoint:A,defaults:dist_bundle_withDefaults.bind(null,A)});return r.request.hook(request2,r)};return Object.assign(newApi,{endpoint:A,defaults:dist_bundle_withDefaults.bind(null,A)})}var Le=dist_bundle_withDefaults(pe,Ge); +()=>new ArrayBuffer(0))}}function isJSONResponse(e){return e.type==="application/json"||e.type==="application/scim+json"}function toErrorMessage(e){if(typeof e==="string"){return e}if(e instanceof ArrayBuffer){return"Unknown error"}if("message"in e){const t="documentation_url"in e?` - ${e.documentation_url}`:"";return Array.isArray(e.errors)?`${e.message}: ${e.errors.map(e=>JSON.stringify(e)).join(", ")}${t}`:`${e.message}${t}`}return`Unknown error: ${JSON.stringify(e)}`}function dist_bundle_withDefaults(e,t){const A=e.defaults(t);const newApi=function(e,t){const r=A.merge(e,t);if(!r.request||!r.request.hook){return fetchWrapper(A.parse(r))}const request2=(e,t)=>fetchWrapper(A.parse(A.merge(e,t)));Object.assign(request2,{endpoint:A,defaults:dist_bundle_withDefaults.bind(null,A)});return r.request.hook(request2,r)};return Object.assign(newApi,{endpoint:A,defaults:dist_bundle_withDefaults.bind(null,A)})}var He=dist_bundle_withDefaults(me,ve); /* v8 ignore next -- @preserve */ -/* v8 ignore else -- @preserve */var ve="0.0.0-development";function _buildMessageForResponseErrors(e){return`Request failed due to following response errors:\n`+e.errors.map(e=>` - ${e.message}`).join("\n")}var He=class extends Error{constructor(e,t,A){super(_buildMessageForResponseErrors(A));this.request=e;this.headers=t;this.response=A;this.errors=A.errors;this.data=A.data;if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}}name="GraphqlResponseError";errors;data};var _e=["method","baseUrl","url","headers","request","query","mediaType","operationName"];var Oe=["query","method","url"];var Ye=/\/api\/v3\/?$/;function graphql(e,t,A){if(A){if(typeof t==="string"&&"query"in A){return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`))}for(const e in A){if(!Oe.includes(e))continue;return Promise.reject(new Error(`[@octokit/graphql] "${e}" cannot be used as variable name`))}}const r=typeof t==="string"?Object.assign({query:t},A):t;const s=Object.keys(r).reduce((e,t)=>{if(_e.includes(t)){e[t]=r[t];return e}if(!e.variables){e.variables={}}e.variables[t]=r[t];return e},{});const o=r.baseUrl||e.endpoint.DEFAULTS.baseUrl;if(Ye.test(o)){s.url=o.replace(Ye,"/api/graphql")}return e(s).then(e=>{if(e.data.errors){const t={};for(const A of Object.keys(e.headers)){t[A]=e.headers[A]}throw new He(s,t,e.data)}return e.data.data})}function graphql_dist_bundle_withDefaults(e,t){const A=e.defaults(t);const newApi=(e,t)=>graphql(A,e,t);return Object.assign(newApi,{defaults:graphql_dist_bundle_withDefaults.bind(null,A),endpoint:A.endpoint})}var Pe=graphql_dist_bundle_withDefaults(Le,{headers:{"user-agent":`octokit-graphql.js/${ve} ${getUserAgent()}`},method:"POST",url:"/graphql"});function withCustomRequest(e){return graphql_dist_bundle_withDefaults(e,{method:"POST",url:"/graphql"})}var xe="(?:[a-zA-Z0-9_-]+)";var Je="\\.";var Ve=new RegExp(`^${xe}${Je}${xe}${Je}${xe}$`);var We=Ve.test.bind(Ve);async function auth(e){const t=We(e);const A=e.startsWith("v1.")||e.startsWith("ghs_");const r=e.startsWith("ghu_");const s=t?"app":A?"installation":r?"user-to-server":"oauth";return{type:"token",token:e,tokenType:s}}function withAuthorizationPrefix(e){if(e.split(/\./).length===3){return`bearer ${e}`}return`token ${e}`}async function hook(e,t,A,r){const s=t.endpoint.merge(A,r);s.headers.authorization=withAuthorizationPrefix(e);return t(s)}var qe=function createTokenAuth2(e){if(!e){throw new Error("[@octokit/auth-token] No token passed to createTokenAuth")}if(typeof e!=="string"){throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string")}e=e.replace(/^(token|bearer) +/i,"");return Object.assign(auth.bind(null,e),{hook:hook.bind(null,e)})};const ze="7.0.6";const dist_src_noop=()=>{};const je=console.warn.bind(console);const Ze=console.error.bind(console);function createLogger(e={}){if(typeof e.debug!=="function"){e.debug=dist_src_noop}if(typeof e.info!=="function"){e.info=dist_src_noop}if(typeof e.warn!=="function"){e.warn=je}if(typeof e.error!=="function"){e.error=Ze}return e}const Ke=`octokit-core.js/${ze} ${getUserAgent()}`;class Octokit{static VERSION=ze;static defaults(e){const t=class extends(this){constructor(...t){const A=t[0]||{};if(typeof e==="function"){super(e(A));return}super(Object.assign({},e,A,A.userAgent&&e.userAgent?{userAgent:`${A.userAgent} ${e.userAgent}`}:null))}};return t}static plugins=[];static plugin(...e){const t=this.plugins;const A=class extends(this){static plugins=t.concat(e.filter(e=>!t.includes(e)))};return A}constructor(e={}){const t=new de.Collection;const A={baseUrl:Le.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},e.request,{hook:t.bind(null,"request")}),mediaType:{previews:[],format:""}};A.headers["user-agent"]=e.userAgent?`${e.userAgent} ${Ke}`:Ke;if(e.baseUrl){A.baseUrl=e.baseUrl}if(e.previews){A.mediaType.previews=e.previews}if(e.timeZone){A.headers["time-zone"]=e.timeZone}this.request=Le.defaults(A);this.graphql=withCustomRequest(this.request).defaults(A);this.log=createLogger(e.log);this.hook=t;if(!e.authStrategy){if(!e.auth){this.auth=async()=>({type:"unauthenticated"})}else{const A=qe(e.auth);t.wrap("request",A.hook);this.auth=A}}else{const{authStrategy:A,...r}=e;const s=A(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:r},e.auth));t.wrap("request",s.hook);this.auth=s}const r=this.constructor;for(let t=0;t({async next(){if(!i)return{done:true};try{const e=await s({method:o,url:i,headers:n});const t=normalizePaginatedListResponse(e);i=((t.headers.link||"").match(/<([^<>]+)>;\s*rel="next"/)||[])[1];if(!i&&"total_commits"in t.data){const e=new URL(t.url);const A=e.searchParams;const r=parseInt(A.get("page")||"1",10);const s=parseInt(A.get("per_page")||"250",10);if(r*s{if(s.done){return t}let o=false;function done(){o=true}t=t.concat(r?r(s.value,done):s.value.data);if(o){return t}return gather(e,t,A,r)})}var st=Object.assign(paginate,{iterator:iterator});var ot=null&&["GET /advisories","GET /app/hook/deliveries","GET /app/installation-requests","GET /app/installations","GET /assignments/{assignment_id}/accepted_assignments","GET /classrooms","GET /classrooms/{classroom_id}/assignments","GET /enterprises/{enterprise}/code-security/configurations","GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories","GET /enterprises/{enterprise}/dependabot/alerts","GET /enterprises/{enterprise}/teams","GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships","GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations","GET /events","GET /gists","GET /gists/public","GET /gists/starred","GET /gists/{gist_id}/comments","GET /gists/{gist_id}/commits","GET /gists/{gist_id}/forks","GET /installation/repositories","GET /issues","GET /licenses","GET /marketplace_listing/plans","GET /marketplace_listing/plans/{plan_id}/accounts","GET /marketplace_listing/stubbed/plans","GET /marketplace_listing/stubbed/plans/{plan_id}/accounts","GET /networks/{owner}/{repo}/events","GET /notifications","GET /organizations","GET /organizations/{org}/dependabot/repository-access","GET /orgs/{org}/actions/cache/usage-by-repository","GET /orgs/{org}/actions/hosted-runners","GET /orgs/{org}/actions/permissions/repositories","GET /orgs/{org}/actions/permissions/self-hosted-runners/repositories","GET /orgs/{org}/actions/runner-groups","GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners","GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories","GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners","GET /orgs/{org}/actions/runners","GET /orgs/{org}/actions/secrets","GET /orgs/{org}/actions/secrets/{secret_name}/repositories","GET /orgs/{org}/actions/variables","GET /orgs/{org}/actions/variables/{name}/repositories","GET /orgs/{org}/attestations/repositories","GET /orgs/{org}/attestations/{subject_digest}","GET /orgs/{org}/blocks","GET /orgs/{org}/campaigns","GET /orgs/{org}/code-scanning/alerts","GET /orgs/{org}/code-security/configurations","GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories","GET /orgs/{org}/codespaces","GET /orgs/{org}/codespaces/secrets","GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories","GET /orgs/{org}/copilot/billing/seats","GET /orgs/{org}/copilot/metrics","GET /orgs/{org}/dependabot/alerts","GET /orgs/{org}/dependabot/secrets","GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories","GET /orgs/{org}/events","GET /orgs/{org}/failed_invitations","GET /orgs/{org}/hooks","GET /orgs/{org}/hooks/{hook_id}/deliveries","GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}","GET /orgs/{org}/insights/api/subject-stats","GET /orgs/{org}/insights/api/user-stats/{user_id}","GET /orgs/{org}/installations","GET /orgs/{org}/invitations","GET /orgs/{org}/invitations/{invitation_id}/teams","GET /orgs/{org}/issues","GET /orgs/{org}/members","GET /orgs/{org}/members/{username}/codespaces","GET /orgs/{org}/migrations","GET /orgs/{org}/migrations/{migration_id}/repositories","GET /orgs/{org}/organization-roles/{role_id}/teams","GET /orgs/{org}/organization-roles/{role_id}/users","GET /orgs/{org}/outside_collaborators","GET /orgs/{org}/packages","GET /orgs/{org}/packages/{package_type}/{package_name}/versions","GET /orgs/{org}/personal-access-token-requests","GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories","GET /orgs/{org}/personal-access-tokens","GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories","GET /orgs/{org}/private-registries","GET /orgs/{org}/projects","GET /orgs/{org}/projectsV2","GET /orgs/{org}/projectsV2/{project_number}/fields","GET /orgs/{org}/projectsV2/{project_number}/items","GET /orgs/{org}/properties/values","GET /orgs/{org}/public_members","GET /orgs/{org}/repos","GET /orgs/{org}/rulesets","GET /orgs/{org}/rulesets/rule-suites","GET /orgs/{org}/rulesets/{ruleset_id}/history","GET /orgs/{org}/secret-scanning/alerts","GET /orgs/{org}/security-advisories","GET /orgs/{org}/settings/immutable-releases/repositories","GET /orgs/{org}/settings/network-configurations","GET /orgs/{org}/team/{team_slug}/copilot/metrics","GET /orgs/{org}/teams","GET /orgs/{org}/teams/{team_slug}/discussions","GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments","GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions","GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions","GET /orgs/{org}/teams/{team_slug}/invitations","GET /orgs/{org}/teams/{team_slug}/members","GET /orgs/{org}/teams/{team_slug}/projects","GET /orgs/{org}/teams/{team_slug}/repos","GET /orgs/{org}/teams/{team_slug}/teams","GET /projects/{project_id}/collaborators","GET /repos/{owner}/{repo}/actions/artifacts","GET /repos/{owner}/{repo}/actions/caches","GET /repos/{owner}/{repo}/actions/organization-secrets","GET /repos/{owner}/{repo}/actions/organization-variables","GET /repos/{owner}/{repo}/actions/runners","GET /repos/{owner}/{repo}/actions/runs","GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts","GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs","GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs","GET /repos/{owner}/{repo}/actions/secrets","GET /repos/{owner}/{repo}/actions/variables","GET /repos/{owner}/{repo}/actions/workflows","GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs","GET /repos/{owner}/{repo}/activity","GET /repos/{owner}/{repo}/assignees","GET /repos/{owner}/{repo}/attestations/{subject_digest}","GET /repos/{owner}/{repo}/branches","GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations","GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs","GET /repos/{owner}/{repo}/code-scanning/alerts","GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances","GET /repos/{owner}/{repo}/code-scanning/analyses","GET /repos/{owner}/{repo}/codespaces","GET /repos/{owner}/{repo}/codespaces/devcontainers","GET /repos/{owner}/{repo}/codespaces/secrets","GET /repos/{owner}/{repo}/collaborators","GET /repos/{owner}/{repo}/comments","GET /repos/{owner}/{repo}/comments/{comment_id}/reactions","GET /repos/{owner}/{repo}/commits","GET /repos/{owner}/{repo}/commits/{commit_sha}/comments","GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls","GET /repos/{owner}/{repo}/commits/{ref}/check-runs","GET /repos/{owner}/{repo}/commits/{ref}/check-suites","GET /repos/{owner}/{repo}/commits/{ref}/status","GET /repos/{owner}/{repo}/commits/{ref}/statuses","GET /repos/{owner}/{repo}/compare/{basehead}","GET /repos/{owner}/{repo}/compare/{base}...{head}","GET /repos/{owner}/{repo}/contributors","GET /repos/{owner}/{repo}/dependabot/alerts","GET /repos/{owner}/{repo}/dependabot/secrets","GET /repos/{owner}/{repo}/deployments","GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses","GET /repos/{owner}/{repo}/environments","GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies","GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps","GET /repos/{owner}/{repo}/environments/{environment_name}/secrets","GET /repos/{owner}/{repo}/environments/{environment_name}/variables","GET /repos/{owner}/{repo}/events","GET /repos/{owner}/{repo}/forks","GET /repos/{owner}/{repo}/hooks","GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries","GET /repos/{owner}/{repo}/invitations","GET /repos/{owner}/{repo}/issues","GET /repos/{owner}/{repo}/issues/comments","GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions","GET /repos/{owner}/{repo}/issues/events","GET /repos/{owner}/{repo}/issues/{issue_number}/comments","GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by","GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking","GET /repos/{owner}/{repo}/issues/{issue_number}/events","GET /repos/{owner}/{repo}/issues/{issue_number}/labels","GET /repos/{owner}/{repo}/issues/{issue_number}/reactions","GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues","GET /repos/{owner}/{repo}/issues/{issue_number}/timeline","GET /repos/{owner}/{repo}/keys","GET /repos/{owner}/{repo}/labels","GET /repos/{owner}/{repo}/milestones","GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels","GET /repos/{owner}/{repo}/notifications","GET /repos/{owner}/{repo}/pages/builds","GET /repos/{owner}/{repo}/projects","GET /repos/{owner}/{repo}/pulls","GET /repos/{owner}/{repo}/pulls/comments","GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions","GET /repos/{owner}/{repo}/pulls/{pull_number}/comments","GET /repos/{owner}/{repo}/pulls/{pull_number}/commits","GET /repos/{owner}/{repo}/pulls/{pull_number}/files","GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews","GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments","GET /repos/{owner}/{repo}/releases","GET /repos/{owner}/{repo}/releases/{release_id}/assets","GET /repos/{owner}/{repo}/releases/{release_id}/reactions","GET /repos/{owner}/{repo}/rules/branches/{branch}","GET /repos/{owner}/{repo}/rulesets","GET /repos/{owner}/{repo}/rulesets/rule-suites","GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history","GET /repos/{owner}/{repo}/secret-scanning/alerts","GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations","GET /repos/{owner}/{repo}/security-advisories","GET /repos/{owner}/{repo}/stargazers","GET /repos/{owner}/{repo}/subscribers","GET /repos/{owner}/{repo}/tags","GET /repos/{owner}/{repo}/teams","GET /repos/{owner}/{repo}/topics","GET /repositories","GET /search/code","GET /search/commits","GET /search/issues","GET /search/labels","GET /search/repositories","GET /search/topics","GET /search/users","GET /teams/{team_id}/discussions","GET /teams/{team_id}/discussions/{discussion_number}/comments","GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions","GET /teams/{team_id}/discussions/{discussion_number}/reactions","GET /teams/{team_id}/invitations","GET /teams/{team_id}/members","GET /teams/{team_id}/projects","GET /teams/{team_id}/repos","GET /teams/{team_id}/teams","GET /user/blocks","GET /user/codespaces","GET /user/codespaces/secrets","GET /user/emails","GET /user/followers","GET /user/following","GET /user/gpg_keys","GET /user/installations","GET /user/installations/{installation_id}/repositories","GET /user/issues","GET /user/keys","GET /user/marketplace_purchases","GET /user/marketplace_purchases/stubbed","GET /user/memberships/orgs","GET /user/migrations","GET /user/migrations/{migration_id}/repositories","GET /user/orgs","GET /user/packages","GET /user/packages/{package_type}/{package_name}/versions","GET /user/public_emails","GET /user/repos","GET /user/repository_invitations","GET /user/social_accounts","GET /user/ssh_signing_keys","GET /user/starred","GET /user/subscriptions","GET /user/teams","GET /users","GET /users/{username}/attestations/{subject_digest}","GET /users/{username}/events","GET /users/{username}/events/orgs/{org}","GET /users/{username}/events/public","GET /users/{username}/followers","GET /users/{username}/following","GET /users/{username}/gists","GET /users/{username}/gpg_keys","GET /users/{username}/keys","GET /users/{username}/orgs","GET /users/{username}/packages","GET /users/{username}/projects","GET /users/{username}/projectsV2","GET /users/{username}/projectsV2/{project_number}/fields","GET /users/{username}/projectsV2/{project_number}/items","GET /users/{username}/received_events","GET /users/{username}/received_events/public","GET /users/{username}/repos","GET /users/{username}/social_accounts","GET /users/{username}/ssh_signing_keys","GET /users/{username}/starred","GET /users/{username}/subscriptions"];function isPaginatingEndpoint(e){if(typeof e==="string"){return ot.includes(e)}else{return false}}function paginateRest(e){return{paginate:Object.assign(paginate.bind(null,e),{iterator:iterator.bind(null,e)})}}paginateRest.VERSION=rt;const nt=new Context;const it=getApiBaseUrl();const at={baseUrl:it,request:{agent:getProxyAgent(it),fetch:getProxyFetch(it)}};const ct=Octokit.plugin(restEndpointMethods,paginateRest).defaults(at);function utils_getOctokitOptions(e,t){const A=Object.assign({},t||{});const r=Utils.getAuthString(e,A);if(r){A.auth=r}const s=Utils.getUserAgentWithOrchestrationId(A.userAgent);if(s){A.userAgent=s}return A}const lt=new Context;function getOctokit(e,t,...A){const r=GitHub.plugin(...A);return new r(getOctokitOptions(e,t))}const gt=["gradle_location","tag_prefix","skip_ci","commit_message","build_number"];const formatLogValue=e=>typeof e==="string"?e:JSON.stringify(e);class Toolkit{context={payload:lt.payload};inputs=Object.fromEntries(gt.map(e=>[e,getInput(e)||undefined]));log={log:e=>info(formatLogValue(e)),warn:e=>warning(formatLogValue(e)),fatal:e=>error(e instanceof Error?e:formatLogValue(e))};exit={success:e=>info(e),failure:e=>setFailed(e)};static async run(e){await e(new Toolkit)}async exec(e,t){await exec_exec(e,t)}async readFile(e){return t().readFile(e)}setOutput(e,t){setOutput(e,t)}}const getCommitIntent=e=>{const[t]=e.toLowerCase().split(":");return t};const isMajorBump=e=>{if(e.includes("BREAKING CHANGE")){return true}const t=getCommitIntent(e);if(t.includes("!")){return true}const A=["major"];return A.some(e=>t.startsWith(e))};const isMinorBump=e=>{const t=["minor","feat"];const A=getCommitIntent(e);return t.some(e=>A.startsWith(e))};const isPatchBump=e=>{const t=["patch","build","chore","ci","docs","fix","perf","refactor","revert","style","test"];const A=getCommitIntent(e);return t.some(e=>A.startsWith(e))};const isSemanticCommit=e=>/^([a-zA-Z]+)(\(.+\))?(!)?:/.test(e);const getVersionName=({major:e,minor:t,patch:A,build:r})=>{const s=`${e}.${t}.${A}`;return r?`${s}.${r}`:s};const getVersionCode=({major:e,minor:t,patch:A})=>e*1e4+t*100+A;const getBuildFromVersion=e=>({version:e,name:getVersionName(e),code:getVersionCode(e)});const bumpBuild=(e,t,A)=>{const r=e.map(e=>typeof e==="string"?e:e.message).filter(e=>typeof e==="string"&&isSemanticCommit(e));const s=r.some(isMajorBump);if(s){const e={major:t.major+1,minor:0,patch:0};if(A){e.build=A}return{version:e,name:getVersionName(e),code:getVersionCode(e)}}const o=r.some(isMinorBump);if(o){const e={major:t.major,minor:t.minor+1,patch:0};if(A){e.build=A}return{version:e,name:getVersionName(e),code:getVersionCode(e)}}const n={major:t.major,minor:t.minor,patch:t.patch+1};if(A){n.build=A}return{version:n,name:getVersionName(n),code:getVersionCode(n)}};const main=async()=>{await Toolkit.run(async e=>{try{console.log("process.env.GITHUB_WORKSPACE",process.env.GITHUB_WORKSPACE);console.log("process.env.GITHUB_HEAD_REF",process.env.GITHUB_HEAD_REF);const A=process.env.GITHUB_WORKSPACE;if(A){await runCommand("git",["config","--global","safe.directory",A])}const r=process.env.GITHUB_HEAD_REF;if(r){await runCommand("git",["checkout",r])}await runCommand("git",["fetch"]);const s=getTagPrefix(e);const o=isSkippingCi(e);const n=getBuildNumber(e);const i=await doesVersionPropertiesExist(t());let a;if(i){const t=await getVersionProperties(e);const{commits:A}=e.context.payload;a=bumpBuild(A??[],t,n)}else{const e={major:0,minor:0,patch:1,build:n};a=getBuildFromVersion(e)}const c=getCommitMessage(e,a,s,o);await setVersionProperties(t(),e,a.version);await setGitIdentity(e);await createCommit(e,c);await pushChanges(e,a.name,true);e.setOutput("new_tag",a.name);e.setOutput("git_tag",a.name);e.setOutput("version_name",a.name);e.setOutput("version_code",a.code.toString());e.exit.success(`Version bumped version to ${a.name} successfully!`)}catch(t){e.log.fatal(t);e.exit.failure("Failed to bump version!")}})};(async()=>await main())()})();module.exports=A})(); \ No newline at end of file +/* v8 ignore else -- @preserve */var _e="0.0.0-development";function _buildMessageForResponseErrors(e){return`Request failed due to following response errors:\n`+e.errors.map(e=>` - ${e.message}`).join("\n")}var Oe=class extends Error{constructor(e,t,A){super(_buildMessageForResponseErrors(A));this.request=e;this.headers=t;this.response=A;this.errors=A.errors;this.data=A.data;if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}}name="GraphqlResponseError";errors;data};var Ye=["method","baseUrl","url","headers","request","query","mediaType","operationName"];var Pe=["query","method","url"];var xe=/\/api\/v3\/?$/;function graphql(e,t,A){if(A){if(typeof t==="string"&&"query"in A){return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`))}for(const e in A){if(!Pe.includes(e))continue;return Promise.reject(new Error(`[@octokit/graphql] "${e}" cannot be used as variable name`))}}const r=typeof t==="string"?Object.assign({query:t},A):t;const s=Object.keys(r).reduce((e,t)=>{if(Ye.includes(t)){e[t]=r[t];return e}if(!e.variables){e.variables={}}e.variables[t]=r[t];return e},{});const o=r.baseUrl||e.endpoint.DEFAULTS.baseUrl;if(xe.test(o)){s.url=o.replace(xe,"/api/graphql")}return e(s).then(e=>{if(e.data.errors){const t={};for(const A of Object.keys(e.headers)){t[A]=e.headers[A]}throw new Oe(s,t,e.data)}return e.data.data})}function graphql_dist_bundle_withDefaults(e,t){const A=e.defaults(t);const newApi=(e,t)=>graphql(A,e,t);return Object.assign(newApi,{defaults:graphql_dist_bundle_withDefaults.bind(null,A),endpoint:A.endpoint})}var Je=graphql_dist_bundle_withDefaults(He,{headers:{"user-agent":`octokit-graphql.js/${_e} ${getUserAgent()}`},method:"POST",url:"/graphql"});function withCustomRequest(e){return graphql_dist_bundle_withDefaults(e,{method:"POST",url:"/graphql"})}var Ve="(?:[a-zA-Z0-9_-]+)";var We="\\.";var qe=new RegExp(`^${Ve}${We}${Ve}${We}${Ve}$`);var ze=qe.test.bind(qe);async function auth(e){const t=ze(e);const A=e.startsWith("v1.")||e.startsWith("ghs_");const r=e.startsWith("ghu_");const s=t?"app":A?"installation":r?"user-to-server":"oauth";return{type:"token",token:e,tokenType:s}}function withAuthorizationPrefix(e){if(e.split(/\./).length===3){return`bearer ${e}`}return`token ${e}`}async function hook(e,t,A,r){const s=t.endpoint.merge(A,r);s.headers.authorization=withAuthorizationPrefix(e);return t(s)}var je=function createTokenAuth2(e){if(!e){throw new Error("[@octokit/auth-token] No token passed to createTokenAuth")}if(typeof e!=="string"){throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string")}e=e.replace(/^(token|bearer) +/i,"");return Object.assign(auth.bind(null,e),{hook:hook.bind(null,e)})};const Ze="7.0.6";const dist_src_noop=()=>{};const Ke=console.warn.bind(console);const Xe=console.error.bind(console);function createLogger(e={}){if(typeof e.debug!=="function"){e.debug=dist_src_noop}if(typeof e.info!=="function"){e.info=dist_src_noop}if(typeof e.warn!=="function"){e.warn=Ke}if(typeof e.error!=="function"){e.error=Xe}return e}const $e=`octokit-core.js/${Ze} ${getUserAgent()}`;class Octokit{static VERSION=Ze;static defaults(e){const t=class extends(this){constructor(...t){const A=t[0]||{};if(typeof e==="function"){super(e(A));return}super(Object.assign({},e,A,A.userAgent&&e.userAgent?{userAgent:`${A.userAgent} ${e.userAgent}`}:null))}};return t}static plugins=[];static plugin(...e){const t=this.plugins;const A=class extends(this){static plugins=t.concat(e.filter(e=>!t.includes(e)))};return A}constructor(e={}){const t=new Ce.Collection;const A={baseUrl:He.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},e.request,{hook:t.bind(null,"request")}),mediaType:{previews:[],format:""}};A.headers["user-agent"]=e.userAgent?`${e.userAgent} ${$e}`:$e;if(e.baseUrl){A.baseUrl=e.baseUrl}if(e.previews){A.mediaType.previews=e.previews}if(e.timeZone){A.headers["time-zone"]=e.timeZone}this.request=He.defaults(A);this.graphql=withCustomRequest(this.request).defaults(A);this.log=createLogger(e.log);this.hook=t;if(!e.authStrategy){if(!e.auth){this.auth=async()=>({type:"unauthenticated"})}else{const A=je(e.auth);t.wrap("request",A.hook);this.auth=A}}else{const{authStrategy:A,...r}=e;const s=A(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:r},e.auth));t.wrap("request",s.hook);this.auth=s}const r=this.constructor;for(let t=0;t({async next(){if(!i)return{done:true};try{const e=await s({method:o,url:i,headers:n});const t=normalizePaginatedListResponse(e);i=((t.headers.link||"").match(/<([^<>]+)>;\s*rel="next"/)||[])[1];if(!i&&"total_commits"in t.data){const e=new URL(t.url);const A=e.searchParams;const r=parseInt(A.get("page")||"1",10);const s=parseInt(A.get("per_page")||"250",10);if(r*s{if(s.done){return t}let o=false;function done(){o=true}t=t.concat(r?r(s.value,done):s.value.data);if(o){return t}return gather(e,t,A,r)})}var nt=Object.assign(paginate,{iterator:iterator});var it=null&&["GET /advisories","GET /app/hook/deliveries","GET /app/installation-requests","GET /app/installations","GET /assignments/{assignment_id}/accepted_assignments","GET /classrooms","GET /classrooms/{classroom_id}/assignments","GET /enterprises/{enterprise}/code-security/configurations","GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories","GET /enterprises/{enterprise}/dependabot/alerts","GET /enterprises/{enterprise}/teams","GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships","GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations","GET /events","GET /gists","GET /gists/public","GET /gists/starred","GET /gists/{gist_id}/comments","GET /gists/{gist_id}/commits","GET /gists/{gist_id}/forks","GET /installation/repositories","GET /issues","GET /licenses","GET /marketplace_listing/plans","GET /marketplace_listing/plans/{plan_id}/accounts","GET /marketplace_listing/stubbed/plans","GET /marketplace_listing/stubbed/plans/{plan_id}/accounts","GET /networks/{owner}/{repo}/events","GET /notifications","GET /organizations","GET /organizations/{org}/dependabot/repository-access","GET /orgs/{org}/actions/cache/usage-by-repository","GET /orgs/{org}/actions/hosted-runners","GET /orgs/{org}/actions/permissions/repositories","GET /orgs/{org}/actions/permissions/self-hosted-runners/repositories","GET /orgs/{org}/actions/runner-groups","GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners","GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories","GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners","GET /orgs/{org}/actions/runners","GET /orgs/{org}/actions/secrets","GET /orgs/{org}/actions/secrets/{secret_name}/repositories","GET /orgs/{org}/actions/variables","GET /orgs/{org}/actions/variables/{name}/repositories","GET /orgs/{org}/attestations/repositories","GET /orgs/{org}/attestations/{subject_digest}","GET /orgs/{org}/blocks","GET /orgs/{org}/campaigns","GET /orgs/{org}/code-scanning/alerts","GET /orgs/{org}/code-security/configurations","GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories","GET /orgs/{org}/codespaces","GET /orgs/{org}/codespaces/secrets","GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories","GET /orgs/{org}/copilot/billing/seats","GET /orgs/{org}/copilot/metrics","GET /orgs/{org}/dependabot/alerts","GET /orgs/{org}/dependabot/secrets","GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories","GET /orgs/{org}/events","GET /orgs/{org}/failed_invitations","GET /orgs/{org}/hooks","GET /orgs/{org}/hooks/{hook_id}/deliveries","GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}","GET /orgs/{org}/insights/api/subject-stats","GET /orgs/{org}/insights/api/user-stats/{user_id}","GET /orgs/{org}/installations","GET /orgs/{org}/invitations","GET /orgs/{org}/invitations/{invitation_id}/teams","GET /orgs/{org}/issues","GET /orgs/{org}/members","GET /orgs/{org}/members/{username}/codespaces","GET /orgs/{org}/migrations","GET /orgs/{org}/migrations/{migration_id}/repositories","GET /orgs/{org}/organization-roles/{role_id}/teams","GET /orgs/{org}/organization-roles/{role_id}/users","GET /orgs/{org}/outside_collaborators","GET /orgs/{org}/packages","GET /orgs/{org}/packages/{package_type}/{package_name}/versions","GET /orgs/{org}/personal-access-token-requests","GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories","GET /orgs/{org}/personal-access-tokens","GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories","GET /orgs/{org}/private-registries","GET /orgs/{org}/projects","GET /orgs/{org}/projectsV2","GET /orgs/{org}/projectsV2/{project_number}/fields","GET /orgs/{org}/projectsV2/{project_number}/items","GET /orgs/{org}/properties/values","GET /orgs/{org}/public_members","GET /orgs/{org}/repos","GET /orgs/{org}/rulesets","GET /orgs/{org}/rulesets/rule-suites","GET /orgs/{org}/rulesets/{ruleset_id}/history","GET /orgs/{org}/secret-scanning/alerts","GET /orgs/{org}/security-advisories","GET /orgs/{org}/settings/immutable-releases/repositories","GET /orgs/{org}/settings/network-configurations","GET /orgs/{org}/team/{team_slug}/copilot/metrics","GET /orgs/{org}/teams","GET /orgs/{org}/teams/{team_slug}/discussions","GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments","GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions","GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions","GET /orgs/{org}/teams/{team_slug}/invitations","GET /orgs/{org}/teams/{team_slug}/members","GET /orgs/{org}/teams/{team_slug}/projects","GET /orgs/{org}/teams/{team_slug}/repos","GET /orgs/{org}/teams/{team_slug}/teams","GET /projects/{project_id}/collaborators","GET /repos/{owner}/{repo}/actions/artifacts","GET /repos/{owner}/{repo}/actions/caches","GET /repos/{owner}/{repo}/actions/organization-secrets","GET /repos/{owner}/{repo}/actions/organization-variables","GET /repos/{owner}/{repo}/actions/runners","GET /repos/{owner}/{repo}/actions/runs","GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts","GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs","GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs","GET /repos/{owner}/{repo}/actions/secrets","GET /repos/{owner}/{repo}/actions/variables","GET /repos/{owner}/{repo}/actions/workflows","GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs","GET /repos/{owner}/{repo}/activity","GET /repos/{owner}/{repo}/assignees","GET /repos/{owner}/{repo}/attestations/{subject_digest}","GET /repos/{owner}/{repo}/branches","GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations","GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs","GET /repos/{owner}/{repo}/code-scanning/alerts","GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances","GET /repos/{owner}/{repo}/code-scanning/analyses","GET /repos/{owner}/{repo}/codespaces","GET /repos/{owner}/{repo}/codespaces/devcontainers","GET /repos/{owner}/{repo}/codespaces/secrets","GET /repos/{owner}/{repo}/collaborators","GET /repos/{owner}/{repo}/comments","GET /repos/{owner}/{repo}/comments/{comment_id}/reactions","GET /repos/{owner}/{repo}/commits","GET /repos/{owner}/{repo}/commits/{commit_sha}/comments","GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls","GET /repos/{owner}/{repo}/commits/{ref}/check-runs","GET /repos/{owner}/{repo}/commits/{ref}/check-suites","GET /repos/{owner}/{repo}/commits/{ref}/status","GET /repos/{owner}/{repo}/commits/{ref}/statuses","GET /repos/{owner}/{repo}/compare/{basehead}","GET /repos/{owner}/{repo}/compare/{base}...{head}","GET /repos/{owner}/{repo}/contributors","GET /repos/{owner}/{repo}/dependabot/alerts","GET /repos/{owner}/{repo}/dependabot/secrets","GET /repos/{owner}/{repo}/deployments","GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses","GET /repos/{owner}/{repo}/environments","GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies","GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps","GET /repos/{owner}/{repo}/environments/{environment_name}/secrets","GET /repos/{owner}/{repo}/environments/{environment_name}/variables","GET /repos/{owner}/{repo}/events","GET /repos/{owner}/{repo}/forks","GET /repos/{owner}/{repo}/hooks","GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries","GET /repos/{owner}/{repo}/invitations","GET /repos/{owner}/{repo}/issues","GET /repos/{owner}/{repo}/issues/comments","GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions","GET /repos/{owner}/{repo}/issues/events","GET /repos/{owner}/{repo}/issues/{issue_number}/comments","GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by","GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking","GET /repos/{owner}/{repo}/issues/{issue_number}/events","GET /repos/{owner}/{repo}/issues/{issue_number}/labels","GET /repos/{owner}/{repo}/issues/{issue_number}/reactions","GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues","GET /repos/{owner}/{repo}/issues/{issue_number}/timeline","GET /repos/{owner}/{repo}/keys","GET /repos/{owner}/{repo}/labels","GET /repos/{owner}/{repo}/milestones","GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels","GET /repos/{owner}/{repo}/notifications","GET /repos/{owner}/{repo}/pages/builds","GET /repos/{owner}/{repo}/projects","GET /repos/{owner}/{repo}/pulls","GET /repos/{owner}/{repo}/pulls/comments","GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions","GET /repos/{owner}/{repo}/pulls/{pull_number}/comments","GET /repos/{owner}/{repo}/pulls/{pull_number}/commits","GET /repos/{owner}/{repo}/pulls/{pull_number}/files","GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews","GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments","GET /repos/{owner}/{repo}/releases","GET /repos/{owner}/{repo}/releases/{release_id}/assets","GET /repos/{owner}/{repo}/releases/{release_id}/reactions","GET /repos/{owner}/{repo}/rules/branches/{branch}","GET /repos/{owner}/{repo}/rulesets","GET /repos/{owner}/{repo}/rulesets/rule-suites","GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history","GET /repos/{owner}/{repo}/secret-scanning/alerts","GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations","GET /repos/{owner}/{repo}/security-advisories","GET /repos/{owner}/{repo}/stargazers","GET /repos/{owner}/{repo}/subscribers","GET /repos/{owner}/{repo}/tags","GET /repos/{owner}/{repo}/teams","GET /repos/{owner}/{repo}/topics","GET /repositories","GET /search/code","GET /search/commits","GET /search/issues","GET /search/labels","GET /search/repositories","GET /search/topics","GET /search/users","GET /teams/{team_id}/discussions","GET /teams/{team_id}/discussions/{discussion_number}/comments","GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions","GET /teams/{team_id}/discussions/{discussion_number}/reactions","GET /teams/{team_id}/invitations","GET /teams/{team_id}/members","GET /teams/{team_id}/projects","GET /teams/{team_id}/repos","GET /teams/{team_id}/teams","GET /user/blocks","GET /user/codespaces","GET /user/codespaces/secrets","GET /user/emails","GET /user/followers","GET /user/following","GET /user/gpg_keys","GET /user/installations","GET /user/installations/{installation_id}/repositories","GET /user/issues","GET /user/keys","GET /user/marketplace_purchases","GET /user/marketplace_purchases/stubbed","GET /user/memberships/orgs","GET /user/migrations","GET /user/migrations/{migration_id}/repositories","GET /user/orgs","GET /user/packages","GET /user/packages/{package_type}/{package_name}/versions","GET /user/public_emails","GET /user/repos","GET /user/repository_invitations","GET /user/social_accounts","GET /user/ssh_signing_keys","GET /user/starred","GET /user/subscriptions","GET /user/teams","GET /users","GET /users/{username}/attestations/{subject_digest}","GET /users/{username}/events","GET /users/{username}/events/orgs/{org}","GET /users/{username}/events/public","GET /users/{username}/followers","GET /users/{username}/following","GET /users/{username}/gists","GET /users/{username}/gpg_keys","GET /users/{username}/keys","GET /users/{username}/orgs","GET /users/{username}/packages","GET /users/{username}/projects","GET /users/{username}/projectsV2","GET /users/{username}/projectsV2/{project_number}/fields","GET /users/{username}/projectsV2/{project_number}/items","GET /users/{username}/received_events","GET /users/{username}/received_events/public","GET /users/{username}/repos","GET /users/{username}/social_accounts","GET /users/{username}/ssh_signing_keys","GET /users/{username}/starred","GET /users/{username}/subscriptions"];function isPaginatingEndpoint(e){if(typeof e==="string"){return it.includes(e)}else{return false}}function paginateRest(e){return{paginate:Object.assign(paginate.bind(null,e),{iterator:iterator.bind(null,e)})}}paginateRest.VERSION=ot;const at=new Context;const ct=getApiBaseUrl();const lt={baseUrl:ct,request:{agent:getProxyAgent(ct),fetch:getProxyFetch(ct)}};const gt=Octokit.plugin(restEndpointMethods,paginateRest).defaults(lt);function utils_getOctokitOptions(e,t){const A=Object.assign({},t||{});const r=Utils.getAuthString(e,A);if(r){A.auth=r}const s=Utils.getUserAgentWithOrchestrationId(A.userAgent);if(s){A.userAgent=s}return A}const ut=new Context;function getOctokit(e,t,...A){const r=GitHub.plugin(...A);return new r(getOctokitOptions(e,t))}const Et=["gradle_location","version_storage","tag_prefix","skip_ci","commit_message","build_number"];const formatLogValue=e=>typeof e==="string"?e:JSON.stringify(e);class Toolkit{context={payload:ut.payload};inputs=Object.fromEntries(Et.map(e=>[e,getInput(e)||undefined]));log={log:e=>info(formatLogValue(e)),warn:e=>warning(formatLogValue(e)),fatal:e=>error(e instanceof Error?e:formatLogValue(e))};exit={success:e=>info(e),failure:e=>setFailed(e)};static async run(e){await e(new Toolkit)}async exec(e,t){await exec_exec(e,t)}async readFile(e){return t().readFile(e)}setOutput(e,t){setOutput(e,t)}}const getCommitIntent=e=>{const[t]=e.toLowerCase().split(":");return t};const isMajorBump=e=>{if(e.includes("BREAKING CHANGE")){return true}const t=getCommitIntent(e);if(t.includes("!")){return true}const A=["major"];return A.some(e=>t.startsWith(e))};const isMinorBump=e=>{const t=["minor","feat"];const A=getCommitIntent(e);return t.some(e=>A.startsWith(e))};const isPatchBump=e=>{const t=["patch","build","chore","ci","docs","fix","perf","refactor","revert","style","test"];const A=getCommitIntent(e);return t.some(e=>A.startsWith(e))};const isSemanticCommit=e=>/^([a-zA-Z]+)(\(.+\))?(!)?:/.test(e);const getVersionName=({major:e,minor:t,patch:A,build:r})=>{const s=`${e}.${t}.${A}`;return r?`${s}.${r}`:s};const getVersionCode=({major:e,minor:t,patch:A})=>e*1e4+t*100+A;const getBuildFromVersion=e=>({version:e,name:getVersionName(e),code:getVersionCode(e)});const bumpBuild=(e,t,A)=>{const r=e.map(e=>typeof e==="string"?e:e.message).filter(e=>typeof e==="string"&&isSemanticCommit(e));const s=r.some(isMajorBump);if(s){const e={major:t.major+1,minor:0,patch:0};if(A){e.build=A}return{version:e,name:getVersionName(e),code:getVersionCode(e)}}const o=r.some(isMinorBump);if(o){const e={major:t.major,minor:t.minor+1,patch:0};if(A){e.build=A}return{version:e,name:getVersionName(e),code:getVersionCode(e)}}const n={major:t.major,minor:t.minor,patch:t.patch+1};if(A){n.build=A}return{version:n,name:getVersionName(n),code:getVersionCode(n)}};const main=async()=>{await Toolkit.run(async e=>{try{console.log("process.env.GITHUB_WORKSPACE",process.env.GITHUB_WORKSPACE);console.log("process.env.GITHUB_HEAD_REF",process.env.GITHUB_HEAD_REF);const A=process.env.GITHUB_WORKSPACE;if(A){await runCommand("git",["config","--global","safe.directory",A])}const r=process.env.GITHUB_HEAD_REF;if(r){await runCommand("git",["checkout",r])}await runCommand("git",["fetch"]);const s=getTagPrefix(e);const o=isSkippingCi(e);const n=getBuildNumber(e);const i=getVersionStorageBackend(e);const a=await doesVersionPropertiesExist(t(),i);let c;if(a){const t=await getVersionProperties(e,i);const{commits:A}=e.context.payload;c=bumpBuild(A??[],t,n)}else{const e={major:0,minor:0,patch:1,build:n};c=getBuildFromVersion(e)}const l=getCommitMessage(e,c,s,o);await setVersionProperties(t(),e,c.version,i);await setGitIdentity(e);await createCommit(e,l,[getVersionStoragePath(i)]);await pushChanges(e,c.name,true);e.setOutput("new_tag",c.name);e.setOutput("git_tag",c.name);e.setOutput("version_name",c.name);e.setOutput("version_code",c.code.toString());e.exit.success(`Version bumped version to ${c.name} successfully!`)}catch(t){e.log.fatal(t);e.exit.failure("Failed to bump version!")}})};(async()=>await main())()})();module.exports=A})(); \ No newline at end of file diff --git a/e2e/action.e2e.test.ts b/e2e/action.e2e.test.ts index bee256b..b1adbf0 100644 --- a/e2e/action.e2e.test.ts +++ b/e2e/action.e2e.test.ts @@ -94,6 +94,41 @@ describe('packaged action with local git repositories', () => { }, ); + it('reads and writes gradle.properties when configured', () => { + const fixture = run({ + version: '1.2.3', + versionStorage: 'gradle-properties', + commits: ['fix: repair launch'], + inputs: { + version_storage: 'gradle-properties', + }, + }); + + expect(fixture.result.status).toBe(0); + expect(gitInRemote(fixture, 'show', 'main:gradle.properties')).toBe( + [ + 'org.gradle.jvmargs=-Xmx2g', + 'majorVersion=1', + 'minorVersion=2', + 'patchVersion=4', + 'buildNumber=', + ].join('\n'), + ); + expect( + gitInRemote( + fixture, + 'diff-tree', + '--no-commit-id', + '--name-only', + '-r', + 'main', + ), + ).toBe('gradle.properties'); + expect(gitInRemote(fixture, 'rev-parse', 'refs/tags/1.2.4')).toBe( + gitInRemote(fixture, 'rev-parse', 'refs/heads/main'), + ); + }); + it('applies inputs, identity, and head-ref checkout', () => { const fixture = run({ version: '1.2.3', diff --git a/e2e/harness.ts b/e2e/harness.ts index 9937729..1aed492 100644 --- a/e2e/harness.ts +++ b/e2e/harness.ts @@ -10,9 +10,11 @@ const realGit = execFileSync('command', ['-v', 'git'], { }).trim(); type EventCommit = string | { id: string; message: string }; +type VersionStorage = 'version-properties' | 'gradle-properties'; type FixtureOptions = { version?: string; + versionStorage?: VersionStorage; commits?: string[]; eventCommits?: EventCommit[]; inputs?: Record; @@ -35,17 +37,25 @@ export type ActionFixture = { const git = (cwd: string, args: string[]): string => execFileSync(realGit, args, { cwd, encoding: 'utf8' }).trim(); -const writeVersion = (workspace: string, version: string): void => { +const writeVersion = ( + workspace: string, + version: string, + storage: VersionStorage = 'version-properties', +): void => { const [major, minor, patch] = version.split('.'); - fs.writeFileSync( - path.join(workspace, 'version.properties'), - [ - `majorVersion=${major}`, - `minorVersion=${minor}`, - `patchVersion=${patch}`, - 'buildNumber=', - ].join('\n'), - ); + const fileName = + storage === 'gradle-properties' + ? 'gradle.properties' + : 'version.properties'; + const contents = [ + ...(storage === 'gradle-properties' ? ['org.gradle.jvmargs=-Xmx2g'] : []), + `majorVersion=${major}`, + `minorVersion=${minor}`, + `patchVersion=${patch}`, + 'buildNumber=', + ].join('\n'); + + fs.writeFileSync(path.join(workspace, fileName), contents); }; const createGitShim = (root: string, remote: string): string => { @@ -94,7 +104,7 @@ export const runActionFixture = ( git(workspace, ['config', 'user.email', 'fixture@example.com']); fs.writeFileSync(path.join(workspace, 'README.md'), 'fixture\n'); if (options.version) { - writeVersion(workspace, options.version); + writeVersion(workspace, options.version, options.versionStorage); } git(workspace, ['add', '.']); git(workspace, ['commit', '-m', 'chore: initial fixture']); diff --git a/src/env.test.ts b/src/env.test.ts index 9c234bd..7f5624d 100644 --- a/src/env.test.ts +++ b/src/env.test.ts @@ -1,5 +1,5 @@ import { mock } from 'jest-mock-extended'; -import { getCommitMessage } from './env'; +import { getCommitMessage, getVersionStorageBackend } from './env'; import { Toolkit } from './toolkit'; import { Build } from './version'; @@ -19,6 +19,32 @@ describe('Env', () => { jest.resetAllMocks(); }); + describe('getVersionStorageBackend', () => { + it('should default to version properties', () => { + toolkit.inputs['version_storage'] = undefined; + + const result = getVersionStorageBackend(toolkit); + + expect(result).toEqual('version-properties'); + }); + + it('should return configured version storage backend', () => { + toolkit.inputs['version_storage'] = 'gradle-properties'; + + const result = getVersionStorageBackend(toolkit); + + expect(result).toEqual('gradle-properties'); + }); + + it('should reject unknown version storage backends', () => { + toolkit.inputs['version_storage'] = 'spreadsheet'; + + expect(() => getVersionStorageBackend(toolkit)).toThrow( + 'Invalid version storage backend "spreadsheet"', + ); + }); + }); + describe('getCommitMessage', () => { it('should default message on none set', () => { toolkit.inputs['commit_message'] = undefined; diff --git a/src/env.ts b/src/env.ts index bcb6037..7d036da 100644 --- a/src/env.ts +++ b/src/env.ts @@ -3,11 +3,19 @@ import { Build } from './version'; export type Key = | 'gradle_location' + | 'version_storage' | 'tag_prefix' | 'skip_ci' | 'commit_message' | 'build_number'; +export const versionStorageBackends = [ + 'version-properties', + 'gradle-properties', +] as const; + +export type VersionStorageBackend = (typeof versionStorageBackends)[number]; + export const getValue = ( toolkit: Toolkit, key: Key, @@ -32,6 +40,22 @@ export const getBuildNumber = (toolkit: Toolkit): string => { return getValue(toolkit, 'build_number', ''); }; +export const getVersionStorageBackend = ( + toolkit: Toolkit, +): VersionStorageBackend => { + const backend = getValue(toolkit, 'version_storage', 'version-properties'); + + if (versionStorageBackends.includes(backend as VersionStorageBackend)) { + return backend as VersionStorageBackend; + } + + throw new Error( + `Invalid version storage backend "${backend}". Expected one of: ${versionStorageBackends.join( + ', ', + )}`, + ); +}; + export const getCommitMessage = ( toolkit: Toolkit, build: Build, diff --git a/src/git.ts b/src/git.ts index 7689c88..adbb004 100644 --- a/src/git.ts +++ b/src/git.ts @@ -16,12 +16,13 @@ export const setGitIdentity = async (toolkit: Toolkit): Promise => { export const createCommit = async ( toolkit: Toolkit, commit: string, + paths = ['version.properties'], ): Promise => { try { toolkit.log.log(`Creating version commit`); toolkit.log.log({ commit }); - await runCommand('git', ['add', 'version.properties']); + await runCommand('git', ['add', ...paths]); await runCommand('git', ['commit', '-m', commit]); } catch { toolkit.log.warn( diff --git a/src/gradle.test.ts b/src/gradle.test.ts index d42fa95..89d07e4 100644 --- a/src/gradle.test.ts +++ b/src/gradle.test.ts @@ -1,10 +1,22 @@ import Fs from 'fs/promises'; import { mock } from 'jest-mock-extended'; -import { doesVersionPropertiesExist, getVersionProperties } from './gradle'; +import { + doesVersionPropertiesExist, + getVersionProperties, + setVersionProperties, +} from './gradle'; import { Toolkit } from './toolkit'; const toolkit = mock(); const fs = mock(); +const toolkitWithLog = { + ...toolkit, + log: { + log: jest.fn(), + warn: jest.fn(), + fatal: jest.fn(), + }, +} as unknown as Toolkit; describe('Gradle', () => { beforeEach(() => { @@ -31,6 +43,15 @@ describe('Gradle', () => { await expect(doesVersionPropertiesExist(fs)).resolves.toBeTruthy(); }); + + it('should read gradle.properties when configured', async () => { + fs.readFile.mockImplementation(async () => 'majorVersion=1'); + + await expect( + doesVersionPropertiesExist(fs, 'gradle-properties'), + ).resolves.toBeTruthy(); + expect(fs.readFile).toHaveBeenCalledWith('gradle.properties'); + }); }); describe('getVersionProperties', () => { @@ -51,6 +72,27 @@ describe('Gradle', () => { }); }); + it('should return parsed gradle.properties version', async () => { + toolkit.readFile.mockImplementation(async () => { + return Buffer.from(` + org.gradle.jvmargs=-Xmx2g + majorVersion=4 + minorVersion=5 + patchVersion=6 + buildNumber= + `); + }); + + await expect( + getVersionProperties(toolkit, 'gradle-properties'), + ).resolves.toEqual({ + major: 4, + minor: 5, + patch: 6, + }); + expect(toolkit.readFile).toHaveBeenCalledWith('gradle.properties'); + }); + it('should return 0.0.0 on error', async () => { toolkit.readFile.mockImplementation(async () => { return Buffer.from(` @@ -95,4 +137,60 @@ describe('Gradle', () => { }); }); }); + + describe('setVersionProperties', () => { + it('should write version.properties by default', async () => { + await setVersionProperties(fs, toolkitWithLog, { + major: 1, + minor: 2, + patch: 3, + build: 4, + }); + + expect(fs.writeFile).toHaveBeenCalledWith( + 'version.properties', + [ + 'majorVersion=1', + 'minorVersion=2', + 'patchVersion=3', + 'buildNumber=4', + ].join('\n'), + ); + }); + + it('should preserve unrelated gradle.properties values when writing', async () => { + fs.readFile.mockImplementation(async () => { + return [ + 'org.gradle.jvmargs=-Xmx2g', + 'majorVersion=1', + 'minorVersion=2', + 'patchVersion=3', + 'buildNumber=', + ].join('\n'); + }); + + await setVersionProperties( + fs, + toolkitWithLog, + { + major: 2, + minor: 0, + patch: 0, + build: '42', + }, + 'gradle-properties', + ); + + expect(fs.writeFile).toHaveBeenCalledWith( + 'gradle.properties', + [ + 'org.gradle.jvmargs=-Xmx2g', + 'majorVersion=2', + 'minorVersion=0', + 'patchVersion=0', + 'buildNumber=42', + ].join('\n'), + ); + }); + }); }); diff --git a/src/gradle.ts b/src/gradle.ts index 64ec1d7..fc73a43 100644 --- a/src/gradle.ts +++ b/src/gradle.ts @@ -1,12 +1,82 @@ import Fs from 'fs/promises'; +import type { VersionStorageBackend } from './env'; import { Toolkit } from './toolkit'; import { Version } from './version'; +type VersionStorage = { + path: string; +}; + +const storageByBackend: Record = { + 'version-properties': { + path: 'version.properties', + }, + 'gradle-properties': { + path: 'gradle.properties', + }, +}; + +const getVersionStorage = ( + backend: VersionStorageBackend = 'version-properties', +): VersionStorage => storageByBackend[backend]; + +export const getVersionStoragePath = ( + backend: VersionStorageBackend = 'version-properties', +): string => getVersionStorage(backend).path; + +const getProperty = (contents: string, key: string): string | undefined => { + const matcher = new RegExp(`^\\s*${key}\\s*=\\s*(.*?)\\s*$`, 'm'); + const match = contents.match(matcher); + + return match?.[1]; +}; + +const getIntegerProperty = (contents: string, key: string): number => { + const value = Number.parseInt(getProperty(contents, key) ?? '0'); + + return Number.isNaN(value) ? 0 : value; +}; + +const getVersionFromProperties = ( + contents: string, +): Pick => { + return { + major: getIntegerProperty(contents, 'majorVersion'), + minor: getIntegerProperty(contents, 'minorVersion'), + patch: getIntegerProperty(contents, 'patchVersion'), + }; +}; + +const setProperty = (contents: string, key: string, value: string): string => { + const matcher = new RegExp(`^(\\s*${key}\\s*=\\s*).*$`, 'm'); + + if (matcher.test(contents)) { + return contents.replace(matcher, `$1${value}`); + } + + return `${contents}${contents.endsWith('\n') || contents.length === 0 ? '' : '\n'}${key}=${value}`; +}; + +const setProperties = (contents: string, version: Version): string => { + const versionProperties: Record = { + majorVersion: version.major.toString(), + minorVersion: version.minor.toString(), + patchVersion: version.patch.toString(), + buildNumber: version.build?.toString() ?? '', + }; + + return Object.entries(versionProperties).reduce( + (nextContents, [key, value]) => setProperty(nextContents, key, value), + contents, + ); +}; + export const doesVersionPropertiesExist = async ( fs: typeof Fs, + backend: VersionStorageBackend = 'version-properties', ): Promise => { try { - const file = await fs.readFile('version.properties'); + const file = await fs.readFile(getVersionStoragePath(backend)); return file?.toString().length > 0; } catch { @@ -16,31 +86,34 @@ export const doesVersionPropertiesExist = async ( export const getVersionProperties = async ( toolkit: Toolkit, + backend: VersionStorageBackend = 'version-properties', ): Promise> => { - const file = (await toolkit.readFile('version.properties')).toString(); - const major = file.match(/(majorVersion=)(\d+)/); - const minor = file.match(/(minorVersion=)(\d+)/); - const patch = file.match(/(patchVersion=)(\d+)/); + const file = ( + await toolkit.readFile(getVersionStoragePath(backend)) + ).toString(); - return { - major: major && major.length > 1 ? Number.parseInt(major[2]) : 0, - minor: minor && minor.length > 1 ? Number.parseInt(minor[2]) : 0, - patch: patch && patch.length > 1 ? Number.parseInt(patch[2]) : 0, - }; + return getVersionFromProperties(file); }; export const setVersionProperties = async ( fs: typeof Fs, toolkit: Toolkit, - { major, minor, patch, build }: Version, + version: Version, + backend: VersionStorageBackend = 'version-properties', ): Promise => { - const contents = [ - `majorVersion=${major}`, - `minorVersion=${minor}`, - `patchVersion=${patch}`, - `buildNumber=${build ?? ''}`, - ].join('\n'); - - await fs.writeFile('version.properties', contents); + const path = getVersionStoragePath(backend); + let existingContents = ''; + + if (backend === 'gradle-properties') { + try { + existingContents = (await fs.readFile(path)).toString(); + } catch { + existingContents = ''; + } + } + + const contents = setProperties(existingContents, version); + + await fs.writeFile(path, contents); toolkit.log.log(contents); }; diff --git a/src/main.ts b/src/main.ts index a85c80d..fad1ca6 100644 --- a/src/main.ts +++ b/src/main.ts @@ -3,11 +3,13 @@ import { getBuildNumber, getCommitMessage, getTagPrefix, + getVersionStorageBackend, isSkippingCi, } from './env'; import { createCommit, pushChanges, setGitIdentity } from './git'; import { doesVersionPropertiesExist, + getVersionStoragePath, getVersionProperties, setVersionProperties, } from './gradle'; @@ -43,12 +45,19 @@ const main = async () => { const tagPrefix = getTagPrefix(tools); const skipCi = isSkippingCi(tools); const buildNumber = getBuildNumber(tools); - const versionFileExists = await doesVersionPropertiesExist(fs); + const versionStorageBackend = getVersionStorageBackend(tools); + const versionFileExists = await doesVersionPropertiesExist( + fs, + versionStorageBackend, + ); let build: Build; if (versionFileExists) { - const existingVersion = await getVersionProperties(tools); + const existingVersion = await getVersionProperties( + tools, + versionStorageBackend, + ); const { commits } = tools.context.payload; build = bumpBuild(commits ?? [], existingVersion, buildNumber); @@ -66,9 +75,16 @@ const main = async () => { const message = getCommitMessage(tools, build, tagPrefix, skipCi); - await setVersionProperties(fs, tools, build.version); + await setVersionProperties( + fs, + tools, + build.version, + versionStorageBackend, + ); await setGitIdentity(tools); - await createCommit(tools, message); + await createCommit(tools, message, [ + getVersionStoragePath(versionStorageBackend), + ]); await pushChanges(tools, build.name, true); tools.setOutput('new_tag', build.name); tools.setOutput('git_tag', build.name); diff --git a/src/toolkit.ts b/src/toolkit.ts index 4e37268..88d4be7 100644 --- a/src/toolkit.ts +++ b/src/toolkit.ts @@ -10,6 +10,7 @@ type Payload = { const inputNames = [ 'gradle_location', + 'version_storage', 'tag_prefix', 'skip_ci', 'commit_message',