From 82181cd8781ae574187d706de740d8f53c05ea70 Mon Sep 17 00:00:00 2001 From: Edmond O'Flynn Date: Tue, 23 Jun 2026 16:20:18 +0200 Subject: [PATCH 1/2] feat: support monorepo, multiple apps and variants --- README.md | 57 +++++++++-- action.yml | 12 +++ dist/index.js | 8 +- e2e/action.e2e.test.ts | 217 +++++++++++++++++++++++++++++++++++++++++ e2e/harness.ts | 69 +++++++++---- src/commits.ts | 84 +++++++++++++--- src/env.test.ts | 72 ++++++++++++++ src/env.ts | 34 ++++++- src/gradle.test.ts | 70 +++++++++++++ src/gradle.ts | 17 +++- src/main.ts | 87 +++++++++++++++-- src/toolkit.ts | 3 + 12 files changed, 669 insertions(+), 61 deletions(-) diff --git a/README.md b/README.md index 23b5937..9fe41d2 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,43 @@ For pull request or protected-branch workflows, set an explicit base ref: commit_base_ref: origin/main ``` +When `git_tag_prefix` is set and `commit_tag_pattern` is not, the previous-tag strategy automatically searches for tags matching that prefix. + +#### Monorepos and multiple apps + +Run the action once per independently released app. +Set `app_path` to scope version storage under that module, `git_tag_prefix` to keep tags independent, and `path_filter: true` to avoid releases when the selected commit range does not touch that app. + +```yaml +- uses: actions/checkout@v6 + with: + fetch-depth: 0 + +- name: Bump mobile app + id: mobile_version + uses: oflynned/android-version-bump@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + app_path: apps/mobile + git_tag_prefix: mobile-v + path_filter: true + +- name: Bump admin app + id: admin_version + uses: oflynned/android-version-bump@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + app_path: apps/admin + git_tag_prefix: admin-v + path_filter: true +``` + +With `app_path: apps/mobile`, `version-properties` uses `apps/mobile/version.properties` and `gradle-properties` uses `apps/mobile/gradle.properties`. +If `path_filter` is enabled and no selected commits touch `app_path`, the action exits successfully without writing, committing, tagging, or pushing. +In that case `version_changed` is `false`. + #### Private repos To use this action with `${{ secrets.GITHUB_TOKEN }}` in a private repo, set `contents: write` so the token can push the version commit and tag. @@ -309,23 +346,27 @@ Pass these in the `with:` block | Tag | Effect | Example | Default value | |--------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|--------------------------| +| app_path | App or module path used to scope version storage and optional path filtering. | `app_path: apps/mobile` stores versions in `apps/mobile/version.properties` | '' | | commit_range | Selects where version bump commit messages come from. Supported values are `previous-tag`, `base-ref`, and `payload`. | `commit_range: base-ref` reads from `commit_base_ref` to `HEAD` | `previous-tag` | | commit_base_ref | Base ref used when `commit_range` is `base-ref`. If omitted, pull request workflows use `origin/${{ github.base_ref }}` when available. | `commit_base_ref: origin/main` | '' | -| commit_tag_pattern | Tag glob used when `commit_range` is `previous-tag`. | `commit_tag_pattern: 'v*'` | `*` | +| commit_tag_pattern | Tag glob used when `commit_range` is `previous-tag`. Defaults to `${git_tag_prefix}*` when `git_tag_prefix` is set. | `commit_tag_pattern: 'v*'` | `*` | | 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` | +| git_tag_prefix | Prefix used for the created git tag and the `git_tag` and `new_tag` outputs. | `git_tag_prefix: mobile-v` creates `mobile-v1.2.3` | '' | +| path_filter | When true, only commits touching `app_path` can trigger a bump. Cannot be combined with `commit_range: payload`. | `path_filter: true` | false | +| tag_prefix | Prefix used in the generated release commit message. | `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 -| Name | Description | Example | -|--------------|------------------------------------|-----------| -| git_tag | The newly created git tag | `1.0.0` | -| version_name | The generated Android version name | `1.0.0.5` | -| version_code | The generated Android version code | `10000` | -| new_tag | Compatibility alias for `git_tag` | `1.0.0` | +| Name | Description | Example | +|-----------------|------------------------------------------------------------------|-----------| +| git_tag | The newly created git tag | `1.0.0` | +| version_name | The generated Android version name | `1.0.0.5` | +| version_code | The generated Android version code | `10000` | +| new_tag | Compatibility alias for `git_tag` | `1.0.0` | +| version_changed | Whether a new version was written, committed, tagged, and pushed | `true` | ## Q&A diff --git a/action.yml b/action.yml index ad2b780..b72a5ee 100644 --- a/action.yml +++ b/action.yml @@ -8,6 +8,9 @@ branding: icon: chevron-up color: blue inputs: + app_path: + required: false + description: 'App or module path used to scope version storage and optional path filtering' commit_range: required: false description: 'Commit range source for version bumping: previous-tag, base-ref, or payload' @@ -23,6 +26,13 @@ inputs: required: false description: 'Version metadata storage backend: version-properties or gradle-properties' default: 'version-properties' + git_tag_prefix: + required: false + description: 'Prefix to add to the created git tag and git_tag/new_tag outputs' + path_filter: + required: false + description: 'Only bump when git commits in the selected range touch app_path' + default: 'false' tag_prefix: required: false description: 'Prefix to add to the generated release commit message' @@ -45,3 +55,5 @@ outputs: description: 'The generated Android version name' version_code: description: 'The generated Android version code' + version_changed: + description: 'Whether this run wrote, committed, tagged, and pushed a new version' diff --git a/dist/index.js b/dist/index.js index 4d9cb8c..1ab91c8 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 A=["version-properties","gradle-properties"];const r=["previous-tag","base-ref","payload"];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 getCommitRange=e=>{const t=getValue(e,"commit_range","previous-tag");if(r.includes(t)){return t}throw new Error(`Invalid commit range "${t}". Expected one of: ${r.join(", ")}`)};const getCommitBaseRef=e=>getValue(e,"commit_base_ref","");const getCommitTagPattern=e=>getValue(e,"commit_tag_pattern","*");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 s=require("child_process");const o=require("os");const runProcess=async(e,t)=>{const A=process.env.GITHUB_WORKSPACE;return new Promise((r,n)=>{const i=(0,s.spawn)(e,t,{cwd:A});const a=[];const c=[];let l=false;i.on("error",e=>{if(!l){l=true;n(e)}});i.stderr.on("data",e=>a.push(e));i.stdout.on("data",e=>c.push(e));i.on("exit",t=>{if(!l){if(t===0){r(c.join(""))}else{n(`${a.join("")}${o.EOL}${e} exited with code ${t}`)}}})})};const runCommand=async(e,t)=>{await runProcess(e,t)};const runCommandOutput=async(e,t)=>runProcess(e,t);const n="\0";const parseGitLog=e=>e.split(n).map(e=>e.trim()).filter(e=>e.length>0);const getPayloadCommits=e=>e.context.payload.commits??[];const getDefaultBaseRef=()=>{const e=process.env.GITHUB_BASE_REF;if(e){return`origin/${e}`}return""};const resolveGitRange=async(e,t)=>{if(t==="base-ref"){const t=getCommitBaseRef(e)||getDefaultBaseRef();if(!t){throw new Error("commit_range base-ref requires commit_base_ref or GITHUB_BASE_REF")}return`${t}..HEAD`}const A=getCommitTagPattern(e);const r=(await runCommandOutput("git",["describe","--tags","--abbrev=0","--match",A])).trim();return`${r}..HEAD`};const getGitCommits=async(e,t)=>{let A;try{A=await resolveGitRange(e,t)}catch(A){if(t==="previous-tag"){e.log.warn(`No previous tag matched ${getCommitTagPattern(e)}; reading all reachable commits`)}else{throw A}}const r=["log","--format=%B%x00"];if(A){r.push(A)}return parseGitLog(await runCommandOutput("git",r))};const getCommitsForVersionBump=async e=>{const t=getCommitRange(e);if(t==="payload"){e.log.log("Reading version bump commits from GitHub event payload");return getPayloadCommits(e)}try{const A=await getGitCommits(e,t);if(A.length>0){e.log.log(`Reading version bump commits from git ${t} range`);return A}e.log.warn(`Git ${t} range did not contain commits; falling back to GitHub event payload`)}catch(A){e.log.warn(`Could not read git ${t} range; falling back to GitHub event payload`);e.log.warn(A)}return getPayloadCommits(e)};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 i={"version-properties":{path:"version.properties"},"gradle-properties":{path:"gradle.properties"}};const getVersionStorage=(e="version-properties")=>i[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()+o.EOL)}function command_issue(e,t=""){command_issueCommand(e,{},t)}const a="::";class Command{constructor(e,t,A){if(!e){e="missing.command"}this.command=e;this.properties=t;this.message=A}toString(){let e=a+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+=`${a}${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 c=require("crypto");const l=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(!l.existsSync(A)){throw new Error(`Missing file at path: ${A}`)}l.appendFileSync(A,`${utils_toCommandValue(t)}${o.EOL}`,{encoding:"utf8"})}function file_command_prepareKeyValueMessage(e,t){const A=`ghadelimiter_${c.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}${o.EOL}${r}${o.EOL}${A}`}const g=require("path");var u=__nccwpck_require__(8611);var E=__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 h=__nccwpck_require__(770);var d=__nccwpck_require__(6752);var Q=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 B;(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"})(B||(B={}));var I;(function(e){e["Accept"]="accept";e["ContentType"]="content-type"})(I||(I={}));var p;(function(e){e["ApplicationJson"]="application/json"})(p||(p={}));function lib_getProxyUrl(e){const t=pm.getProxyUrl(new URL(e));return t?t.href:""}const f=[B.MovedPermanently,B.ResourceMoved,B.SeeOther,B.TemporaryRedirect,B.PermanentRedirect];const m=[B.BadGateway,B.ServiceUnavailable,B.GatewayTimeout];const w=null&&["OPTIONS","GET","DELETE","HEAD"];const y=10;const b=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 Q(this,void 0,void 0,function*(){return new Promise(e=>Q(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 Q(this,void 0,void 0,function*(){return new Promise(e=>Q(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 Q(this,void 0,void 0,function*(){return this.request("OPTIONS",e,null,t||{})})}get(e,t){return Q(this,void 0,void 0,function*(){return this.request("GET",e,null,t||{})})}del(e,t){return Q(this,void 0,void 0,function*(){return this.request("DELETE",e,null,t||{})})}post(e,t,A){return Q(this,void 0,void 0,function*(){return this.request("POST",e,t,A||{})})}patch(e,t,A){return Q(this,void 0,void 0,function*(){return this.request("PATCH",e,t,A||{})})}put(e,t,A){return Q(this,void 0,void 0,function*(){return this.request("PUT",e,t,A||{})})}head(e,t){return Q(this,void 0,void 0,function*(){return this.request("HEAD",e,null,t||{})})}sendStream(e,t,A,r){return Q(this,void 0,void 0,function*(){return this.request(e,t,A,r)})}getJson(e){return Q(this,arguments,void 0,function*(e,t={}){t[I.Accept]=this._getExistingOrDefaultHeader(t,I.Accept,p.ApplicationJson);const A=yield this.get(e,t);return this._processResponse(A,this.requestOptions)})}postJson(e,t){return Q(this,arguments,void 0,function*(e,t,A={}){const r=JSON.stringify(t,null,2);A[I.Accept]=this._getExistingOrDefaultHeader(A,I.Accept,p.ApplicationJson);A[I.ContentType]=this._getExistingOrDefaultContentTypeHeader(A,p.ApplicationJson);const s=yield this.post(e,r,A);return this._processResponse(s,this.requestOptions)})}putJson(e,t){return Q(this,arguments,void 0,function*(e,t,A={}){const r=JSON.stringify(t,null,2);A[I.Accept]=this._getExistingOrDefaultHeader(A,I.Accept,p.ApplicationJson);A[I.ContentType]=this._getExistingOrDefaultContentTypeHeader(A,p.ApplicationJson);const s=yield this.put(e,r,A);return this._processResponse(s,this.requestOptions)})}patchJson(e,t){return Q(this,arguments,void 0,function*(e,t,A={}){const r=JSON.stringify(t,null,2);A[I.Accept]=this._getExistingOrDefaultHeader(A,I.Accept,p.ApplicationJson);A[I.ContentType]=this._getExistingOrDefaultContentTypeHeader(A,p.ApplicationJson);const s=yield this.patch(e,r,A);return this._processResponse(s,this.requestOptions)})}request(e,t,A,r){return Q(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&&w.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===B.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&&f.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||!m.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)[I.ContentType];if(e){if(typeof e==="number"){A=String(e)}else if(Array.isArray(e)){A=e.join(", ")}else{A=e}}}const r=e[I.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 Q(this,void 0,void 0,function*(){e=Math.min(y,e);const t=b*Math.pow(2,e);return new Promise(e=>setTimeout(()=>e(),t))})}_processResponse(e,t){return Q(this,void 0,void 0,function*(){return new Promise((A,r)=>Q(this,void 0,void 0,function*(){const s=e.message.statusCode||0;const o={statusCode:s,result:null,headers:{}};if(s===B.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 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())})};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 k(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 k(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 k(this,void 0,void 0,function*(){throw new Error("not implemented")})}}var R=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 R(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 R(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 D=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:T,appendFile:F,writeFile:S}=l.promises;const U="GITHUB_STEP_SUMMARY";const N="https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";class Summary{constructor(){this._buffer=""}filePath(){return D(this,void 0,void 0,function*(){if(this._filePath){return this._filePath}const e=process.env[U];if(!e){throw new Error(`Unable to find environment variable for $${U}. Check if your runtime environment supports job summaries.`)}try{yield T(e,l.constants.R_OK|l.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 D(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?S:F;yield r(A,this._buffer,{encoding:"utf8"});return this.emptyBuffer()})}clear(){return D(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(o.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 M=new Summary;const G=null&&M;const L=null&&M;function toPosixPath(e){return e.replace(/[\\]/g,"/")}function toWin32Path(e){return e.replace(/[/]/g,"\\")}function toPlatformPath(e){return e.replace(/[/\\]/g,path.sep)}var v=__nccwpck_require__(3193);var H=__nccwpck_require__(4434);var _=__nccwpck_require__(2613);var O=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:Y,copyFile:P,lstat:x,mkdir:J,open:V,readdir:W,rename:q,rm:z,rmdir:j,stat:Z,symlink:K,unlink:X}=l.promises;const $=process.platform==="win32";function readlink(e){return O(this,void 0,void 0,function*(){const t=yield fs.promises.readlink(e);if($&&!t.endsWith("\\")){return`${t}\\`}return t})}const ee=268435456;const te=l.constants.O_RDONLY;function exists(e){return O(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 O(this,arguments,void 0,function*(e,t=false){const A=t?yield Z(e):yield x(e);return A.isDirectory()})}function isRooted(e){e=normalizeSeparators(e);if(!e){throw new Error('isRooted() parameter "p" cannot be empty')}if($){return e.startsWith("\\")||/^[A-Z]:/i.test(e)}return e.startsWith("/")}function tryGetExecutablePath(e,t){return O(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($){const A=g.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($){try{const t=g.dirname(e);const A=g.basename(e).toUpperCase();for(const r of yield W(t)){if(A===r.toUpperCase()){e=g.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($){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 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 cp(e,t){return Ae(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 Ae(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 Ae(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 Ae(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 Ae(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($){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 Ae(this,void 0,void 0,function*(){if(!e){throw new Error("parameter 'tool' is required")}const t=[];if($&&process.env["PATHEXT"]){for(const e of process.env["PATHEXT"].split(g.delimiter)){if(e){t.push(e)}}}if(isRooted(e)){const A=yield tryGetExecutablePath(e,t);if(A){return[A]}return[]}if(e.includes(g.sep)){return[]}const A=[];if(process.env.PATH){for(const e of process.env.PATH.split(g.delimiter)){if(e){A.push(e)}}}const r=[];for(const s of A){const A=yield tryGetExecutablePath(g.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 Ae(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 Ae(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 re=require("timers");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())})};const oe=process.platform==="win32";class ToolRunner extends H.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(oe){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 s=r.indexOf(o.EOL);while(s>-1){const e=r.substring(0,s);A(e);r=r.substring(s+o.EOL.length);s=r.indexOf(o.EOL)}return r}catch(e){this._debug(`error processing line. Failed with error ${e}`);return""}}_getSpawnFileName(){if(oe){if(this._isCmdFile()){return process.env["COMSPEC"]||"cmd.exe"}}return this.toolPath}_getSpawnArgs(e){if(oe){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 se(this,void 0,void 0,function*(){if(!isRooted(this.toolPath)&&(this.toolPath.includes("/")||oe&&this.toolPath.includes("\\"))){this.toolPath=g.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)}this.toolPath=yield which(this.toolPath,true);return new Promise((e,t)=>se(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)+o.EOL)}const r=new ExecState(A,this.toolPath);r.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=s.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=>{r.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=>{r.processError=e.message;r.processExited=true;r.processClosed=true;r.CheckComplete()});i.on("exit",e=>{r.processExitCode=e;r.processExited=true;this._debug(`Exit code ${e} received from tool '${this.toolPath}'`);r.CheckComplete()});i.on("close",e=>{r.processExitCode=e;r.processExited=true;r.processClosed=true;this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);r.CheckComplete()});r.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 H.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,re.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 ne=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 ne(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 ne(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 ie=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=()=>ie(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=()=>ie(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=()=>ie(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 ae=o.platform();const ce=o.arch();const le=ae==="win32";const ge=ae==="darwin";const ue=ae==="linux";function getDetails(){return ie(this,void 0,void 0,function*(){return Object.assign(Object.assign({},yield le?getWindowsInfo():ge?getMacOsInfo():getLinuxInfo()),{platform:ae,arch:ce,isWindows:le,isMacOS:ge,isLinux:ue})})}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())})};var he;(function(e){e[e["Success"]=0]="Success";e[e["Failure"]=1]="Failure"})(he||(he={}));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(o.EOL);command_issueCommand("set-output",{name:e},utils_toCommandValue(t))}function setCommandEcho(e){issue("echo",e?"on":"off")}function setFailed(e){process.exitCode=he.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+o.EOL)}function startGroup(e){issue("group",e)}function endGroup(){issue("endgroup")}function group(e,t){return Ee(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 Ee(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,l.existsSync)(process.env.GITHUB_EVENT_PATH)){this.payload=JSON.parse((0,l.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${o.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 de=__nccwpck_require__(9659);var Qe=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 de.HttpClient;return t.getAgent(e)}function getProxyAgentDispatcher(e){const t=new de.HttpClient;return t.getAgentDispatcher(e)}function getProxyFetch(e){const t=getProxyAgentDispatcher(e);const proxyFetch=(e,A)=>Qe(this,void 0,void 0,function*(){return(0,d.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 Ce=Function.bind;const Be=Ce.bind(Ce);function bindApi(e,t,A){const r=Be(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]=Be(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 Ie={Singular:Singular,Collection:Collection};var pe="0.0.0-development";var fe=`octokit-endpoint.js/${pe} ${getUserAgent()}`;var me={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":fe},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 we=/\{[^{}}]+\}/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 ye=withDefaults(null,me);var be=__nccwpck_require__(4649);const ke=/^-?\d+$/;const Re=/^-?\d+n+$/;const De=JSON.stringify;const Te=JSON.parse;const Fe=/^-?\d+n$/;const Se=/([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g;const Ue=/([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g;const JSONStringify=(e,t,A)=>{if("rawJSON"in JSON){return De(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 De(e,t,A);const r=De(e,(e,A)=>{const r=typeof A==="string"&&Re.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(Se,"$1$2$3");const o=s.replace(Ue,"$1$2$3");return o};const Ne=new Map;const isContextSourceSupported=()=>{const e=JSON.parse.toString();if(Ne.has(e)){return Ne.get(e)}try{const t=JSON.parse("1",(e,t,A)=>!!A?.source&&A.source==="1");Ne.set(e,t);return t}catch{Ne.set(e,false);return false}};const convertMarkedBigIntsReviver=(e,t,A,r)=>{const s=typeof t==="string"&&Fe.test(t);if(s)return BigInt(t.slice(0,-1));const o=typeof t==="string"&&Re.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 Te(e,t);if(isContextSourceSupported())return JSONParseV2(e,t);const A=e.replace(Le,(e,t,A,r)=>{const s=e[0]==='"';const o=s&&ve.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,be.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 r=["previous-tag","base-ref","payload"];const getValue=(e,t,A)=>e.inputs[t]??A??"";const getGradleLocation=e=>getValue(e,"gradle_location","app/build.gradle");const getAppPath=e=>{const t=getValue(e,"app_path","").replaceAll("\\","/").replace(/^\.\/+/,"").replace(/^\/+|\/+$/g,"");if(t.split("/").includes("..")){throw new Error("app_path cannot contain ..")}return t};const getTagPrefix=e=>getValue(e,"tag_prefix","v");const getGitTagPrefix=e=>getValue(e,"git_tag_prefix","");const isSkippingCi=e=>getValue(e,"skip_ci","true")==="true";const isPathFilterEnabled=e=>getValue(e,"path_filter","false")==="true";const getBuildNumber=e=>getValue(e,"build_number","");const getCommitRange=e=>{const t=getValue(e,"commit_range","previous-tag");if(r.includes(t)){return t}throw new Error(`Invalid commit range "${t}". Expected one of: ${r.join(", ")}`)};const getCommitBaseRef=e=>getValue(e,"commit_base_ref","");const getCommitTagPattern=e=>{const t=e.inputs["commit_tag_pattern"];if(t){return t}const A=getGitTagPrefix(e);return A?`${A}*`:"*"};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 s=require("child_process");const o=require("os");const runProcess=async(e,t)=>{const A=process.env.GITHUB_WORKSPACE;return new Promise((r,n)=>{const i=(0,s.spawn)(e,t,{cwd:A});const a=[];const c=[];let l=false;i.on("error",e=>{if(!l){l=true;n(e)}});i.stderr.on("data",e=>a.push(e));i.stdout.on("data",e=>c.push(e));i.on("exit",t=>{if(!l){if(t===0){r(c.join(""))}else{n(`${a.join("")}${o.EOL}${e} exited with code ${t}`)}}})})};const runCommand=async(e,t)=>{await runProcess(e,t)};const runCommandOutput=async(e,t)=>runProcess(e,t);const n="\0";const parseGitLog=e=>e.split(n).map(e=>e.trim()).filter(e=>e.length>0);const parseChangedPaths=e=>Array.from(new Set(e.split("\n").map(e=>e.trim()).filter(e=>e.length>0)));const getPayloadCommits=e=>e.context.payload.commits??[];const getDefaultBaseRef=()=>{const e=process.env.GITHUB_BASE_REF;if(e){return`origin/${e}`}return""};const resolveGitRange=async(e,t)=>{if(t==="base-ref"){const t=getCommitBaseRef(e)||getDefaultBaseRef();if(!t){throw new Error("commit_range base-ref requires commit_base_ref or GITHUB_BASE_REF")}return`${t}..HEAD`}const A=getCommitTagPattern(e);const r=(await runCommandOutput("git",["describe","--tags","--abbrev=0","--match",A])).trim();return`${r}..HEAD`};const getGitVersionBumpContext=async(e,t)=>{let A;try{A=await resolveGitRange(e,t)}catch(A){if(t==="previous-tag"){e.log.warn(`No previous tag matched ${getCommitTagPattern(e)}; reading all reachable commits`)}else{throw A}}const r=["log","--format=%B%x00"];const s=["log","--name-only","--format="];if(A){r.push(A);s.push(A)}const[o,n]=await Promise.all([runCommandOutput("git",r),runCommandOutput("git",s)]);return{commits:parseGitLog(o),changedPaths:parseChangedPaths(n)}};const getVersionBumpContext=async(e,t=true)=>{const A=getCommitRange(e);if(A==="payload"){e.log.log("Reading version bump commits from GitHub event payload");return{commits:getPayloadCommits(e),changedPaths:[]}}try{const r=await getGitVersionBumpContext(e,A);if(r.commits.length>0){e.log.log(`Reading version bump commits from git ${A} range`);return r}if(t){e.log.warn(`Git ${A} range did not contain commits; falling back to GitHub event payload`)}}catch(r){if(!t){throw r}e.log.warn(`Could not read git ${A} range; falling back to GitHub event payload`);e.log.warn(r)}if(t){return{commits:getPayloadCommits(e),changedPaths:[]}}return{commits:[],changedPaths:[]}};const getCommitsForVersionBump=async e=>{const{commits:t}=await getVersionBumpContext(e);return 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 i=require("path");var a=__nccwpck_require__.n(i);const c={"version-properties":{path:"version.properties"},"gradle-properties":{path:"gradle.properties"}};const getVersionStorage=(e="version-properties")=>c[e];const getVersionStoragePath=(e="version-properties",t="")=>{const A=getVersionStorage(e).path;return t?a().posix.join(t,A):A};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",A="")=>{try{const r=await e.readFile(getVersionStoragePath(t,A));return r?.toString().length>0}catch{return false}};const getVersionProperties=async(e,t="version-properties",A="")=>{const r=(await e.readFile(getVersionStoragePath(t,A))).toString();return getVersionFromProperties(r)};const setVersionProperties=async(e,t,A,r="version-properties",s="")=>{const o=getVersionStoragePath(r,s);let n="";if(r==="gradle-properties"){try{n=(await e.readFile(o)).toString()}catch{n=""}}const i=setProperties(n,A);await e.writeFile(o,i);t.log.log(i)};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()+o.EOL)}function command_issue(e,t=""){command_issueCommand(e,{},t)}const l="::";class Command{constructor(e,t,A){if(!e){e="missing.command"}this.command=e;this.properties=t;this.message=A}toString(){let e=l+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+=`${l}${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 g=require("crypto");const u=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(!u.existsSync(A)){throw new Error(`Missing file at path: ${A}`)}u.appendFileSync(A,`${utils_toCommandValue(t)}${o.EOL}`,{encoding:"utf8"})}function file_command_prepareKeyValueMessage(e,t){const A=`ghadelimiter_${g.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}${o.EOL}${r}${o.EOL}${A}`}var E=__nccwpck_require__(8611);var h=__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 d=__nccwpck_require__(770);var Q=__nccwpck_require__(6752);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())})};var I;(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"})(I||(I={}));var p;(function(e){e["Accept"]="accept";e["ContentType"]="content-type"})(p||(p={}));var f;(function(e){e["ApplicationJson"]="application/json"})(f||(f={}));function lib_getProxyUrl(e){const t=pm.getProxyUrl(new URL(e));return t?t.href:""}const m=[I.MovedPermanently,I.ResourceMoved,I.SeeOther,I.TemporaryRedirect,I.PermanentRedirect];const w=[I.BadGateway,I.ServiceUnavailable,I.GatewayTimeout];const y=null&&["OPTIONS","GET","DELETE","HEAD"];const b=10;const k=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 B(this,void 0,void 0,function*(){return new Promise(e=>B(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 B(this,void 0,void 0,function*(){return new Promise(e=>B(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 B(this,void 0,void 0,function*(){return this.request("OPTIONS",e,null,t||{})})}get(e,t){return B(this,void 0,void 0,function*(){return this.request("GET",e,null,t||{})})}del(e,t){return B(this,void 0,void 0,function*(){return this.request("DELETE",e,null,t||{})})}post(e,t,A){return B(this,void 0,void 0,function*(){return this.request("POST",e,t,A||{})})}patch(e,t,A){return B(this,void 0,void 0,function*(){return this.request("PATCH",e,t,A||{})})}put(e,t,A){return B(this,void 0,void 0,function*(){return this.request("PUT",e,t,A||{})})}head(e,t){return B(this,void 0,void 0,function*(){return this.request("HEAD",e,null,t||{})})}sendStream(e,t,A,r){return B(this,void 0,void 0,function*(){return this.request(e,t,A,r)})}getJson(e){return B(this,arguments,void 0,function*(e,t={}){t[p.Accept]=this._getExistingOrDefaultHeader(t,p.Accept,f.ApplicationJson);const A=yield this.get(e,t);return this._processResponse(A,this.requestOptions)})}postJson(e,t){return B(this,arguments,void 0,function*(e,t,A={}){const r=JSON.stringify(t,null,2);A[p.Accept]=this._getExistingOrDefaultHeader(A,p.Accept,f.ApplicationJson);A[p.ContentType]=this._getExistingOrDefaultContentTypeHeader(A,f.ApplicationJson);const s=yield this.post(e,r,A);return this._processResponse(s,this.requestOptions)})}putJson(e,t){return B(this,arguments,void 0,function*(e,t,A={}){const r=JSON.stringify(t,null,2);A[p.Accept]=this._getExistingOrDefaultHeader(A,p.Accept,f.ApplicationJson);A[p.ContentType]=this._getExistingOrDefaultContentTypeHeader(A,f.ApplicationJson);const s=yield this.put(e,r,A);return this._processResponse(s,this.requestOptions)})}patchJson(e,t){return B(this,arguments,void 0,function*(e,t,A={}){const r=JSON.stringify(t,null,2);A[p.Accept]=this._getExistingOrDefaultHeader(A,p.Accept,f.ApplicationJson);A[p.ContentType]=this._getExistingOrDefaultContentTypeHeader(A,f.ApplicationJson);const s=yield this.patch(e,r,A);return this._processResponse(s,this.requestOptions)})}request(e,t,A,r){return B(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&&y.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===I.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&&m.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||!w.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)[p.ContentType];if(e){if(typeof e==="number"){A=String(e)}else if(Array.isArray(e)){A=e.join(", ")}else{A=e}}}const r=e[p.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 B(this,void 0,void 0,function*(){e=Math.min(b,e);const t=k*Math.pow(2,e);return new Promise(e=>setTimeout(()=>e(),t))})}_processResponse(e,t){return B(this,void 0,void 0,function*(){return new Promise((A,r)=>B(this,void 0,void 0,function*(){const s=e.message.statusCode||0;const o={statusCode:s,result:null,headers:{}};if(s===I.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 R=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 R(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 R(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 R(this,void 0,void 0,function*(){throw new Error("not implemented")})}}var D=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 D(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 D(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 T=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:F,appendFile:S,writeFile:U}=u.promises;const N="GITHUB_STEP_SUMMARY";const M="https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";class Summary{constructor(){this._buffer=""}filePath(){return T(this,void 0,void 0,function*(){if(this._filePath){return this._filePath}const e=process.env[N];if(!e){throw new Error(`Unable to find environment variable for $${N}. Check if your runtime environment supports job summaries.`)}try{yield F(e,u.constants.R_OK|u.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 T(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?U:S;yield r(A,this._buffer,{encoding:"utf8"});return this.emptyBuffer()})}clear(){return T(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(o.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 G=new Summary;const L=null&&G;const v=null&&G;function toPosixPath(e){return e.replace(/[\\]/g,"/")}function toWin32Path(e){return e.replace(/[/]/g,"\\")}function toPlatformPath(e){return e.replace(/[/\\]/g,path.sep)}var H=__nccwpck_require__(3193);var _=__nccwpck_require__(4434);var O=__nccwpck_require__(2613);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{chmod:P,copyFile:x,lstat:J,mkdir:V,open:W,readdir:q,rename:z,rm:j,rmdir:Z,stat:K,symlink:X,unlink:$}=u.promises;const ee=process.platform==="win32";function readlink(e){return Y(this,void 0,void 0,function*(){const t=yield fs.promises.readlink(e);if(ee&&!t.endsWith("\\")){return`${t}\\`}return t})}const te=268435456;const Ae=u.constants.O_RDONLY;function exists(e){return Y(this,void 0,void 0,function*(){try{yield K(e)}catch(e){if(e.code==="ENOENT"){return false}throw e}return true})}function isDirectory(e){return Y(this,arguments,void 0,function*(e,t=false){const A=t?yield K(e):yield J(e);return A.isDirectory()})}function isRooted(e){e=normalizeSeparators(e);if(!e){throw new Error('isRooted() parameter "p" cannot be empty')}if(ee){return e.startsWith("\\")||/^[A-Z]:/i.test(e)}return e.startsWith("/")}function tryGetExecutablePath(e,t){return Y(this,void 0,void 0,function*(){let A=undefined;try{A=yield K(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(ee){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 K(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(ee){try{const t=i.dirname(e);const A=i.basename(e).toUpperCase();for(const r of yield q(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(ee){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 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())})};function cp(e,t){return re(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 re(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 re(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 re(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 re(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(ee){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 re(this,void 0,void 0,function*(){if(!e){throw new Error("parameter 'tool' is required")}const t=[];if(ee&&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 re(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 re(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 se=require("timers");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 ne=process.platform==="win32";class ToolRunner extends _.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(ne){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 s=r.indexOf(o.EOL);while(s>-1){const e=r.substring(0,s);A(e);r=r.substring(s+o.EOL.length);s=r.indexOf(o.EOL)}return r}catch(e){this._debug(`error processing line. Failed with error ${e}`);return""}}_getSpawnFileName(){if(ne){if(this._isCmdFile()){return process.env["COMSPEC"]||"cmd.exe"}}return this.toolPath}_getSpawnArgs(e){if(ne){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 oe(this,void 0,void 0,function*(){if(!isRooted(this.toolPath)&&(this.toolPath.includes("/")||ne&&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)=>oe(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)+o.EOL)}const r=new ExecState(A,this.toolPath);r.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=s.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=>{r.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=>{r.processError=e.message;r.processExited=true;r.processClosed=true;r.CheckComplete()});i.on("exit",e=>{r.processExitCode=e;r.processExited=true;this._debug(`Exit code ${e} received from tool '${this.toolPath}'`);r.CheckComplete()});i.on("close",e=>{r.processExitCode=e;r.processExited=true;r.processClosed=true;this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);r.CheckComplete()});r.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 _.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,se.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 ie=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 ie(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 ie(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 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 getWindowsInfo=()=>ae(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=()=>ae(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=()=>ae(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 ce=o.platform();const le=o.arch();const ge=ce==="win32";const ue=ce==="darwin";const Ee=ce==="linux";function getDetails(){return ae(this,void 0,void 0,function*(){return Object.assign(Object.assign({},yield ge?getWindowsInfo():ue?getMacOsInfo():getLinuxInfo()),{platform:ce,arch:le,isWindows:ge,isMacOS:ue,isLinux:Ee})})}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())})};var de;(function(e){e[e["Success"]=0]="Success";e[e["Failure"]=1]="Failure"})(de||(de={}));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(o.EOL);command_issueCommand("set-output",{name:e},utils_toCommandValue(t))}function setCommandEcho(e){issue("echo",e?"on":"off")}function setFailed(e){process.exitCode=de.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+o.EOL)}function startGroup(e){issue("group",e)}function endGroup(){issue("endgroup")}function group(e,t){return he(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 he(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,u.existsSync)(process.env.GITHUB_EVENT_PATH)){this.payload=JSON.parse((0,u.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${o.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 Qe=__nccwpck_require__(9659);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())})};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 Qe.HttpClient;return t.getAgent(e)}function getProxyAgentDispatcher(e){const t=new Qe.HttpClient;return t.getAgentDispatcher(e)}function getProxyFetch(e){const t=getProxyAgentDispatcher(e);const proxyFetch=(e,A)=>Ce(this,void 0,void 0,function*(){return(0,Q.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 Be=Function.bind;const Ie=Be.bind(Be);function bindApi(e,t,A){const r=Ie(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]=Ie(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 pe={Singular:Singular,Collection:Collection};var fe="0.0.0-development";var me=`octokit-endpoint.js/${fe} ${getUserAgent()}`;var we={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":me},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 ye=/\{[^{}}]+\}/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 be=withDefaults(null,we);var ke=__nccwpck_require__(4649);const Re=/^-?\d+$/;const De=/^-?\d+n+$/;const Te=JSON.stringify;const Fe=JSON.parse;const Se=/^-?\d+n$/;const Ue=/([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g;const Ne=/([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g;const JSONStringify=(e,t,A)=>{if("rawJSON"in JSON){return Te(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 Te(e,t,A);const r=Te(e,(e,A)=>{const r=typeof A==="string"&&De.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(Ue,"$1$2$3");const o=s.replace(Ne,"$1$2$3");return o};const Me=new Map;const isContextSourceSupported=()=>{const e=JSON.parse.toString();if(Me.has(e)){return Me.get(e)}try{const t=JSON.parse("1",(e,t,A)=>!!A?.source&&A.source==="1");Me.set(e,t);return t}catch{Me.set(e,false);return false}};const convertMarkedBigIntsReviver=(e,t,A,r)=>{const s=typeof t==="string"&&Se.test(t);if(s)return BigInt(t.slice(0,-1));const o=typeof t==="string"&&De.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 Fe(e,t);if(isContextSourceSupported())return JSONParseV2(e,t);const A=e.replace(ve,(e,t,A,r)=>{const s=e[0]==='"';const o=s&&He.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,ke.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 Oe=dist_bundle_withDefaults(ye,_e); +()=>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 Ye=dist_bundle_withDefaults(be,Oe); /* v8 ignore next -- @preserve */ -/* v8 ignore else -- @preserve */var Ye="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 Pe=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 xe=["method","baseUrl","url","headers","request","query","mediaType","operationName"];var Je=["query","method","url"];var Ve=/\/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(!Je.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(xe.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(Ve.test(o)){s.url=o.replace(Ve,"/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 Pe(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 We=graphql_dist_bundle_withDefaults(Oe,{headers:{"user-agent":`octokit-graphql.js/${Ye} ${getUserAgent()}`},method:"POST",url:"/graphql"});function withCustomRequest(e){return graphql_dist_bundle_withDefaults(e,{method:"POST",url:"/graphql"})}var qe="(?:[a-zA-Z0-9_-]+)";var ze="\\.";var je=new RegExp(`^${qe}${ze}${qe}${ze}${qe}$`);var Ze=je.test.bind(je);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 Ke=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 Xe="7.0.6";const dist_src_noop=()=>{};const $e=console.warn.bind(console);const et=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=$e}if(typeof e.error!=="function"){e.error=et}return e}const tt=`octokit-core.js/${Xe} ${getUserAgent()}`;class Octokit{static VERSION=Xe;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 Ie.Collection;const A={baseUrl:Oe.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} ${tt}`:tt;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=Oe.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=Ke(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 at=Object.assign(paginate,{iterator:iterator});var ct=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 ct.includes(e)}else{return false}}function paginateRest(e){return{paginate:Object.assign(paginate.bind(null,e),{iterator:iterator.bind(null,e)})}}paginateRest.VERSION=it;const lt=new Context;const gt=getApiBaseUrl();const ut={baseUrl:gt,request:{agent:getProxyAgent(gt),fetch:getProxyFetch(gt)}};const Et=Octokit.plugin(restEndpointMethods,paginateRest).defaults(ut);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 ht=new Context;function getOctokit(e,t,...A){const r=GitHub.plugin(...A);return new r(getOctokitOptions(e,t))}const dt=["commit_range","commit_base_ref","commit_tag_pattern","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:ht.payload};inputs=Object.fromEntries(dt.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","--tags"]);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 A=await getCommitsForVersionBump(e);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 +/* v8 ignore else -- @preserve */var Pe="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 xe=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 Je=["method","baseUrl","url","headers","request","query","mediaType","operationName"];var Ve=["query","method","url"];var We=/\/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(!Ve.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(Je.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(We.test(o)){s.url=o.replace(We,"/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 xe(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 qe=graphql_dist_bundle_withDefaults(Ye,{headers:{"user-agent":`octokit-graphql.js/${Pe} ${getUserAgent()}`},method:"POST",url:"/graphql"});function withCustomRequest(e){return graphql_dist_bundle_withDefaults(e,{method:"POST",url:"/graphql"})}var ze="(?:[a-zA-Z0-9_-]+)";var je="\\.";var Ze=new RegExp(`^${ze}${je}${ze}${je}${ze}$`);var Ke=Ze.test.bind(Ze);async function auth(e){const t=Ke(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 Xe=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 $e="7.0.6";const dist_src_noop=()=>{};const et=console.warn.bind(console);const tt=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=et}if(typeof e.error!=="function"){e.error=tt}return e}const At=`octokit-core.js/${$e} ${getUserAgent()}`;class Octokit{static VERSION=$e;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 pe.Collection;const A={baseUrl:Ye.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} ${At}`:At;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=Ye.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=Xe(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 ct=Object.assign(paginate,{iterator:iterator});var lt=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 lt.includes(e)}else{return false}}function paginateRest(e){return{paginate:Object.assign(paginate.bind(null,e),{iterator:iterator.bind(null,e)})}}paginateRest.VERSION=at;const gt=new Context;const ut=getApiBaseUrl();const Et={baseUrl:ut,request:{agent:getProxyAgent(ut),fetch:getProxyFetch(ut)}};const ht=Octokit.plugin(restEndpointMethods,paginateRest).defaults(Et);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 dt=new Context;function getOctokit(e,t,...A){const r=GitHub.plugin(...A);return new r(getOctokitOptions(e,t))}const Qt=["app_path","commit_range","commit_base_ref","commit_tag_pattern","gradle_location","git_tag_prefix","path_filter","version_storage","tag_prefix","skip_ci","commit_message","build_number"];const formatLogValue=e=>typeof e==="string"?e:JSON.stringify(e);class Toolkit{context={payload:dt.payload};inputs=Object.fromEntries(Qt.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 isChangedPathInApp=(e,t)=>e===t||e.startsWith(`${t}/`);const setVersionOutputs=(e,t,A,r)=>{e.setOutput("new_tag",A);e.setOutput("git_tag",A);e.setOutput("version_name",t.name);e.setOutput("version_code",t.code.toString());e.setOutput("version_changed",r.toString())};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","--tags"]);const s=getTagPrefix(e);const o=getGitTagPrefix(e);const n=isSkippingCi(e);const i=getBuildNumber(e);const a=getAppPath(e);const c=isPathFilterEnabled(e);if(c&&!a){throw new Error("path_filter requires app_path")}if(c&&getCommitRange(e)==="payload"){throw new Error("path_filter cannot be used with commit_range payload")}const l=getVersionStorageBackend(e);const g=await doesVersionPropertiesExist(t(),l,a);let u;let E;let h=true;let d;if(g){const t=await getVersionProperties(e,l,a);E=getBuildFromVersion(t);d=await getVersionBumpContext(e,!c);u=bumpBuild(d.commits,t,i)}else{const t={major:0,minor:0,patch:1,build:i};u=getBuildFromVersion(t);if(c){d=await getVersionBumpContext(e,false)}}if(c&&d&&!d.changedPaths.some(e=>isChangedPathInApp(e,a))){h=false;u=E??u}const Q=`${o}${u.name}`;if(!h){setVersionOutputs(e,u,Q,false);e.exit.success(`No changes detected for ${a}; version remains ${u.name}.`);return}const B=getCommitMessage(e,u,s,n);await setVersionProperties(t(),e,u.version,l,a);await setGitIdentity(e);await createCommit(e,B,[getVersionStoragePath(l,a)]);await pushChanges(e,Q,true);setVersionOutputs(e,u,Q,true);e.exit.success(`Version bumped version to ${u.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 f3bf1dd..06d0d74 100644 --- a/e2e/action.e2e.test.ts +++ b/e2e/action.e2e.test.ts @@ -48,6 +48,7 @@ describe('packaged action with local git repositories', () => { git_tag: '0.0.1', version_name: '0.0.1', version_code: '1', + version_changed: 'true', }); expect(gitInWorkspace(fixture, 'status', '--porcelain')).toBe( '?? notes.txt', @@ -164,6 +165,7 @@ describe('packaged action with local git repositories', () => { git_tag: '1.3.0.42', version_name: '1.3.0.42', version_code: '10300', + version_changed: 'true', }); expect(gitInRemote(fixture, 'rev-parse', 'refs/heads/main')).not.toBe( gitInRemote(fixture, 'rev-parse', `refs/heads/${fixture.branch}`), @@ -208,6 +210,220 @@ describe('packaged action with local git repositories', () => { ); }); + it('bumps only the configured mobile app version and tag', () => { + const fixture = run({ + appVersions: { + 'apps/mobile': '1.2.3', + 'apps/admin': '9.8.7', + }, + previousTags: ['mobile-v1.2.3', 'admin-v9.8.7'], + commits: [ + { + message: 'fix: repair mobile launch', + filePath: 'apps/mobile/src/Main.kt', + }, + ], + inputs: { + app_path: 'apps/mobile', + git_tag_prefix: 'mobile-v', + path_filter: 'true', + }, + }); + + expect(fixture.result.status).toBe(0); + expect( + gitInRemote(fixture, 'show', 'main:apps/mobile/version.properties'), + ).toBe( + [ + 'majorVersion=1', + 'minorVersion=2', + 'patchVersion=4', + 'buildNumber=', + ].join('\n'), + ); + expect( + gitInRemote(fixture, 'show', 'main:apps/admin/version.properties'), + ).toBe( + [ + 'majorVersion=9', + 'minorVersion=8', + 'patchVersion=7', + 'buildNumber=', + ].join('\n'), + ); + expect(gitInRemote(fixture, 'rev-parse', 'refs/tags/mobile-v1.2.4')).toBe( + gitInRemote(fixture, 'rev-parse', 'refs/heads/main'), + ); + expect(readOutputs(fixture)).toMatchObject({ + new_tag: 'mobile-v1.2.4', + git_tag: 'mobile-v1.2.4', + version_name: '1.2.4', + version_changed: 'true', + }); + }); + + it('bumps only the configured admin app version and tag', () => { + const fixture = run({ + appVersions: { + 'apps/mobile': '1.2.3', + 'apps/admin': '9.8.7', + }, + previousTags: ['mobile-v1.2.3', 'admin-v9.8.7'], + commits: [ + { + message: 'feat: add admin dashboard', + filePath: 'apps/admin/src/Main.kt', + }, + ], + inputs: { + app_path: 'apps/admin', + git_tag_prefix: 'admin-v', + path_filter: 'true', + }, + }); + + expect(fixture.result.status).toBe(0); + expect( + gitInRemote(fixture, 'show', 'main:apps/admin/version.properties'), + ).toBe( + [ + 'majorVersion=9', + 'minorVersion=9', + 'patchVersion=0', + 'buildNumber=', + ].join('\n'), + ); + expect( + gitInRemote(fixture, 'show', 'main:apps/mobile/version.properties'), + ).toBe( + [ + 'majorVersion=1', + 'minorVersion=2', + 'patchVersion=3', + 'buildNumber=', + ].join('\n'), + ); + expect(gitInRemote(fixture, 'rev-parse', 'refs/tags/admin-v9.9.0')).toBe( + gitInRemote(fixture, 'rev-parse', 'refs/heads/main'), + ); + expect(readOutputs(fixture)).toMatchObject({ + new_tag: 'admin-v9.9.0', + git_tag: 'admin-v9.9.0', + version_name: '9.9.0', + version_changed: 'true', + }); + }); + + it('succeeds without side effects when path filtering finds no app changes', () => { + const fixture = run({ + appVersions: { + 'apps/mobile': '1.2.3', + 'apps/admin': '9.8.7', + }, + previousTags: ['mobile-v1.2.3', 'admin-v9.8.7'], + commits: [ + { + message: 'fix: repair admin launch', + filePath: 'apps/admin/src/Main.kt', + }, + ], + inputs: { + app_path: 'apps/mobile', + git_tag_prefix: 'mobile-v', + path_filter: 'true', + }, + }); + + expect(fixture.result.status).toBe(0); + expect( + gitInRemote(fixture, 'show', 'main:apps/mobile/version.properties'), + ).toBe( + [ + 'majorVersion=1', + 'minorVersion=2', + 'patchVersion=3', + 'buildNumber=', + ].join('\n'), + ); + expect(gitInRemote(fixture, 'rev-parse', 'refs/heads/main')).toBe( + fixture.triggerSha, + ); + expect(gitInRemote(fixture, 'tag', '--list', 'mobile-v1.2.4')).toBe(''); + expect(readOutputs(fixture)).toMatchObject({ + new_tag: 'mobile-v1.2.3', + git_tag: 'mobile-v1.2.3', + version_name: '1.2.3', + version_changed: 'false', + }); + }); + + it('rejects payload commit range when path filtering is enabled', () => { + const fixture = run({ + appVersions: { + 'apps/mobile': '1.2.3', + }, + commits: [ + { + message: 'fix: repair mobile launch', + filePath: 'apps/mobile/src/Main.kt', + }, + ], + inputs: { + app_path: 'apps/mobile', + commit_range: 'payload', + path_filter: 'true', + }, + }); + + expect(fixture.result.status).toBe(1); + expect(`${fixture.result.stdout}${fixture.result.stderr}`).toContain( + 'path_filter cannot be used with commit_range payload', + ); + expect(gitInRemote(fixture, 'tag', '--list', '1.2.4')).toBe(''); + }); + + it('uses app-specific previous tags for the bump range', () => { + const fixture = run({ + appVersions: { + 'apps/mobile': '1.2.3', + 'apps/admin': '9.8.7', + }, + previousTags: ['mobile-v1.2.3', 'admin-v9.8.7'], + preTagCommits: [ + { + message: 'feat: released mobile feature', + filePath: 'apps/mobile/src/Main.kt', + }, + ], + commits: [ + { + message: 'fix: repair mobile launch', + filePath: 'apps/mobile/src/Main.kt', + }, + ], + inputs: { + app_path: 'apps/mobile', + git_tag_prefix: 'mobile-v', + path_filter: 'true', + }, + }); + + expect(fixture.result.status).toBe(0); + expect( + gitInRemote(fixture, 'show', 'main:apps/mobile/version.properties'), + ).toBe( + [ + 'majorVersion=1', + 'minorVersion=2', + 'patchVersion=4', + 'buildNumber=', + ].join('\n'), + ); + expect(gitInRemote(fixture, 'rev-parse', 'refs/tags/mobile-v1.2.4')).toBe( + gitInRemote(fixture, 'rev-parse', 'refs/heads/main'), + ); + }); + it('reports a rejected push and leaves the remote unchanged', () => { const fixture = run({ version: '1.2.3', @@ -258,5 +474,6 @@ describe('packaged action with local git repositories', () => { expect(action).toContain(' git_tag:'); expect(action).toContain(' version_name:'); expect(action).toContain(' version_code:'); + expect(action).toContain(' version_changed:'); }); }); diff --git a/e2e/harness.ts b/e2e/harness.ts index d142333..5c40c7a 100644 --- a/e2e/harness.ts +++ b/e2e/harness.ts @@ -10,14 +10,22 @@ const realGit = execFileSync('command', ['-v', 'git'], { }).trim(); type EventCommit = string | { id: string; message: string }; +type FixtureCommit = + | string + | { + message: string; + filePath: string; + }; type VersionStorage = 'version-properties' | 'gradle-properties'; type FixtureOptions = { version?: string; + appVersions?: Record; versionStorage?: VersionStorage; previousTag?: string; - preTagCommits?: string[]; - commits?: string[]; + previousTags?: string[]; + preTagCommits?: FixtureCommit[]; + commits?: FixtureCommit[]; eventCommits?: EventCommit[]; inputs?: Record; environment?: Record; @@ -43,6 +51,7 @@ const writeVersion = ( workspace: string, version: string, storage: VersionStorage = 'version-properties', + appPath = '', ): void => { const [major, minor, patch] = version.split('.'); const fileName = @@ -57,9 +66,29 @@ const writeVersion = ( 'buildNumber=', ].join('\n'); - fs.writeFileSync(path.join(workspace, fileName), contents); + const versionPath = path.join(workspace, appPath, fileName); + fs.mkdirSync(path.dirname(versionPath), { recursive: true }); + fs.writeFileSync(versionPath, contents); }; +const commitChange = ( + workspace: string, + commit: FixtureCommit, + index: string, +): void => { + const message = typeof commit === 'string' ? commit : commit.message; + const filePath = typeof commit === 'string' ? 'README.md' : commit.filePath; + const absolutePath = path.join(workspace, filePath); + + fs.mkdirSync(path.dirname(absolutePath), { recursive: true }); + fs.appendFileSync(absolutePath, `${index}:${message}\n`); + git(workspace, ['add', filePath]); + git(workspace, ['commit', '-m', message]); +}; + +const getCommitMessage = (commit: FixtureCommit): string => + typeof commit === 'string' ? commit : commit.message; + const createGitShim = (root: string, remote: string): string => { const shimDirectory = path.join(root, 'bin'); const shim = path.join(shimDirectory, 'git'); @@ -108,26 +137,30 @@ export const runActionFixture = ( if (options.version) { writeVersion(workspace, options.version, options.versionStorage); } + for (const [appPath, version] of Object.entries(options.appVersions ?? {})) { + writeVersion(workspace, version, options.versionStorage, appPath); + } git(workspace, ['add', '.']); git(workspace, ['commit', '-m', 'chore: initial fixture']); for (const [index, message] of (options.preTagCommits ?? []).entries()) { - fs.appendFileSync( - path.join(workspace, 'README.md'), - `pre-tag-${index}:${message}\n`, - ); - git(workspace, ['add', 'README.md']); - git(workspace, ['commit', '-m', message]); + commitChange(workspace, message, `pre-tag-${index}`); } - if (options.previousTag) { - git(workspace, ['tag', options.previousTag]); + for (const tag of [ + ...(options.previousTag ? [options.previousTag] : []), + ...(options.previousTags ?? []), + ]) { + git(workspace, ['tag', tag]); } git(workspace, ['remote', 'add', 'origin', remote]); git(workspace, ['push', '-u', 'origin', 'main']); - if (options.previousTag) { - git(workspace, ['push', 'origin', options.previousTag]); + for (const tag of [ + ...(options.previousTag ? [options.previousTag] : []), + ...(options.previousTags ?? []), + ]) { + git(workspace, ['push', 'origin', tag]); } if (branch !== 'main') { @@ -135,12 +168,7 @@ export const runActionFixture = ( } for (const [index, message] of (options.commits ?? []).entries()) { - fs.appendFileSync( - path.join(workspace, 'README.md'), - `${index}:${message}\n`, - ); - git(workspace, ['add', 'README.md']); - git(workspace, ['commit', '-m', message]); + commitChange(workspace, message, index.toString()); } if (branch !== 'main' || (options.commits?.length ?? 0) > 0) { @@ -158,7 +186,8 @@ export const runActionFixture = ( fs.writeFileSync( eventFile, JSON.stringify({ - commits: options.eventCommits ?? options.commits ?? [], + commits: + options.eventCommits ?? (options.commits ?? []).map(getCommitMessage), }), ); fs.writeFileSync(outputFile, ''); diff --git a/src/commits.ts b/src/commits.ts index f452c3c..815824e 100644 --- a/src/commits.ts +++ b/src/commits.ts @@ -10,6 +10,11 @@ import { Commit } from './version'; const commitSeparator = '\0'; +type GitVersionBumpContext = { + commits: Commit[]; + changedPaths: string[]; +}; + const parseGitLog = (output: string): string[] => { return output .split(commitSeparator) @@ -17,6 +22,17 @@ const parseGitLog = (output: string): string[] => { .filter((message) => message.length > 0); }; +const parseChangedPaths = (output: string): string[] => { + return Array.from( + new Set( + output + .split('\n') + .map((changedPath) => changedPath.trim()) + .filter((changedPath) => changedPath.length > 0), + ), + ); +}; + const getPayloadCommits = (toolkit: Toolkit): Commit[] => { return toolkit.context.payload.commits ?? []; }; @@ -61,10 +77,10 @@ const resolveGitRange = async ( return `${previousTag}..HEAD`; }; -const getGitCommits = async ( +const getGitVersionBumpContext = async ( toolkit: Toolkit, commitRange: Exclude, -): Promise => { +): Promise => { let range: string | undefined; try { @@ -81,46 +97,84 @@ const getGitCommits = async ( } } - const args = ['log', '--format=%B%x00']; + const commitArgs = ['log', '--format=%B%x00']; + const pathArgs = ['log', '--name-only', '--format=']; if (range) { - args.push(range); + commitArgs.push(range); + pathArgs.push(range); } - return parseGitLog(await runCommandOutput('git', args)); + const [commits, changedPaths] = await Promise.all([ + runCommandOutput('git', commitArgs), + runCommandOutput('git', pathArgs), + ]); + + return { + commits: parseGitLog(commits), + changedPaths: parseChangedPaths(changedPaths), + }; }; -export const getCommitsForVersionBump = async ( +export const getVersionBumpContext = async ( toolkit: Toolkit, -): Promise => { + allowPayloadFallback = true, +): Promise => { const commitRange = getCommitRange(toolkit); if (commitRange === 'payload') { toolkit.log.log('Reading version bump commits from GitHub event payload'); - return getPayloadCommits(toolkit); + return { + commits: getPayloadCommits(toolkit), + changedPaths: [], + }; } try { - const commits = await getGitCommits(toolkit, commitRange); + const context = await getGitVersionBumpContext(toolkit, commitRange); - if (commits.length > 0) { + if (context.commits.length > 0) { toolkit.log.log( `Reading version bump commits from git ${commitRange} range`, ); - return commits; + return context; } - toolkit.log.warn( - `Git ${commitRange} range did not contain commits; falling back to GitHub event payload`, - ); + if (allowPayloadFallback) { + toolkit.log.warn( + `Git ${commitRange} range did not contain commits; falling back to GitHub event payload`, + ); + } } catch (error) { + if (!allowPayloadFallback) { + throw error; + } + toolkit.log.warn( `Could not read git ${commitRange} range; falling back to GitHub event payload`, ); toolkit.log.warn(error); } - return getPayloadCommits(toolkit); + if (allowPayloadFallback) { + return { + commits: getPayloadCommits(toolkit), + changedPaths: [], + }; + } + + return { + commits: [], + changedPaths: [], + }; +}; + +export const getCommitsForVersionBump = async ( + toolkit: Toolkit, +): Promise => { + const { commits } = await getVersionBumpContext(toolkit); + + return commits; }; diff --git a/src/env.test.ts b/src/env.test.ts index 08d2097..038f529 100644 --- a/src/env.test.ts +++ b/src/env.test.ts @@ -1,10 +1,13 @@ import { mock } from 'jest-mock-extended'; import { + getAppPath, getCommitBaseRef, getCommitMessage, getCommitRange, getCommitTagPattern, + getGitTagPrefix, getVersionStorageBackend, + isPathFilterEnabled, } from './env'; import { Toolkit } from './toolkit'; import { Build } from './version'; @@ -25,6 +28,30 @@ describe('Env', () => { jest.resetAllMocks(); }); + describe('getAppPath', () => { + it('should default to empty string', () => { + toolkit.inputs['app_path'] = undefined; + + const result = getAppPath(toolkit); + + expect(result).toEqual(''); + }); + + it('should normalize configured app path', () => { + toolkit.inputs['app_path'] = './apps/mobile/'; + + const result = getAppPath(toolkit); + + expect(result).toEqual('apps/mobile'); + }); + + it('should reject app paths outside the workspace', () => { + toolkit.inputs['app_path'] = '../mobile'; + + expect(() => getAppPath(toolkit)).toThrow('app_path cannot contain ..'); + }); + }); + describe('getCommitRange', () => { it('should default to previous-tag', () => { toolkit.inputs['commit_range'] = undefined; @@ -85,6 +112,51 @@ describe('Env', () => { expect(result).toEqual('v*'); }); + + it('should default to git tag prefix pattern when configured', () => { + toolkit.inputs['commit_tag_pattern'] = undefined; + toolkit.inputs['git_tag_prefix'] = 'mobile-v'; + + const result = getCommitTagPattern(toolkit); + + expect(result).toEqual('mobile-v*'); + }); + }); + + describe('getGitTagPrefix', () => { + it('should default to empty string', () => { + toolkit.inputs['git_tag_prefix'] = undefined; + + const result = getGitTagPrefix(toolkit); + + expect(result).toEqual(''); + }); + + it('should return configured git tag prefix', () => { + toolkit.inputs['git_tag_prefix'] = 'mobile-v'; + + const result = getGitTagPrefix(toolkit); + + expect(result).toEqual('mobile-v'); + }); + }); + + describe('isPathFilterEnabled', () => { + it('should default to false', () => { + toolkit.inputs['path_filter'] = undefined; + + const result = isPathFilterEnabled(toolkit); + + expect(result).toEqual(false); + }); + + it('should return true when configured', () => { + toolkit.inputs['path_filter'] = 'true'; + + const result = isPathFilterEnabled(toolkit); + + expect(result).toEqual(true); + }); }); describe('getVersionStorageBackend', () => { diff --git a/src/env.ts b/src/env.ts index 29afa49..1f0c028 100644 --- a/src/env.ts +++ b/src/env.ts @@ -2,10 +2,13 @@ import { Toolkit } from './toolkit'; import { Build } from './version'; export type Key = + | 'app_path' | 'commit_range' | 'commit_base_ref' | 'commit_tag_pattern' | 'gradle_location' + | 'git_tag_prefix' + | 'path_filter' | 'version_storage' | 'tag_prefix' | 'skip_ci' @@ -35,14 +38,35 @@ export const getGradleLocation = (toolkit: Toolkit): string => { return getValue(toolkit, 'gradle_location', 'app/build.gradle'); }; +export const getAppPath = (toolkit: Toolkit): string => { + const appPath = getValue(toolkit, 'app_path', '') + .replaceAll('\\', '/') + .replace(/^\.\/+/, '') + .replace(/^\/+|\/+$/g, ''); + + if (appPath.split('/').includes('..')) { + throw new Error('app_path cannot contain ..'); + } + + return appPath; +}; + export const getTagPrefix = (toolkit: Toolkit): string => { return getValue(toolkit, 'tag_prefix', 'v'); }; +export const getGitTagPrefix = (toolkit: Toolkit): string => { + return getValue(toolkit, 'git_tag_prefix', ''); +}; + export const isSkippingCi = (toolkit: Toolkit): boolean => { return getValue(toolkit, 'skip_ci', 'true') === 'true'; }; +export const isPathFilterEnabled = (toolkit: Toolkit): boolean => { + return getValue(toolkit, 'path_filter', 'false') === 'true'; +}; + export const getBuildNumber = (toolkit: Toolkit): string => { return getValue(toolkit, 'build_number', ''); }; @@ -66,7 +90,15 @@ export const getCommitBaseRef = (toolkit: Toolkit): string => { }; export const getCommitTagPattern = (toolkit: Toolkit): string => { - return getValue(toolkit, 'commit_tag_pattern', '*'); + const configuredPattern = toolkit.inputs['commit_tag_pattern']; + + if (configuredPattern) { + return configuredPattern; + } + + const gitTagPrefix = getGitTagPrefix(toolkit); + + return gitTagPrefix ? `${gitTagPrefix}*` : '*'; }; export const getVersionStorageBackend = ( diff --git a/src/gradle.test.ts b/src/gradle.test.ts index 89d07e4..ba8f74d 100644 --- a/src/gradle.test.ts +++ b/src/gradle.test.ts @@ -2,6 +2,7 @@ import Fs from 'fs/promises'; import { mock } from 'jest-mock-extended'; import { doesVersionPropertiesExist, + getVersionStoragePath, getVersionProperties, setVersionProperties, } from './gradle'; @@ -23,6 +24,18 @@ describe('Gradle', () => { jest.resetAllMocks(); }); + describe('getVersionStoragePath', () => { + it('should return root storage path by default', () => { + expect(getVersionStoragePath()).toEqual('version.properties'); + }); + + it('should scope storage path under app path', () => { + expect(getVersionStoragePath('gradle-properties', 'apps/mobile')).toEqual( + 'apps/mobile/gradle.properties', + ); + }); + }); + describe('doesVersionPropertiesExist', () => { it('should return false on exception', async () => { fs.readFile.mockImplementation(async () => { @@ -52,6 +65,17 @@ describe('Gradle', () => { ).resolves.toBeTruthy(); expect(fs.readFile).toHaveBeenCalledWith('gradle.properties'); }); + + it('should read storage under app path when configured', async () => { + fs.readFile.mockImplementation(async () => 'majorVersion=1'); + + await expect( + doesVersionPropertiesExist(fs, 'version-properties', 'apps/mobile'), + ).resolves.toBeTruthy(); + expect(fs.readFile).toHaveBeenCalledWith( + 'apps/mobile/version.properties', + ); + }); }); describe('getVersionProperties', () => { @@ -93,6 +117,28 @@ describe('Gradle', () => { expect(toolkit.readFile).toHaveBeenCalledWith('gradle.properties'); }); + it('should return parsed version from app path', async () => { + toolkit.readFile.mockImplementation(async () => { + return Buffer.from(` + majorVersion=7 + minorVersion=8 + patchVersion=9 + buildNumber= + `); + }); + + await expect( + getVersionProperties(toolkit, 'version-properties', 'apps/mobile'), + ).resolves.toEqual({ + major: 7, + minor: 8, + patch: 9, + }); + expect(toolkit.readFile).toHaveBeenCalledWith( + 'apps/mobile/version.properties', + ); + }); + it('should return 0.0.0 on error', async () => { toolkit.readFile.mockImplementation(async () => { return Buffer.from(` @@ -192,5 +238,29 @@ describe('Gradle', () => { ].join('\n'), ); }); + + it('should write version properties under app path', async () => { + await setVersionProperties( + fs, + toolkitWithLog, + { + major: 3, + minor: 2, + patch: 1, + }, + 'version-properties', + 'apps/mobile', + ); + + expect(fs.writeFile).toHaveBeenCalledWith( + 'apps/mobile/version.properties', + [ + 'majorVersion=3', + 'minorVersion=2', + 'patchVersion=1', + 'buildNumber=', + ].join('\n'), + ); + }); }); }); diff --git a/src/gradle.ts b/src/gradle.ts index fc73a43..a788545 100644 --- a/src/gradle.ts +++ b/src/gradle.ts @@ -1,4 +1,5 @@ import Fs from 'fs/promises'; +import path from 'path'; import type { VersionStorageBackend } from './env'; import { Toolkit } from './toolkit'; import { Version } from './version'; @@ -22,7 +23,12 @@ const getVersionStorage = ( export const getVersionStoragePath = ( backend: VersionStorageBackend = 'version-properties', -): string => getVersionStorage(backend).path; + appPath = '', +): string => { + const storagePath = getVersionStorage(backend).path; + + return appPath ? path.posix.join(appPath, storagePath) : storagePath; +}; const getProperty = (contents: string, key: string): string | undefined => { const matcher = new RegExp(`^\\s*${key}\\s*=\\s*(.*?)\\s*$`, 'm'); @@ -74,9 +80,10 @@ const setProperties = (contents: string, version: Version): string => { export const doesVersionPropertiesExist = async ( fs: typeof Fs, backend: VersionStorageBackend = 'version-properties', + appPath = '', ): Promise => { try { - const file = await fs.readFile(getVersionStoragePath(backend)); + const file = await fs.readFile(getVersionStoragePath(backend, appPath)); return file?.toString().length > 0; } catch { @@ -87,9 +94,10 @@ export const doesVersionPropertiesExist = async ( export const getVersionProperties = async ( toolkit: Toolkit, backend: VersionStorageBackend = 'version-properties', + appPath = '', ): Promise> => { const file = ( - await toolkit.readFile(getVersionStoragePath(backend)) + await toolkit.readFile(getVersionStoragePath(backend, appPath)) ).toString(); return getVersionFromProperties(file); @@ -100,8 +108,9 @@ export const setVersionProperties = async ( toolkit: Toolkit, version: Version, backend: VersionStorageBackend = 'version-properties', + appPath = '', ): Promise => { - const path = getVersionStoragePath(backend); + const path = getVersionStoragePath(backend, appPath); let existingContents = ''; if (backend === 'gradle-properties') { diff --git a/src/main.ts b/src/main.ts index 062e7b4..58ea228 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,10 +1,14 @@ import fs from 'fs/promises'; -import { getCommitsForVersionBump } from './commits'; +import { getVersionBumpContext } from './commits'; import { + getAppPath, getBuildNumber, getCommitMessage, + getCommitRange, + getGitTagPrefix, getTagPrefix, getVersionStorageBackend, + isPathFilterEnabled, isSkippingCi, } from './env'; import { createCommit, pushChanges, setGitIdentity } from './git'; @@ -18,6 +22,23 @@ import { runCommand } from './run'; import { Toolkit } from './toolkit'; import { Build, bumpBuild, getBuildFromVersion, Version } from './version'; +const isChangedPathInApp = (changedPath: string, appPath: string): boolean => { + return changedPath === appPath || changedPath.startsWith(`${appPath}/`); +}; + +const setVersionOutputs = ( + tools: Toolkit, + build: Build, + gitTag: string, + versionChanged: boolean, +): void => { + tools.setOutput('new_tag', gitTag); + tools.setOutput('git_tag', gitTag); + tools.setOutput('version_name', build.name); + tools.setOutput('version_code', build.code.toString()); + tools.setOutput('version_changed', versionChanged.toString()); +}; + const main = async () => { await Toolkit.run(async (tools): Promise => { try { @@ -44,24 +65,48 @@ const main = async () => { await runCommand('git', ['fetch', '--tags']); const tagPrefix = getTagPrefix(tools); + const gitTagPrefix = getGitTagPrefix(tools); const skipCi = isSkippingCi(tools); const buildNumber = getBuildNumber(tools); + const appPath = getAppPath(tools); + const pathFilter = isPathFilterEnabled(tools); + + if (pathFilter && !appPath) { + throw new Error('path_filter requires app_path'); + } + + if (pathFilter && getCommitRange(tools) === 'payload') { + throw new Error('path_filter cannot be used with commit_range payload'); + } + const versionStorageBackend = getVersionStorageBackend(tools); const versionFileExists = await doesVersionPropertiesExist( fs, versionStorageBackend, + appPath, ); let build: Build; + let currentBuild: Build | undefined; + let versionChanged = true; + let versionBumpContext: + | Awaited> + | undefined; if (versionFileExists) { const existingVersion = await getVersionProperties( tools, versionStorageBackend, + appPath, ); - const commits = await getCommitsForVersionBump(tools); + currentBuild = getBuildFromVersion(existingVersion); + versionBumpContext = await getVersionBumpContext(tools, !pathFilter); - build = bumpBuild(commits, existingVersion, buildNumber); + build = bumpBuild( + versionBumpContext.commits, + existingVersion, + buildNumber, + ); } else { // create version 0.0.1 by default in build.gradle if it does not exist const defaultBuild: Version = { @@ -72,6 +117,32 @@ const main = async () => { }; build = getBuildFromVersion(defaultBuild); + + if (pathFilter) { + versionBumpContext = await getVersionBumpContext(tools, false); + } + } + + if ( + pathFilter && + versionBumpContext && + !versionBumpContext.changedPaths.some((changedPath) => + isChangedPathInApp(changedPath, appPath), + ) + ) { + versionChanged = false; + build = currentBuild ?? build; + } + + const gitTag = `${gitTagPrefix}${build.name}`; + + if (!versionChanged) { + setVersionOutputs(tools, build, gitTag, false); + tools.exit.success( + `No changes detected for ${appPath}; version remains ${build.name}.`, + ); + + return; } const message = getCommitMessage(tools, build, tagPrefix, skipCi); @@ -81,16 +152,14 @@ const main = async () => { tools, build.version, versionStorageBackend, + appPath, ); await setGitIdentity(tools); await createCommit(tools, message, [ - getVersionStoragePath(versionStorageBackend), + getVersionStoragePath(versionStorageBackend, appPath), ]); - await pushChanges(tools, build.name, true); - tools.setOutput('new_tag', build.name); - tools.setOutput('git_tag', build.name); - tools.setOutput('version_name', build.name); - tools.setOutput('version_code', build.code.toString()); + await pushChanges(tools, gitTag, true); + setVersionOutputs(tools, build, gitTag, true); tools.exit.success( `Version bumped version to ${build.name} successfully!`, diff --git a/src/toolkit.ts b/src/toolkit.ts index d1cfd9b..703d68f 100644 --- a/src/toolkit.ts +++ b/src/toolkit.ts @@ -9,10 +9,13 @@ type Payload = { }; const inputNames = [ + 'app_path', 'commit_range', 'commit_base_ref', 'commit_tag_pattern', 'gradle_location', + 'git_tag_prefix', + 'path_filter', 'version_storage', 'tag_prefix', 'skip_ci', From 42d05be6ecb5cb0dbaf0291e3e1cd03ea6cc1e19 Mon Sep 17 00:00:00 2001 From: Edmond O'Flynn Date: Tue, 23 Jun 2026 16:25:19 +0200 Subject: [PATCH 2/2] refactor: expose release action instead of a boolean --- README.md | 22 +++++++++++----------- action.yml | 4 ++-- dist/index.js | 2 +- e2e/action.e2e.test.ts | 12 ++++++------ src/main.ts | 10 ++++++---- 5 files changed, 26 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 9fe41d2..3f17315 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ If no matching previous tag exists, the action reads all reachable commits. If the git range cannot be read, the action falls back to the GitHub event payload for compatibility. | Range | Behavior | -|--------------|-------------------------------------------------------------------------------| +| ------------ | ----------------------------------------------------------------------------- | | previous-tag | Reads commits from the previous tag matching `commit_tag_pattern` to `HEAD`. | | base-ref | Reads commits from `commit_base_ref` to `HEAD`. | | payload | Reads commit messages from the GitHub event payload, matching older behavior. | @@ -108,7 +108,7 @@ Set `app_path` to scope version storage under that module, `git_tag_prefix` to k With `app_path: apps/mobile`, `version-properties` uses `apps/mobile/version.properties` and `gradle-properties` uses `apps/mobile/gradle.properties`. If `path_filter` is enabled and no selected commits touch `app_path`, the action exits successfully without writing, committing, tagging, or pushing. -In that case `version_changed` is `false`. +In that case `release_action` is `skipped`. #### Private repos @@ -155,7 +155,7 @@ 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. | @@ -345,7 +345,7 @@ 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 | -|--------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|--------------------------| +| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------- | ------------------------ | | app_path | App or module path used to scope version storage and optional path filtering. | `app_path: apps/mobile` stores versions in `apps/mobile/version.properties` | '' | | commit_range | Selects where version bump commit messages come from. Supported values are `previous-tag`, `base-ref`, and `payload`. | `commit_range: base-ref` reads from `commit_base_ref` to `HEAD` | `previous-tag` | | commit_base_ref | Base ref used when `commit_range` is `base-ref`. If omitted, pull request workflows use `origin/${{ github.base_ref }}` when available. | `commit_base_ref: origin/main` | '' | @@ -360,13 +360,13 @@ Pass these in the `with:` block ## Outputs -| Name | Description | Example | -|-----------------|------------------------------------------------------------------|-----------| -| git_tag | The newly created git tag | `1.0.0` | -| version_name | The generated Android version name | `1.0.0.5` | -| version_code | The generated Android version code | `10000` | -| new_tag | Compatibility alias for `git_tag` | `1.0.0` | -| version_changed | Whether a new version was written, committed, tagged, and pushed | `true` | +| Name | Description | Example | +| -------------- | ----------------------------------------------------- | ---------- | +| git_tag | The newly created git tag | `1.0.0` | +| version_name | The generated Android version name | `1.0.0.5` | +| version_code | The generated Android version code | `10000` | +| new_tag | Compatibility alias for `git_tag` | `1.0.0` | +| release_action | The release action performed: `released` or `skipped` | `released` | ## Q&A diff --git a/action.yml b/action.yml index b72a5ee..c392a38 100644 --- a/action.yml +++ b/action.yml @@ -55,5 +55,5 @@ outputs: description: 'The generated Android version name' version_code: description: 'The generated Android version code' - version_changed: - description: 'Whether this run wrote, committed, tagged, and pushed a new version' + release_action: + description: 'The release action performed: released or skipped' diff --git a/dist/index.js b/dist/index.js index 1ab91c8..4ef0d47 100644 --- a/dist/index.js +++ b/dist/index.js @@ -10,4 +10,4 @@ /* 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 Ye=dist_bundle_withDefaults(be,Oe); /* v8 ignore next -- @preserve */ -/* v8 ignore else -- @preserve */var Pe="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 xe=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 Je=["method","baseUrl","url","headers","request","query","mediaType","operationName"];var Ve=["query","method","url"];var We=/\/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(!Ve.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(Je.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(We.test(o)){s.url=o.replace(We,"/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 xe(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 qe=graphql_dist_bundle_withDefaults(Ye,{headers:{"user-agent":`octokit-graphql.js/${Pe} ${getUserAgent()}`},method:"POST",url:"/graphql"});function withCustomRequest(e){return graphql_dist_bundle_withDefaults(e,{method:"POST",url:"/graphql"})}var ze="(?:[a-zA-Z0-9_-]+)";var je="\\.";var Ze=new RegExp(`^${ze}${je}${ze}${je}${ze}$`);var Ke=Ze.test.bind(Ze);async function auth(e){const t=Ke(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 Xe=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 $e="7.0.6";const dist_src_noop=()=>{};const et=console.warn.bind(console);const tt=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=et}if(typeof e.error!=="function"){e.error=tt}return e}const At=`octokit-core.js/${$e} ${getUserAgent()}`;class Octokit{static VERSION=$e;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 pe.Collection;const A={baseUrl:Ye.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} ${At}`:At;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=Ye.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=Xe(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 ct=Object.assign(paginate,{iterator:iterator});var lt=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 lt.includes(e)}else{return false}}function paginateRest(e){return{paginate:Object.assign(paginate.bind(null,e),{iterator:iterator.bind(null,e)})}}paginateRest.VERSION=at;const gt=new Context;const ut=getApiBaseUrl();const Et={baseUrl:ut,request:{agent:getProxyAgent(ut),fetch:getProxyFetch(ut)}};const ht=Octokit.plugin(restEndpointMethods,paginateRest).defaults(Et);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 dt=new Context;function getOctokit(e,t,...A){const r=GitHub.plugin(...A);return new r(getOctokitOptions(e,t))}const Qt=["app_path","commit_range","commit_base_ref","commit_tag_pattern","gradle_location","git_tag_prefix","path_filter","version_storage","tag_prefix","skip_ci","commit_message","build_number"];const formatLogValue=e=>typeof e==="string"?e:JSON.stringify(e);class Toolkit{context={payload:dt.payload};inputs=Object.fromEntries(Qt.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 isChangedPathInApp=(e,t)=>e===t||e.startsWith(`${t}/`);const setVersionOutputs=(e,t,A,r)=>{e.setOutput("new_tag",A);e.setOutput("git_tag",A);e.setOutput("version_name",t.name);e.setOutput("version_code",t.code.toString());e.setOutput("version_changed",r.toString())};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","--tags"]);const s=getTagPrefix(e);const o=getGitTagPrefix(e);const n=isSkippingCi(e);const i=getBuildNumber(e);const a=getAppPath(e);const c=isPathFilterEnabled(e);if(c&&!a){throw new Error("path_filter requires app_path")}if(c&&getCommitRange(e)==="payload"){throw new Error("path_filter cannot be used with commit_range payload")}const l=getVersionStorageBackend(e);const g=await doesVersionPropertiesExist(t(),l,a);let u;let E;let h=true;let d;if(g){const t=await getVersionProperties(e,l,a);E=getBuildFromVersion(t);d=await getVersionBumpContext(e,!c);u=bumpBuild(d.commits,t,i)}else{const t={major:0,minor:0,patch:1,build:i};u=getBuildFromVersion(t);if(c){d=await getVersionBumpContext(e,false)}}if(c&&d&&!d.changedPaths.some(e=>isChangedPathInApp(e,a))){h=false;u=E??u}const Q=`${o}${u.name}`;if(!h){setVersionOutputs(e,u,Q,false);e.exit.success(`No changes detected for ${a}; version remains ${u.name}.`);return}const B=getCommitMessage(e,u,s,n);await setVersionProperties(t(),e,u.version,l,a);await setGitIdentity(e);await createCommit(e,B,[getVersionStoragePath(l,a)]);await pushChanges(e,Q,true);setVersionOutputs(e,u,Q,true);e.exit.success(`Version bumped version to ${u.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 Pe="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 xe=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 Je=["method","baseUrl","url","headers","request","query","mediaType","operationName"];var Ve=["query","method","url"];var We=/\/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(!Ve.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(Je.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(We.test(o)){s.url=o.replace(We,"/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 xe(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 qe=graphql_dist_bundle_withDefaults(Ye,{headers:{"user-agent":`octokit-graphql.js/${Pe} ${getUserAgent()}`},method:"POST",url:"/graphql"});function withCustomRequest(e){return graphql_dist_bundle_withDefaults(e,{method:"POST",url:"/graphql"})}var ze="(?:[a-zA-Z0-9_-]+)";var je="\\.";var Ze=new RegExp(`^${ze}${je}${ze}${je}${ze}$`);var Ke=Ze.test.bind(Ze);async function auth(e){const t=Ke(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 Xe=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 $e="7.0.6";const dist_src_noop=()=>{};const et=console.warn.bind(console);const tt=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=et}if(typeof e.error!=="function"){e.error=tt}return e}const At=`octokit-core.js/${$e} ${getUserAgent()}`;class Octokit{static VERSION=$e;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 pe.Collection;const A={baseUrl:Ye.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} ${At}`:At;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=Ye.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=Xe(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 ct=Object.assign(paginate,{iterator:iterator});var lt=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 lt.includes(e)}else{return false}}function paginateRest(e){return{paginate:Object.assign(paginate.bind(null,e),{iterator:iterator.bind(null,e)})}}paginateRest.VERSION=at;const gt=new Context;const ut=getApiBaseUrl();const Et={baseUrl:ut,request:{agent:getProxyAgent(ut),fetch:getProxyFetch(ut)}};const ht=Octokit.plugin(restEndpointMethods,paginateRest).defaults(Et);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 dt=new Context;function getOctokit(e,t,...A){const r=GitHub.plugin(...A);return new r(getOctokitOptions(e,t))}const Qt=["app_path","commit_range","commit_base_ref","commit_tag_pattern","gradle_location","git_tag_prefix","path_filter","version_storage","tag_prefix","skip_ci","commit_message","build_number"];const formatLogValue=e=>typeof e==="string"?e:JSON.stringify(e);class Toolkit{context={payload:dt.payload};inputs=Object.fromEntries(Qt.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 isChangedPathInApp=(e,t)=>e===t||e.startsWith(`${t}/`);const setVersionOutputs=(e,t,A,r)=>{e.setOutput("new_tag",A);e.setOutput("git_tag",A);e.setOutput("version_name",t.name);e.setOutput("version_code",t.code.toString());e.setOutput("release_action",r)};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","--tags"]);const s=getTagPrefix(e);const o=getGitTagPrefix(e);const n=isSkippingCi(e);const i=getBuildNumber(e);const a=getAppPath(e);const c=isPathFilterEnabled(e);if(c&&!a){throw new Error("path_filter requires app_path")}if(c&&getCommitRange(e)==="payload"){throw new Error("path_filter cannot be used with commit_range payload")}const l=getVersionStorageBackend(e);const g=await doesVersionPropertiesExist(t(),l,a);let u;let E;let h=true;let d;if(g){const t=await getVersionProperties(e,l,a);E=getBuildFromVersion(t);d=await getVersionBumpContext(e,!c);u=bumpBuild(d.commits,t,i)}else{const t={major:0,minor:0,patch:1,build:i};u=getBuildFromVersion(t);if(c){d=await getVersionBumpContext(e,false)}}if(c&&d&&!d.changedPaths.some(e=>isChangedPathInApp(e,a))){h=false;u=E??u}const Q=`${o}${u.name}`;if(!h){setVersionOutputs(e,u,Q,"skipped");e.exit.success(`No changes detected for ${a}; version remains ${u.name}.`);return}const B=getCommitMessage(e,u,s,n);await setVersionProperties(t(),e,u.version,l,a);await setGitIdentity(e);await createCommit(e,B,[getVersionStoragePath(l,a)]);await pushChanges(e,Q,true);setVersionOutputs(e,u,Q,"released");e.exit.success(`Version bumped version to ${u.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 06d0d74..8b3902a 100644 --- a/e2e/action.e2e.test.ts +++ b/e2e/action.e2e.test.ts @@ -48,7 +48,7 @@ describe('packaged action with local git repositories', () => { git_tag: '0.0.1', version_name: '0.0.1', version_code: '1', - version_changed: 'true', + release_action: 'released', }); expect(gitInWorkspace(fixture, 'status', '--porcelain')).toBe( '?? notes.txt', @@ -165,7 +165,7 @@ describe('packaged action with local git repositories', () => { git_tag: '1.3.0.42', version_name: '1.3.0.42', version_code: '10300', - version_changed: 'true', + release_action: 'released', }); expect(gitInRemote(fixture, 'rev-parse', 'refs/heads/main')).not.toBe( gitInRemote(fixture, 'rev-parse', `refs/heads/${fixture.branch}`), @@ -258,7 +258,7 @@ describe('packaged action with local git repositories', () => { new_tag: 'mobile-v1.2.4', git_tag: 'mobile-v1.2.4', version_name: '1.2.4', - version_changed: 'true', + release_action: 'released', }); }); @@ -310,7 +310,7 @@ describe('packaged action with local git repositories', () => { new_tag: 'admin-v9.9.0', git_tag: 'admin-v9.9.0', version_name: '9.9.0', - version_changed: 'true', + release_action: 'released', }); }); @@ -353,7 +353,7 @@ describe('packaged action with local git repositories', () => { new_tag: 'mobile-v1.2.3', git_tag: 'mobile-v1.2.3', version_name: '1.2.3', - version_changed: 'false', + release_action: 'skipped', }); }); @@ -474,6 +474,6 @@ describe('packaged action with local git repositories', () => { expect(action).toContain(' git_tag:'); expect(action).toContain(' version_name:'); expect(action).toContain(' version_code:'); - expect(action).toContain(' version_changed:'); + expect(action).toContain(' release_action:'); }); }); diff --git a/src/main.ts b/src/main.ts index 58ea228..b1a9c17 100644 --- a/src/main.ts +++ b/src/main.ts @@ -22,6 +22,8 @@ import { runCommand } from './run'; import { Toolkit } from './toolkit'; import { Build, bumpBuild, getBuildFromVersion, Version } from './version'; +type ReleaseAction = 'released' | 'skipped'; + const isChangedPathInApp = (changedPath: string, appPath: string): boolean => { return changedPath === appPath || changedPath.startsWith(`${appPath}/`); }; @@ -30,13 +32,13 @@ const setVersionOutputs = ( tools: Toolkit, build: Build, gitTag: string, - versionChanged: boolean, + releaseAction: ReleaseAction, ): void => { tools.setOutput('new_tag', gitTag); tools.setOutput('git_tag', gitTag); tools.setOutput('version_name', build.name); tools.setOutput('version_code', build.code.toString()); - tools.setOutput('version_changed', versionChanged.toString()); + tools.setOutput('release_action', releaseAction); }; const main = async () => { @@ -137,7 +139,7 @@ const main = async () => { const gitTag = `${gitTagPrefix}${build.name}`; if (!versionChanged) { - setVersionOutputs(tools, build, gitTag, false); + setVersionOutputs(tools, build, gitTag, 'skipped'); tools.exit.success( `No changes detected for ${appPath}; version remains ${build.name}.`, ); @@ -159,7 +161,7 @@ const main = async () => { getVersionStoragePath(versionStorageBackend, appPath), ]); await pushChanges(tools, gitTag, true); - setVersionOutputs(tools, build, gitTag, true); + setVersionOutputs(tools, build, gitTag, 'released'); tools.exit.success( `Version bumped version to ${build.name} successfully!`,