From 76d2479b2ac97272a2399182d6f4bbe29c7e7c84 Mon Sep 17 00:00:00 2001 From: Alexey Zorkaltsev Date: Tue, 2 Jul 2024 16:37:55 +0300 Subject: [PATCH] rebuild --- dist/main/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/main/index.js b/dist/main/index.js index ff332726..59f05fc3 100644 --- a/dist/main/index.js +++ b/dist/main/index.js @@ -1,4 +1,4 @@ -(()=>{var __webpack_modules__={9419:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;var r=Object.getOwnPropertyDescriptor(a,p);if(!r||("get"in r?!a.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return a[p]}}}Object.defineProperty(e,t,r)}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.prototype.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:true});a.callKubernetesPathAsync=a.callKubernetesAsync=a.callKubernetesPath=a.callKubernetes=a.callAsync=a.call=a.prepareAWS=a.prepareK8S=void 0;const i=d(p(2186));const o=p(2081);const n=p(7147);const l=p(2037);const m=s(p(1017));const u=p(8990);let c=null;let v=0;function prepareK8S(e){return(0,u.logGroup)("Prepare k8s",(()=>{const a=m.default.join((0,l.homedir)(),".kube");i.info(`mkdir ${a}`);try{(0,n.mkdirSync)(a)}catch(e){i.debug("error"+JSON.stringify(e));if((e===null||e===void 0?void 0:e.code)==="EEXIST"){i.debug(a+" EEXIST")}else throw e}if(e.length>0){i.debug("Get kubeconfig string");const a=Buffer.from(e,"base64").toString("utf8");i.info(`Write kubeconfig to ~/.kube/config`);(0,n.writeFileSync)(m.default.join((0,l.homedir)(),".kube/config"),a)}c=call("which kubectl").split("\n")[0];i.info(`kubectl path: ${c}`)}))}a.prepareK8S=prepareK8S;function prepareAWS(e,a){const p=m.default.join((0,l.homedir)(),".aws");i.info(`mkdir ${p}`);try{(0,n.mkdirSync)(p)}catch(e){i.debug("error"+JSON.stringify(e));if((e===null||e===void 0?void 0:e.code)==="EEXIST"){i.debug(p+" EEXIST")}else throw e}if(e.length>0){i.debug("Get aws credentials string");const a=Buffer.from(e,"base64").toString("utf8");i.info(`Write awsCredentials to ~/.aws/credentials`);(0,n.writeFileSync)(m.default.join((0,l.homedir)(),".aws/credentials"),a)}if(a.length>0){i.debug("Get aws credentials string");const e=Buffer.from(a,"base64").toString("utf8");i.info(`Write awsConfig to ~/.aws/config`);(0,n.writeFileSync)(m.default.join((0,l.homedir)(),".aws/config"),e)}}a.prepareAWS=prepareAWS;function call(e,a=false){const p=++v;!a&&i.info(`Call #${p} command: '${e}'`);const t=(0,o.execSync)(e,{encoding:"utf8",maxBuffer:Infinity,stdio:"pipe"});i.debug(`Call #${p} result ${t}`);return t}a.call=call;function callAsync(e,a=false,p="."){return new Promise(((t,r)=>{const d=++v;!a&&i.info(`Call #${d} command: '${e}' with cwd '${p}'`);const s=(0,o.exec)(e,{encoding:"utf8",maxBuffer:Infinity,cwd:p});if(!s.stdio||!s.stdout||!s.stderr){i.info(`Error in callAsync #${d}: can't spawn process`);throw new Error(`Error in callAsync #${d}: can't spawn process`)}let n="",l="";s.stdout.on("data",(e=>n+=e.toString()));s.stderr.on("data",(e=>l+=e.toString()));s.on("close",(e=>{i.debug(`Call #${d} async code = ${e}`);if(e==0){if(n.length>3e3)i.debug(`Call #${d} async TRUNCATED (full size is ${n.length/1024}kb - showing 3000 symbols) output: \n${n.slice(0,1500)}\n.........\n${n.slice(-1500)}`);else i.debug(`Call #${d} async output \n${n}`);t(n)}else{if(a)i.info(`Call #${d} async with secrets failed - on close`);else i.info(`Call #${d} async failed - on close:\nError: ${l}\nOutput: ${n}`);r(new Error(l))}}));s.on("error",(e=>{if(a)i.info(`Call #${d} async with secrets failed - on error`);else i.info(`Call #${d} async failed - on error:\nError: ${e}\nOutput: ${n}`);r(e)}))}))}a.callAsync=callAsync;function callKubernetes(e){if(c===null)throw new Error("K8s not initialized, call prepareK8S first");return call(`${c} ${e}`)}a.callKubernetes=callKubernetes;function callKubernetesPath(e){if(c===null)throw new Error("K8s not initialized, call prepareK8S first");return call(e(c))}a.callKubernetesPath=callKubernetesPath;function callKubernetesAsync(e){if(c===null)throw new Error("K8s not initialized, call prepareK8S first");return callAsync(`${c} ${e}`)}a.callKubernetesAsync=callKubernetesAsync;function callKubernetesPathAsync(e){if(c===null)throw new Error("K8s not initialized, call prepareK8S first");return callAsync(e(c))}a.callKubernetesPathAsync=callKubernetesPathAsync},843:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;var r=Object.getOwnPropertyDescriptor(a,p);if(!r||("get"in r?!a.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return a[p]}}}Object.defineProperty(e,t,r)}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.prototype.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};var s=this&&this.__awaiter||function(e,a,p,t){function adopt(e){return e instanceof p?e:new p((function(a){a(e)}))}return new(p||(p=Promise))((function(p,r){function fulfilled(e){try{step(t.next(e))}catch(e){r(e)}}function rejected(e){try{step(t["throw"](e))}catch(e){r(e)}}function step(e){e.done?p(e.value):adopt(e.value).then(fulfilled,rejected)}step((t=t.apply(e,a||[])).next())}))};var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:true});a.checkResults=a.checkGraphValues=a.filterGraphData=a.parseRawGraph=a.getDataFromGrafana=a.getUUID=void 0;const o=i(p(6113));const n=d(p(2186));const l=d(p(5438));const m=p(9419);const u=p(4542);function getUUID(){const e=o.default.randomBytes(16).toString("hex");return e.substring(0,8)+"-"+e.substring(8,12)+"-"+e.substring(12,16)+"-"+e.substring(16,20)+"-"+e.substring(20)}a.getUUID=getUUID;function getDataFromGrafana(e,a,p){return s(this,void 0,void 0,(function*(){const t={queries:p.map(((e,a)=>Object.assign(Object.assign({refId:e.refId,expr:e.expr,key:`Q-${getUUID()}-${a}`,interval:e.interval},e.format?{format:e.format}:{}),{datasource:{type:"prometheus",uid:"prometheus"},editorMode:"code",legendFormat:"__auto",range:false,instant:true,exemplar:false,hide:false,queryType:"timeSeriesQuery",utcOffsetSec:14400,datasourceId:1,intervalMs:5e3,maxDataPoints:1514}))),range:{from:e.toISOString(),to:a.toISOString(),raw:{from:e.toISOString(),to:a.toISOString()}},from:""+e.valueOf(),to:""+a.valueOf()};let r=t.queries.reduce(((e,a)=>e+=a.key),"");t.queries=t.queries.map((e=>Object.assign({requestId:`${r}${e.refId}`},e)));let d=`wget -q -O- --header='content-type: application/json' --post-data='${JSON.stringify(t)}' 'http://grafana/api/ds/query' | base64`;d=d.replace(/'/g,"'\\''");n.debug(`getDataFromGrafana kube request:\nkubectl run -q -i --image=busybox --rm grafana-result-peeker --restart=Never -- sh -c '${d}'`);return Buffer.from(yield(0,m.callKubernetesPathAsync)((e=>`${e} run -q -i --image=busybox --rm grafana-result-peeker-${Math.ceil(Math.random()*1e3%1e3)} --restart=Never -- sh -c '${d}'`)),"base64").toString("utf8")}))}a.getDataFromGrafana=getDataFromGrafana;function parseRawGraph(e){const a=JSON.parse(e);n.debug("Parsed JSON graph data "+JSON.stringify(a));const p=Object.keys(a.results);n.debug("Process graph data");return p.reduce(((e,p)=>{e[p]=a.results[p].frames.map((e=>{var a,p,t,r,d,s;return{value:(t=(p=(a=e===null||e===void 0?void 0:e.data)===null||a===void 0?void 0:a.values)===null||p===void 0?void 0:p[1])===null||t===void 0?void 0:t[0],labels:(s=(d=(r=e===null||e===void 0?void 0:e.schema)===null||r===void 0?void 0:r.fields)===null||d===void 0?void 0:d[1])===null||s===void 0?void 0:s.labels}}));return e}),{})}a.parseRawGraph=parseRawGraph;function filterGraphData(e){return function filterGraphFun(a){return Object.entries(e).reduce(((e,p)=>e&&a.labels[p[0]]===p[1]),true)}}a.filterGraphData=filterGraphData;function checkGraphValues(e,a,p){let t=[];for(const r of Object.keys(p)){const d=a[r];const s=p[r];n.debug(`Check query '${r}': result: ${JSON.stringify(d)}; desired result:${JSON.stringify(s)}`);for(const a of s){const p=Object.assign({job:`workload-${e}`},a.filter);let s=(d||[]).filter(filterGraphData(p));n.debug(`Apply filter '${JSON.stringify(p)}': ${JSON.stringify(s)}`);const i=`${r}${JSON.stringify(p)}`;const o=`slo-${i.replace(/[{":}\[\]]/g,"-")}`;if(s.length===0){n.debug(`Not found results by filter to inspect`);t.push([o,"notfound",i,`Not found results by filter to inspect`])}else{n.debug(`Found results by filter to inspect: ${JSON.stringify(Object.entries(s))}`);for(const[e,p]of Object.entries(s)){const r=a.value[0]===">"?p.value>a.value[1]:p.value0",interval:"1s"},{refId:"max_99_latency",expr:'max_over_time(latency{quantile="0.99"}[$__range])>0',interval:""},{refId:"fail_interval",expr:"sum_over_time(clamp(irate(not_oks[2s])*2, 0, 1)[$__range:1s])>0",interval:"1s"}];const i=yield(0,u.retry)(2,(()=>s(this,void 0,void 0,(function*(){const e=yield getDataFromGrafana(p,t,d);n.debug("graphsRaw: "+e);return parseRawGraph(e)}))));n.debug("parsed: "+JSON.stringify(i));const o=checkGraphValues(a,i,r);n.info("checks: "+JSON.stringify(o));let m=false;let c="SLO check failed: ";for(let a=0;ae[1]=="error")).length>0}))}a.checkResults=checkResults},3179:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;var r=Object.getOwnPropertyDescriptor(a,p);if(!r||("get"in r?!a.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return a[p]}}}Object.defineProperty(e,t,r)}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.prototype.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};var s=this&&this.__awaiter||function(e,a,p,t){function adopt(e){return e instanceof p?e:new p((function(a){a(e)}))}return new(p||(p=Promise))((function(p,r){function fulfilled(e){try{step(t.next(e))}catch(e){r(e)}}function rejected(e){try{step(t["throw"](e))}catch(e){r(e)}}function step(e){e.done?p(e.value):adopt(e.value).then(fulfilled,rejected)}step((t=t.apply(e,a||[])).next())}))};var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:true});a.deleteCluster=a.getYdbVersions=a.createCluster=void 0;const o=d(p(2186));const n=p(8990);const l=p(9419);const m=i(p(1542));const u=p(5476);let c=m.default["k8s/ci/database.yaml"].content;let v=m.default["k8s/ci/storage.yaml"].content;function createCluster(e="23.1.19",a,p=10){return s(this,void 0,void 0,(function*(){return(0,n.logGroup)("Create cluster",(()=>s(this,void 0,void 0,(function*(){c=c.replace("${{VERSION}}",e);v=v.replace("${{VERSION}}",e);o.debug("database manifest:\n\n"+c);o.debug("storage manifest:\n\n"+v);o.info("Apply database and storage manifests");o.info("storage apply result:\n"+(0,l.callKubernetesPath)((e=>`${e} apply -f - <`${e} apply -f - <s(this,void 0,void 0,(function*(){o.debug("check status of cluster");const e=getStatus("database");const a=getStatus("storage");o.debug(`Current status of cluster: database - ${e}, storage - ${a}`);if(e!==t){o.info(`Database become '${e}', storage is '${a}'`);t=e}if(a!==r){o.info(`Storage become '${a}', database is '${e}'`);r=a}if(e==="Ready"&&a==="Ready")return true;return false}))))}))))}))}a.createCluster=createCluster;function getYdbVersions(){return(0,n.logGroup)("Get versions",(()=>{const e=(0,l.call)("docker run --rm ghcr.io/regclient/regctl:v0.4.8 tag ls cr.yandex/crptqonuodf51kdj7a7d/ydb");const a=e.split("\n").filter((e=>e.length>0));a.sort();return a}))}a.getYdbVersions=getYdbVersions;function getStatus(e){const a=(0,l.callKubernetes)(`get ${e}s.ydb.tech ${e}-sample -ojsonpath={.status}`);return JSON.parse(a).state}function deleteCluster(){return(0,n.logGroup)("Delete cluster",(()=>{o.info("Delete database and storage manifests");try{o.info("Database delete result:\n"+(0,l.callKubernetes)("delete databases.ydb.tech database-sample"))}catch(e){o.info("Error while deleting database"+JSON.stringify(e))}try{o.info("Storage delete result:\n"+(0,l.callKubernetes)("delete storages.ydb.tech storage-sample"))}catch(e){o.info("Error while deleting storage"+JSON.stringify(e))}try{const e=(0,l.callKubernetes)('get pvc -o=jsonpath="{.items[*].metadata.name}" -l ydb-cluster=slo-storage');o.debug("pvcs"+e);o.info("PVC delete result:\n"+(0,l.callKubernetes)(`delete pvc ${e}`))}catch(e){o.info("Error while deleting pvcs"+JSON.stringify(e))}}))}a.deleteCluster=deleteCluster},8995:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;var r=Object.getOwnPropertyDescriptor(a,p);if(!r||("get"in r?!a.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return a[p]}}}Object.defineProperty(e,t,r)}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.prototype.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};var s=this&&this.__awaiter||function(e,a,p,t){function adopt(e){return e instanceof p?e:new p((function(a){a(e)}))}return new(p||(p=Promise))((function(p,r){function fulfilled(e){try{step(t.next(e))}catch(e){r(e)}}function rejected(e){try{step(t["throw"](e))}catch(e){r(e)}}function step(e){e.done?p(e.value):adopt(e.value).then(fulfilled,rejected)}step((t=t.apply(e,a||[])).next())}))};Object.defineProperty(a,"__esModule",{value:true});a.annotate=a.errorScheduler=void 0;const i=d(p(2186));const o=p(9419);let n=null;function errorScheduler(e,a){return s(this,void 0,void 0,(function*(){const p=(yield(0,o.callKubernetesAsync)(`get pods database-sample-0 -o=jsonpath='{.status.podIP}'`)).split("\n")[0];i.info(`Target of the error scheduler (database-sample-0) IP: ${p}`);n=e;i.info(`Grafana pod name: ${n}`);yield new Promise((e=>{setTimeout(e,a*1e3)}));const freezeCmd=e=>`run -it --image=busybox --rm tablet-${e==="0"?"un":""}freezer --restart=Never --`+` sh -c "wget -q -O- '${p}:8765/tablets/app?`+`TabletID=72057594037968897&node=1&page=SetFreeze&freeze=${e}' "`;yield createError("Freeze tablet",freezeCmd("1"),a);yield createError("Unfreeze tablet",freezeCmd("0"),a);yield createError("Delete database pod",`delete pod database-sample-1`,a);yield createError("Force delete database pod",`delete pod database-sample-1 --force=true --grace-period=0`,a);yield createError("Kill database from inside",`exec -it database-sample-0 -- /bin/bash -c "kill -2 1 && echo 'process killed'"`,a)}))}a.errorScheduler=errorScheduler;function createError(e,a,p){return s(this,void 0,void 0,(function*(){return yield Promise.allSettled([(0,o.callKubernetesAsync)(a),annotate(e,i.getInput("grafana_dashboard")||"7CzMl5t4k"),new Promise((e=>{setTimeout(e,p*1e3)}))]).then((e=>{if(e.filter((e=>e.status==="rejected")).length>0)return Promise.reject("Error in YDB error creation")}))}))}function annotate(e,a="7CzMl5t4k"){const p="http://localhost:3000/api/annotations";const createWgetPost=(e,a)=>`wget -qS -O- --header 'Accept: application/json' --header 'Content-Type: application/json' --post-data '${a}' '${e}'`;const t=`{\\"dashboardUID\\":\\"${a}\\", \\"text\\":\\"${e}\\", \\"tags\\":[]}`;return(0,o.callKubernetes)(`exec -it ${n} --container grafana -- /bin/bash -c "${createWgetPost(p,t)}"`)}a.annotate=annotate},8660:function(e,a,p){"use strict";var t=this&&this.__awaiter||function(e,a,p,t){function adopt(e){return e instanceof p?e:new p((function(a){a(e)}))}return new(p||(p=Promise))((function(p,r){function fulfilled(e){try{step(t.next(e))}catch(e){r(e)}}function rejected(e){try{step(t["throw"](e))}catch(e){r(e)}}function step(e){e.done?p(e.value):adopt(e.value).then(fulfilled,rejected)}step((t=t.apply(e,a||[])).next())}))};Object.defineProperty(a,"__esModule",{value:true});a.getInfrastractureEndpoints=void 0;const r=p(9419);const d=p(4542);const s=p(5476);function getInfrastractureEndpoints(){return t(this,void 0,void 0,(function*(){const e=["prometheus-operator","prometheus","prometheus-pushgateway","grafana","grafana-renderer","ydb-operator"];return Promise.allSettled(e.map(getEndpoint)).then((a=>{const p=e.filter(((e,p)=>a[p].status==="rejected"));if(p.length>0){throw new Error(`Not found those required k8s pods: ${p.join(", ")}`)}return{prometheusOperator:a[0].value,prometheus:a[1].value,prometheusPushgateway:a[2].value,grafana:a[3].value,grafanaRenderer:a[4].value,ydbOperator:a[5].value}}))}))}a.getInfrastractureEndpoints=getInfrastractureEndpoints;function getEndpoint(e){return(0,d.retry)(2,(()=>(0,s.withTimeoutSimple)(10,(0,r.callKubernetesAsync)(`get pods -l "app.kubernetes.io/name=${e}" -o jsonpath="{.items[0].metadata.name}"`).then((e=>e.split("\n")[0])))))}},1413:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;var r=Object.getOwnPropertyDescriptor(a,p);if(!r||("get"in r?!a.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return a[p]}}}Object.defineProperty(e,t,r)}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.prototype.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};var s=this&&this.__awaiter||function(e,a,p,t){function adopt(e){return e instanceof p?e:new p((function(a){a(e)}))}return new(p||(p=Promise))((function(p,r){function fulfilled(e){try{step(t.next(e))}catch(e){r(e)}}function rejected(e){try{step(t["throw"](e))}catch(e){r(e)}}function step(e){e.done?p(e.value):adopt(e.value).then(fulfilled,rejected)}step((t=t.apply(e,a||[])).next())}))};var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:true});a.postComment=a.grafanaScreenshot=void 0;const o=i(p(1017));const n=d(p(2186));const l=p(5438);const m=p(9419);const u=p(3292);function grafanaScreenshot(e,a,p,t,r,d="7CzMl5t4k",i=1500,l=1100){return s(this,void 0,void 0,(function*(){n.debug(`grafanaScreenshot(${e}, ${a}, ${p}, ${t}, ${r}, ${d}, ${i}, ${l})`);const s=`http://grafana/render/d/${d.split("/")[0]}/slo?orgId=1&from=${t.valueOf()}&to=${r.valueOf()}&width=${i}&height=${l}&tz=Europe%2FIstanbul&kiosk=tv&var-filter=job|=|workload-${p}`;n.debug("grafana query: "+s);const c=yield n.group("Get base64 image",(()=>(0,m.callKubernetesAsync)(`run -q -i --image=busybox --rm grafana-screenshoter-${p} --restart=Never -- sh -c "wget -q -O- '${s}' | base64"`)));n.debug("grafana imageb64: "+c.slice(0,100)+"...TRUNCATED..."+c.slice(-100));n.debug("Write picture to FS");const v=`${p}-${(new Date).valueOf()}.png`;yield(0,u.writeFile)(v,Buffer.from(c,"base64"));yield(0,m.callAsync)(`aws s3 --endpoint-url=${e} cp ./${v} "s3://${o.default.join(a,v)}"`);yield(0,m.callAsync)(`rm ${v}`);const h="https://"+o.default.join(e.split("//")[1],a,v);n.debug("fullPictureUri: "+h);return`${h}`}))}a.grafanaScreenshot=grafanaScreenshot;function postComment(e,a,p){return s(this,void 0,void 0,(function*(){if(!l.context.payload.pull_request)return;const t=`\x3c!-- slo-test-action "${a}" --\x3e`;const r=yield e.rest.issues.listComments(Object.assign({issue_number:l.context.payload.pull_request.number},l.context.repo));const d=r.data.filter((e=>{var a;return(a=e.body)===null||a===void 0?void 0:a.includes(t)}));if(d.length===0){const r=Object.assign(Object.assign({},l.context.repo),{issue_number:l.context.payload.pull_request.number,comment_id:a,body:p+`\n${t}`});n.debug("Create comment with data:"+JSON.stringify(r));const d=yield e.rest.issues.createComment(r);n.debug("Create comment result:"+JSON.stringify(d))}else{const a=Object.assign(Object.assign({},l.context.repo),{comment_id:d[0].id,body:p+`\n${t}`});n.debug("Update comment with data:"+JSON.stringify(a));const r=yield e.rest.issues.updateComment(a);n.debug("Update comment result:"+JSON.stringify(r))}}))}a.postComment=postComment},3109:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;var r=Object.getOwnPropertyDescriptor(a,p);if(!r||("get"in r?!a.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return a[p]}}}Object.defineProperty(e,t,r)}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.prototype.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};var s=this&&this.__awaiter||function(e,a,p,t){function adopt(e){return e instanceof p?e:new p((function(a){a(e)}))}return new(p||(p=Promise))((function(p,r){function fulfilled(e){try{step(t.next(e))}catch(e){r(e)}}function rejected(e){try{step(t["throw"](e))}catch(e){r(e)}}function step(e){e.done?p(e.value):adopt(e.value).then(fulfilled,rejected)}step((t=t.apply(e,a||[])).next())}))};Object.defineProperty(a,"__esModule",{value:true});const i=d(p(2186));const o=d(p(5438));const n=p(7653);const l=p(9419);const m=p(1762);const u=p(3179);const c=p(6186);const v=p(8660);const h=p(8995);const g=p(4542);const w=p(843);const _=p(1413);const b=p(6113);const T=!!o.context.payload.pull_request;let E=false;let y=false;function main(){return s(this,void 0,void 0,(function*(){try{let{workloads:e,githubToken:a,kubeconfig:p,awsCredentials:t,awsConfig:r,s3Endpoint:d,s3Folder:S,dockerRepo:O,dockerFolder:D,dockerUsername:k,dockerPassword:P,ydbVersion:A,timeBetweenPhases:N,shutdownTime:G,grafanaDomain:R,grafanaDashboard:C,grafanaDashboardWidth:V,grafanaDashboardHeight:U}=(0,n.parseArguments)();i.debug(`Setting up OctoKit`);const F=o.getOctokit(a);(0,l.prepareK8S)(p);(0,l.prepareAWS)(t,r);yield(0,c.dockerLogin)(O,k,P);const j=yield(0,v.getInfrastractureEndpoints)();i.info(`Services pods: ${JSON.stringify(j)}`);i.info("Run SLO tests for: \n"+e.map((e=>{let a=`#${e.id}`;a+=e.name?`(${e.name})\n`:"\n";a+=`path: '${e.path}'\n`;a+=e.buildContext?`build context: '${e.buildContext}'\n`:"";a+=e.buildOptions?`build options: '${e.buildOptions}'\n`:"";return a})).join("==="));const B=e.length>1?e.map((e=>e.id)).join("__+__"):e[0].id;yield(0,m.obtainMutex)(B,30);i.info("Mutex obtained!");E=true;const L=e.map((e=>(0,c.generateDockerPath)(O,D,e.id)));i.info("Create cluster and build all workloads");const x=e.map((()=>false));const I=yield Promise.allSettled([(0,u.createCluster)(A,15),...e.map(((e,a)=>(0,c.buildWorkload)(e.id,L[a],e.path,e.buildOptions,e.buildContext).then((()=>{x[a]=true}))))]);const $=I[0].status==="fulfilled"&&x.filter((e=>e)).length>0;i.debug(`builded: [${x.toString()}], continueRun: ${$}`);if(I[0].status==="fulfilled"){y=true}if(x.every((e=>e))){i.info("All workloads builded successfully")}else{if($){x.map(((a,p)=>{if(!a)i.info(`Error in '${e[p].id}' build`);else i.info(`'${e[p].id}' build successful`)}))}else{i.info("No workloads builded!")}}if($){const a=yield Promise.allSettled(e.map(((e,a)=>s(this,void 0,void 0,(function*(){return(0,g.retry)(2,(()=>(0,c.runWorkload)("create",{id:e.id,dockerPath:L[a],timeoutMins:2,args:`--min-partitions-count 6 --max-partitions-count 1000 `+`--partition-size 1 --initial-data-count 1000`})))})))));i.debug("create results: "+JSON.stringify(a));if(a.filter((e=>e.status==="fulfilled")).length===0){throw new Error("No workloads performed `create` action, exit")}else{const a=yield Promise.allSettled([...e.map(((e,a)=>(0,c.runWorkload)("run",{id:e.id,dockerPath:L[a],timeoutMins:Math.ceil(((5+4)*N+G)/60),args:`--time ${(5+2)*N} --shutdown-time ${G} --read-rps 1000 `+`--write-rps 100 --prom-pgw http://prometheus-pushgateway:9091`}))),(0,h.errorScheduler)(j.grafana,N)]);i.debug("run results: "+JSON.stringify(a));if(a.slice(0,e.length).filter((e=>e.status==="fulfilled")).length===0){i.info("No successfull workload runs!");throw new Error("No workloads runs completed successfully")}else{const p={success_rate:[{filter:{},value:[">",.98]}],max_99_latency:[{filter:{status:"ok"},value:["<",100]},{filter:{status:"err"},value:["<",3e4]}],fail_interval:[{filter:{},value:["<",20]}]};let t=[];a.map(((r,o)=>{if(r.status==="fulfilled"&&o!==a.length-1){const a=r.value;t.push((0,w.checkResults)(F,e[o].id,a.startTime,a.endTime,p));i.debug("isPullRequest="+T);if(T){i.debug("Push to promises grafana screenshot and postComment");t.push((()=>s(this,void 0,void 0,(function*(){var p;const t=yield(0,_.grafanaScreenshot)(d,S,e[o].id,a.startTime,a.endTime,C,V,U);const r=`\n:volcano: Here are results of SLO test for **${(p=e[o].name)!==null&&p!==void 0?p:e[o].id}**:\n\n[Grafana Dashboard](${R}/d/${C}?orgId=1&from=${a.startTime.valueOf()}&to=${a.endTime.valueOf()})\n\n![SLO-${e[o].id}](${t})\n`;yield(0,_.postComment)(F,(0,b.createHash)("sha1").update(e[o].id).digest().readUint16BE(),r)})))())}}}));const r=yield Promise.allSettled(t);i.info("checkResults and grafana screenshot result: "+JSON.stringify(r))}}}(0,u.deleteCluster)();(0,m.releaseMutex)()}catch(e){if(e instanceof Error)i.setFailed(e.message);if(y){try{(0,u.deleteCluster)()}catch(e){i.info("Failed to delete cluster:"+JSON.stringify(e))}}if(E){try{(0,m.releaseMutex)()}catch(e){i.info("Failed to release mutex:"+JSON.stringify(e))}}}}))}i.info("Main SLO action");main()},1762:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;var r=Object.getOwnPropertyDescriptor(a,p);if(!r||("get"in r?!a.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return a[p]}}}Object.defineProperty(e,t,r)}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.prototype.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};var s=this&&this.__awaiter||function(e,a,p,t){function adopt(e){return e instanceof p?e:new p((function(a){a(e)}))}return new(p||(p=Promise))((function(p,r){function fulfilled(e){try{step(t.next(e))}catch(e){r(e)}}function rejected(e){try{step(t["throw"](e))}catch(e){r(e)}}function step(e){e.done?p(e.value):adopt(e.value).then(fulfilled,rejected)}step((t=t.apply(e,a||[])).next())}))};Object.defineProperty(a,"__esModule",{value:true});a.releaseMutex=a.obtainMutex=a.setBusy=a.isBusy=void 0;const i=d(p(2186));const o=p(9419);const n=p(8990);const l=p(5476);function isBusy(e){var a,p,t;i.debug(`isBusy(${e})`);const r=(0,o.callKubernetes)(`get configmaps ${e} -ojson`);i.debug("isBusy result: "+r);const d=JSON.parse(r);i.debug("configmap parsed: "+JSON.stringify(d));if(((a=d===null||d===void 0?void 0:d.data)===null||a===void 0?void 0:a.busy)!==undefined){i.info(`Mutex locked by ${(p=d===null||d===void 0?void 0:d.data)===null||p===void 0?void 0:p.lockedBy}`);return(t=d===null||d===void 0?void 0:d.data)===null||t===void 0?void 0:t.lockedBy}return false}a.isBusy=isBusy;function setBusy(e){i.debug(`setBusy(${e})`);(0,o.callKubernetesPath)((a=>`${a} create configmap slo-mutex --from-literal=busy=true --from-literal=lockedBy=${e} -o=yaml --dry-run=client | ${a} apply -f -`))}a.setBusy=setBusy;function obtainMutex(e,a,p=20){return(0,n.logGroup)("Obtain mutex",(()=>s(this,void 0,void 0,(function*(){return(0,l.withTimeout)(a,p,"Obtain mutex",(()=>{const a=isBusy("slo-mutex");if(typeof a==="boolean"&&!a){i.debug("Set mutex");setBusy(e);i.info("Mutex obtained");i.debug("Mutex sleep 5s");(0,o.call)("sleep 5");i.debug("Re-check after sleep");const a=isBusy("slo-mutex");if(a!==e){i.info("Mutex is not obtained!");return false}return true}return false}))}))))}a.obtainMutex=obtainMutex;function releaseMutex(){return(0,n.logGroup)("Release mutex",(()=>{(0,o.callKubernetesPath)((e=>`${e} create configmap slo-mutex -o=yaml --dry-run=client | ${e} apply -f -`))}))}a.releaseMutex=releaseMutex},7653:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;var r=Object.getOwnPropertyDescriptor(a,p);if(!r||("get"in r?!a.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return a[p]}}}Object.defineProperty(e,t,r)}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.prototype.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};Object.defineProperty(a,"__esModule",{value:true});a.parseArguments=void 0;const s=d(p(2186));const i=p(8990);const o=p(3179);function parseArguments(){return(0,i.logGroup)("Parse arguments",(()=>{let e=[];let a=-1,p=true;do{const t=getWorkloadParam(a);if(null===t){if(a!==-1)p=false}else{e.push(t)}a++}while(p);const t=s.getInput("GITHUB_TOKEN");const r=s.getInput("KUBECONFIG_B64");const d=s.getInput("DOCKER_REPO");const i=s.getInput("DOCKER_FOLDER");const n=s.getInput("DOCKER_USERNAME");const l=s.getInput("DOCKER_PASSWORD");const m=s.getInput("AWS_CREDENTIALS_B64");const u=s.getInput("AWS_CONFIG_B64");const c=s.getInput("s3_endpoint");const v=s.getInput("s3_images_folder");const h=s.getInput("grafana_domain");const g=s.getInput("grafana_dashboard")||"7CzMl5t4k";const w=Number(s.getInput("grafana_dashboard_width")||"1500");const _=Number(s.getInput("grafana_dashboard_height")||"1700");let b=s.getInput("ydb_version");const T=Number(s.getInput("time_between_phases")||"20");const E=Number(s.getInput("shutdown_time")||"30");if(isNaN(T))throw new Error("time_between_phases is not a number");if(isNaN(E))throw new Error("shutdown_time is not a number");if(b==="")b="23.1.26";if(b==="newest"){s.info("Get YDB docker versions");const e=(0,o.getYdbVersions)();b=e[e.length-1];s.info(`Use YDB docker version = '${b}'`)}return{workloads:e,githubToken:t,kubeconfig:r,awsCredentials:m,awsConfig:u,s3Endpoint:c,s3Folder:v,dockerRepo:d,dockerFolder:i,dockerUsername:n,dockerPassword:l,ydbVersion:b,timeBetweenPhases:T,shutdownTime:E,grafanaDomain:h,grafanaDashboard:g,grafanaDashboardWidth:w,grafanaDashboardHeight:_}}))}a.parseArguments=parseArguments;function getWorkloadParam(e){let a=e==-1?"":`${e}`;const p=s.getInput("language_id"+a);const t=s.getInput("language"+a);const r=s.getInput("workload_path"+a);const d=s.getInput("workload_build_context"+a);const i=s.getInput("workload_build_options"+a);s.debug(`getWorkloadParam(${e}):\n suffix='${a}'\n languageId='${p}'\n languageName='${t}'\n workloadPath='${r}'\n workloadBuildContext='${d}'\n workloadBuildOptions='${i}'`);if(p.length===0||r.length===0){s.debug(`Not found params for ${e} workload - ${"language_id"+a} and ${"workload_path"+a} are not presented`);return null}let o={id:p,path:r};if(t)o.name=t;if(d)o.buildContext=d;if(i)o.buildOptions=i;return o}},8990:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;var r=Object.getOwnPropertyDescriptor(a,p);if(!r||("get"in r?!a.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return a[p]}}}Object.defineProperty(e,t,r)}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.prototype.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};Object.defineProperty(a,"__esModule",{value:true});a.logGroup=void 0;const s=d(p(2186));function logGroup(e,a){s.startGroup(e);const p=a();if(p instanceof Promise){return p.finally((()=>{s.endGroup()}))}else{s.endGroup();return p}}a.logGroup=logGroup},4542:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;var r=Object.getOwnPropertyDescriptor(a,p);if(!r||("get"in r?!a.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return a[p]}}}Object.defineProperty(e,t,r)}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.prototype.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};var s=this&&this.__awaiter||function(e,a,p,t){function adopt(e){return e instanceof p?e:new p((function(a){a(e)}))}return new(p||(p=Promise))((function(p,r){function fulfilled(e){try{step(t.next(e))}catch(e){r(e)}}function rejected(e){try{step(t["throw"](e))}catch(e){r(e)}}function step(e){e.done?p(e.value):adopt(e.value).then(fulfilled,rejected)}step((t=t.apply(e,a||[])).next())}))};Object.defineProperty(a,"__esModule",{value:true});a.retry=void 0;const i=d(p(2186));function retry(e,a){return s(this,void 0,void 0,(function*(){let p;while(e>0){try{return yield a()}catch(e){p=e}e--}i.info("All retries have been used, re-throwing error");throw p}))}a.retry=retry},5476:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;var r=Object.getOwnPropertyDescriptor(a,p);if(!r||("get"in r?!a.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return a[p]}}}Object.defineProperty(e,t,r)}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.prototype.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};var s=this&&this.__awaiter||function(e,a,p,t){function adopt(e){return e instanceof p?e:new p((function(a){a(e)}))}return new(p||(p=Promise))((function(p,r){function fulfilled(e){try{step(t.next(e))}catch(e){r(e)}}function rejected(e){try{step(t["throw"](e))}catch(e){r(e)}}function step(e){e.done?p(e.value):adopt(e.value).then(fulfilled,rejected)}step((t=t.apply(e,a||[])).next())}))};Object.defineProperty(a,"__esModule",{value:true});a.withTimeoutSimple=a.withTimeout=a.TimeoutExceededError=void 0;const i=d(p(2186));class TimeoutExceededError extends Error{}a.TimeoutExceededError=TimeoutExceededError;function withTimeout(e,a,p,t){return s(this,void 0,void 0,(function*(){i.debug(`Call withTimeout: timeout=${e}mins refreshPeriod=${a}s now: ${(new Date).toISOString()}`);const r=(new Date).valueOf()+e*1e3*60;i.debug(`Deadline is set to: ${r} ( ${new Date(r).toISOString()} )`);do{i.debug(`withTimeout check: ${r} ( ${new Date(r).toISOString()} )`);if(yield t())return;yield new Promise((e=>setTimeout(e,a*1e3)))}while((new Date).valueOf()setTimeout(p,e*1e3)));return Promise.race([a,p])}))}a.withTimeoutSimple=withTimeoutSimple},6186:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;var r=Object.getOwnPropertyDescriptor(a,p);if(!r||("get"in r?!a.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return a[p]}}}Object.defineProperty(e,t,r)}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.prototype.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};var s=this&&this.__awaiter||function(e,a,p,t){function adopt(e){return e instanceof p?e:new p((function(a){a(e)}))}return new(p||(p=Promise))((function(p,r){function fulfilled(e){try{step(t.next(e))}catch(e){r(e)}}function rejected(e){try{step(t["throw"](e))}catch(e){r(e)}}function step(e){e.done?p(e.value):adopt(e.value).then(fulfilled,rejected)}step((t=t.apply(e,a||[])).next())}))};var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:true});a.runWorkload=a.buildWorkload=a.generateDockerPath=a.dockerLogin=void 0;const o=d(p(2186));const n=d(p(5438));const l=p(9419);const m=p(8990);const u=i(p(1542));const c=p(5476);const v=u.default["k8s/ci/workload.yaml"].content;const h=p(7147);function dockerLogin(e,a,p){return(0,m.logGroup)("Docker login",(()=>s(this,void 0,void 0,(function*(){try{yield(0,l.callAsync)(`echo "${p}" | base64 -d | docker login ${e} -u ${a} --password-stdin`,true);o.info("Successfully logged in")}catch(e){const a="Incorrect docker repo, username or password";if((e===null||e===void 0?void 0:e.message)&&(e===null||e===void 0?void 0:e.message).indexOf("username or password")>-1){o.info(a)}else{o.info("Something went wrong in docker login")}throw new Error(a)}}))))}a.dockerLogin=dockerLogin;function generateDockerPath(e,a,p){return`${e}/${a}/${p}`}a.generateDockerPath=generateDockerPath;function buildWorkload(e,a,p,t,r){if(!t||t.length===0)t="";if(!r||r.length===0)r=".";return o.group(`Build workload ${e}`,(()=>s(this,void 0,void 0,(function*(){o.info("Build docker image");yield(0,l.callAsync)(`docker buildx build --platform linux/amd64 `+`-t ${a}:latest `+`-t ${a}:gh-${n.context.sha} `+`${t} `+`${r}`,false,p);o.info("Push docker tag @latest");yield(0,l.callAsync)(`docker image push ${a}:latest`);o.info(`Push docker tag '@gh-${n.context.sha}'`);yield(0,l.callAsync)(`docker image push ${a}:gh-${n.context.sha}`)}))))}a.buildWorkload=buildWorkload;function runWorkload(e,a){return o.group(`Workload ${a.id} - ${e}`,(()=>s(this,void 0,void 0,(function*(){const p=`grpc://database-sample-grpc:2135 /root/database-sample --table-name slo-${a.id} ${a.args}`;const t=v.replace(/\$\{\{LANGUAGE_ID}}/g,a.id).replace(/\$\{\{COMMAND}}/g,e).replace(/\$\{\{DOCKER_IMAGE}}/g,a.dockerPath).replace("${{ARGS}}",p.split(" ").map((e=>`'${e}'`)).join("\n - "));o.debug(`Workload manifest: \n\n${t}`);const r=new Date;o.info(`Workload apply ${e} result:\n`+(yield(0,l.callKubernetesPathAsync)((e=>`${e} apply -f - <s(this,void 0,void 0,(function*(){const p=JSON.parse(yield(0,l.callKubernetesAsync)(`get job/${a.id}-wl-${e} -o=jsonpath={.status}`));o.debug("Workload status check: "+JSON.stringify(p));if(p.failed){const p=`Workload ${a.id} ${e} failed`;o.info(p);yield saveLogs(a.id,e);throw new Error(p)}return p.complete||p.succeeded}))))}finally{const p=new Date;yield saveLogs(a.id,e);return{startTime:r,endTime:p}}}))))}a.runWorkload=runWorkload;function saveLogs(e,a){return s(this,void 0,void 0,(function*(){let p=yield(0,l.callKubernetesAsync)(`logs job/${e}-wl-${a}`);try{let t="./logs";if(!h.existsSync(t)){yield h.promises.mkdir(t)}yield h.promises.writeFile(`${t}/${e}-${a}.log`,p)}catch(t){o.info(`error write file for ${e}-${a}: ${t.message}`);o.group(`Workload ${e} ${a} logs`,(()=>s(this,void 0,void 0,(function*(){o.info(p)}))))}}))}},7351:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;Object.defineProperty(e,t,{enumerable:true,get:function(){return a[p]}})}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};Object.defineProperty(a,"__esModule",{value:true});a.issue=a.issueCommand=void 0;const s=d(p(2037));const i=p(5278);function issueCommand(e,a,p){const t=new Command(e,a,p);process.stdout.write(t.toString()+s.EOL)}a.issueCommand=issueCommand;function issue(e,a=""){issueCommand(e,{},a)}a.issue=issue;const o="::";class Command{constructor(e,a,p){if(!e){e="missing.command"}this.command=e;this.properties=a;this.message=p}toString(){let e=o+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";let a=true;for(const p in this.properties){if(this.properties.hasOwnProperty(p)){const t=this.properties[p];if(t){if(a){a=false}else{e+=","}e+=`${p}=${escapeProperty(t)}`}}}}e+=`${o}${escapeData(this.message)}`;return e}}function escapeData(e){return i.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(e){return i.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}},2186:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;Object.defineProperty(e,t,{enumerable:true,get:function(){return a[p]}})}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};var s=this&&this.__awaiter||function(e,a,p,t){function adopt(e){return e instanceof p?e:new p((function(a){a(e)}))}return new(p||(p=Promise))((function(p,r){function fulfilled(e){try{step(t.next(e))}catch(e){r(e)}}function rejected(e){try{step(t["throw"](e))}catch(e){r(e)}}function step(e){e.done?p(e.value):adopt(e.value).then(fulfilled,rejected)}step((t=t.apply(e,a||[])).next())}))};Object.defineProperty(a,"__esModule",{value:true});a.getIDToken=a.getState=a.saveState=a.group=a.endGroup=a.startGroup=a.info=a.notice=a.warning=a.error=a.debug=a.isDebug=a.setFailed=a.setCommandEcho=a.setOutput=a.getBooleanInput=a.getMultilineInput=a.getInput=a.addPath=a.setSecret=a.exportVariable=a.ExitCode=void 0;const i=p(7351);const o=p(717);const n=p(5278);const l=d(p(2037));const m=d(p(1017));const u=p(8041);var c;(function(e){e[e["Success"]=0]="Success";e[e["Failure"]=1]="Failure"})(c=a.ExitCode||(a.ExitCode={}));function exportVariable(e,a){const p=n.toCommandValue(a);process.env[e]=p;const t=process.env["GITHUB_ENV"]||"";if(t){return o.issueFileCommand("ENV",o.prepareKeyValueMessage(e,a))}i.issueCommand("set-env",{name:e},p)}a.exportVariable=exportVariable;function setSecret(e){i.issueCommand("add-mask",{},e)}a.setSecret=setSecret;function addPath(e){const a=process.env["GITHUB_PATH"]||"";if(a){o.issueFileCommand("PATH",e)}else{i.issueCommand("add-path",{},e)}process.env["PATH"]=`${e}${m.delimiter}${process.env["PATH"]}`}a.addPath=addPath;function getInput(e,a){const p=process.env[`INPUT_${e.replace(/ /g,"_").toUpperCase()}`]||"";if(a&&a.required&&!p){throw new Error(`Input required and not supplied: ${e}`)}if(a&&a.trimWhitespace===false){return p}return p.trim()}a.getInput=getInput;function getMultilineInput(e,a){const p=getInput(e,a).split("\n").filter((e=>e!==""));if(a&&a.trimWhitespace===false){return p}return p.map((e=>e.trim()))}a.getMultilineInput=getMultilineInput;function getBooleanInput(e,a){const p=["true","True","TRUE"];const t=["false","False","FALSE"];const r=getInput(e,a);if(p.includes(r))return true;if(t.includes(r))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\``)}a.getBooleanInput=getBooleanInput;function setOutput(e,a){const p=process.env["GITHUB_OUTPUT"]||"";if(p){return o.issueFileCommand("OUTPUT",o.prepareKeyValueMessage(e,a))}process.stdout.write(l.EOL);i.issueCommand("set-output",{name:e},n.toCommandValue(a))}a.setOutput=setOutput;function setCommandEcho(e){i.issue("echo",e?"on":"off")}a.setCommandEcho=setCommandEcho;function setFailed(e){process.exitCode=c.Failure;error(e)}a.setFailed=setFailed;function isDebug(){return process.env["RUNNER_DEBUG"]==="1"}a.isDebug=isDebug;function debug(e){i.issueCommand("debug",{},e)}a.debug=debug;function error(e,a={}){i.issueCommand("error",n.toCommandProperties(a),e instanceof Error?e.toString():e)}a.error=error;function warning(e,a={}){i.issueCommand("warning",n.toCommandProperties(a),e instanceof Error?e.toString():e)}a.warning=warning;function notice(e,a={}){i.issueCommand("notice",n.toCommandProperties(a),e instanceof Error?e.toString():e)}a.notice=notice;function info(e){process.stdout.write(e+l.EOL)}a.info=info;function startGroup(e){i.issue("group",e)}a.startGroup=startGroup;function endGroup(){i.issue("endgroup")}a.endGroup=endGroup;function group(e,a){return s(this,void 0,void 0,(function*(){startGroup(e);let p;try{p=yield a()}finally{endGroup()}return p}))}a.group=group;function saveState(e,a){const p=process.env["GITHUB_STATE"]||"";if(p){return o.issueFileCommand("STATE",o.prepareKeyValueMessage(e,a))}i.issueCommand("save-state",{name:e},n.toCommandValue(a))}a.saveState=saveState;function getState(e){return process.env[`STATE_${e}`]||""}a.getState=getState;function getIDToken(e){return s(this,void 0,void 0,(function*(){return yield u.OidcClient.getIDToken(e)}))}a.getIDToken=getIDToken;var v=p(1327);Object.defineProperty(a,"summary",{enumerable:true,get:function(){return v.summary}});var h=p(1327);Object.defineProperty(a,"markdownSummary",{enumerable:true,get:function(){return h.markdownSummary}});var g=p(2981);Object.defineProperty(a,"toPosixPath",{enumerable:true,get:function(){return g.toPosixPath}});Object.defineProperty(a,"toWin32Path",{enumerable:true,get:function(){return g.toWin32Path}});Object.defineProperty(a,"toPlatformPath",{enumerable:true,get:function(){return g.toPlatformPath}})},717:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;Object.defineProperty(e,t,{enumerable:true,get:function(){return a[p]}})}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};Object.defineProperty(a,"__esModule",{value:true});a.prepareKeyValueMessage=a.issueFileCommand=void 0;const s=d(p(7147));const i=d(p(2037));const o=p(5840);const n=p(5278);function issueFileCommand(e,a){const p=process.env[`GITHUB_${e}`];if(!p){throw new Error(`Unable to find environment variable for file command ${e}`)}if(!s.existsSync(p)){throw new Error(`Missing file at path: ${p}`)}s.appendFileSync(p,`${n.toCommandValue(a)}${i.EOL}`,{encoding:"utf8"})}a.issueFileCommand=issueFileCommand;function prepareKeyValueMessage(e,a){const p=`ghadelimiter_${o.v4()}`;const t=n.toCommandValue(a);if(e.includes(p)){throw new Error(`Unexpected input: name should not contain the delimiter "${p}"`)}if(t.includes(p)){throw new Error(`Unexpected input: value should not contain the delimiter "${p}"`)}return`${e}<<${p}${i.EOL}${t}${i.EOL}${p}`}a.prepareKeyValueMessage=prepareKeyValueMessage},8041:function(e,a,p){"use strict";var t=this&&this.__awaiter||function(e,a,p,t){function adopt(e){return e instanceof p?e:new p((function(a){a(e)}))}return new(p||(p=Promise))((function(p,r){function fulfilled(e){try{step(t.next(e))}catch(e){r(e)}}function rejected(e){try{step(t["throw"](e))}catch(e){r(e)}}function step(e){e.done?p(e.value):adopt(e.value).then(fulfilled,rejected)}step((t=t.apply(e,a||[])).next())}))};Object.defineProperty(a,"__esModule",{value:true});a.OidcClient=void 0;const r=p(6255);const d=p(5526);const s=p(2186);class OidcClient{static createHttpClient(e=true,a=10){const p={allowRetries:e,maxRetries:a};return new r.HttpClient("actions/oidc-client",[new d.BearerCredentialHandler(OidcClient.getRequestToken())],p)}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){var a;return t(this,void 0,void 0,(function*(){const p=OidcClient.createHttpClient();const t=yield p.getJson(e).catch((e=>{throw new Error(`Failed to get ID Token. \n \n Error Code : ${e.statusCode}\n \n Error Message: ${e.result.message}`)}));const r=(a=t.result)===null||a===void 0?void 0:a.value;if(!r){throw new Error("Response json body do not have ID Token field")}return r}))}static getIDToken(e){return t(this,void 0,void 0,(function*(){try{let a=OidcClient.getIDTokenUrl();if(e){const p=encodeURIComponent(e);a=`${a}&audience=${p}`}s.debug(`ID token url is ${a}`);const p=yield OidcClient.getCall(a);s.setSecret(p);return p}catch(e){throw new Error(`Error message: ${e.message}`)}}))}}a.OidcClient=OidcClient},2981:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;Object.defineProperty(e,t,{enumerable:true,get:function(){return a[p]}})}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};Object.defineProperty(a,"__esModule",{value:true});a.toPlatformPath=a.toWin32Path=a.toPosixPath=void 0;const s=d(p(1017));function toPosixPath(e){return e.replace(/[\\]/g,"/")}a.toPosixPath=toPosixPath;function toWin32Path(e){return e.replace(/[/]/g,"\\")}a.toWin32Path=toWin32Path;function toPlatformPath(e){return e.replace(/[/\\]/g,s.sep)}a.toPlatformPath=toPlatformPath},1327:function(e,a,p){"use strict";var t=this&&this.__awaiter||function(e,a,p,t){function adopt(e){return e instanceof p?e:new p((function(a){a(e)}))}return new(p||(p=Promise))((function(p,r){function fulfilled(e){try{step(t.next(e))}catch(e){r(e)}}function rejected(e){try{step(t["throw"](e))}catch(e){r(e)}}function step(e){e.done?p(e.value):adopt(e.value).then(fulfilled,rejected)}step((t=t.apply(e,a||[])).next())}))};Object.defineProperty(a,"__esModule",{value:true});a.summary=a.markdownSummary=a.SUMMARY_DOCS_URL=a.SUMMARY_ENV_VAR=void 0;const r=p(2037);const d=p(7147);const{access:s,appendFile:i,writeFile:o}=d.promises;a.SUMMARY_ENV_VAR="GITHUB_STEP_SUMMARY";a.SUMMARY_DOCS_URL="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[a.SUMMARY_ENV_VAR];if(!e){throw new Error(`Unable to find environment variable for $${a.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`)}try{yield s(e,d.constants.R_OK|d.constants.W_OK)}catch(a){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,a,p={}){const t=Object.entries(p).map((([e,a])=>` ${e}="${a}"`)).join("");if(!a){return`<${e}${t}>`}return`<${e}${t}>${a}`}write(e){return t(this,void 0,void 0,(function*(){const a=!!(e===null||e===void 0?void 0:e.overwrite);const p=yield this.filePath();const t=a?o:i;yield t(p,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,a=false){this._buffer+=e;return a?this.addEOL():this}addEOL(){return this.addRaw(r.EOL)}addCodeBlock(e,a){const p=Object.assign({},a&&{lang:a});const t=this.wrap("pre",this.wrap("code",e),p);return this.addRaw(t).addEOL()}addList(e,a=false){const p=a?"ol":"ul";const t=e.map((e=>this.wrap("li",e))).join("");const r=this.wrap(p,t);return this.addRaw(r).addEOL()}addTable(e){const a=e.map((e=>{const a=e.map((e=>{if(typeof e==="string"){return this.wrap("td",e)}const{header:a,data:p,colspan:t,rowspan:r}=e;const d=a?"th":"td";const s=Object.assign(Object.assign({},t&&{colspan:t}),r&&{rowspan:r});return this.wrap(d,p,s)})).join("");return this.wrap("tr",a)})).join("");const p=this.wrap("table",a);return this.addRaw(p).addEOL()}addDetails(e,a){const p=this.wrap("details",this.wrap("summary",e)+a);return this.addRaw(p).addEOL()}addImage(e,a,p){const{width:t,height:r}=p||{};const d=Object.assign(Object.assign({},t&&{width:t}),r&&{height:r});const s=this.wrap("img",null,Object.assign({src:e,alt:a},d));return this.addRaw(s).addEOL()}addHeading(e,a){const p=`h${a}`;const t=["h1","h2","h3","h4","h5","h6"].includes(p)?p:"h1";const r=this.wrap(t,e);return this.addRaw(r).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,a){const p=Object.assign({},a&&{cite:a});const t=this.wrap("blockquote",e,p);return this.addRaw(t).addEOL()}addLink(e,a){const p=this.wrap("a",e,{href:a});return this.addRaw(p).addEOL()}}const n=new Summary;a.markdownSummary=n;a.summary=n},5278:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:true});a.toCommandProperties=a.toCommandValue=void 0;function toCommandValue(e){if(e===null||e===undefined){return""}else if(typeof e==="string"||e instanceof String){return e}return JSON.stringify(e)}a.toCommandValue=toCommandValue;function 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}}a.toCommandProperties=toCommandProperties},4087:(e,a,p)=>{"use strict";Object.defineProperty(a,"__esModule",{value:true});a.Context=void 0;const t=p(7147);const r=p(2037);class Context{constructor(){var e,a,p;this.payload={};if(process.env.GITHUB_EVENT_PATH){if(t.existsSync(process.env.GITHUB_EVENT_PATH)){this.payload=JSON.parse(t.readFileSync(process.env.GITHUB_EVENT_PATH,{encoding:"utf8"}))}else{const e=process.env.GITHUB_EVENT_PATH;process.stdout.write(`GITHUB_EVENT_PATH ${e} does not exist${r.EOL}`)}}this.eventName=process.env.GITHUB_EVENT_NAME;this.sha=process.env.GITHUB_SHA;this.ref=process.env.GITHUB_REF;this.workflow=process.env.GITHUB_WORKFLOW;this.action=process.env.GITHUB_ACTION;this.actor=process.env.GITHUB_ACTOR;this.job=process.env.GITHUB_JOB;this.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=(a=process.env.GITHUB_SERVER_URL)!==null&&a!==void 0?a:`https://github.com`;this.graphqlUrl=(p=process.env.GITHUB_GRAPHQL_URL)!==null&&p!==void 0?p:`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,a]=process.env.GITHUB_REPOSITORY.split("/");return{owner:e,repo:a}}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'")}}a.Context=Context},5438:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;Object.defineProperty(e,t,{enumerable:true,get:function(){return a[p]}})}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};Object.defineProperty(a,"__esModule",{value:true});a.getOctokit=a.context=void 0;const s=d(p(4087));const i=p(3030);a.context=new s.Context;function getOctokit(e,a,...p){const t=i.GitHub.plugin(...p);return new t(i.getOctokitOptions(e,a))}a.getOctokit=getOctokit},7914:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;Object.defineProperty(e,t,{enumerable:true,get:function(){return a[p]}})}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};Object.defineProperty(a,"__esModule",{value:true});a.getApiBaseUrl=a.getProxyAgent=a.getAuthString=void 0;const s=d(p(6255));function getAuthString(e,a){if(!e&&!a.auth){throw new Error("Parameter token or opts.auth is required")}else if(e&&a.auth){throw new Error("Parameters token and opts.auth may not both be specified")}return typeof a.auth==="string"?a.auth:`token ${e}`}a.getAuthString=getAuthString;function getProxyAgent(e){const a=new s.HttpClient;return a.getAgent(e)}a.getProxyAgent=getProxyAgent;function getApiBaseUrl(){return process.env["GITHUB_API_URL"]||"https://api.github.com"}a.getApiBaseUrl=getApiBaseUrl},3030:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;Object.defineProperty(e,t,{enumerable:true,get:function(){return a[p]}})}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};Object.defineProperty(a,"__esModule",{value:true});a.getOctokitOptions=a.GitHub=a.defaults=a.context=void 0;const s=d(p(4087));const i=d(p(7914));const o=p(6762);const n=p(3044);const l=p(4193);a.context=new s.Context;const m=i.getApiBaseUrl();a.defaults={baseUrl:m,request:{agent:i.getProxyAgent(m)}};a.GitHub=o.Octokit.plugin(n.restEndpointMethods,l.paginateRest).defaults(a.defaults);function getOctokitOptions(e,a){const p=Object.assign({},a||{});const t=i.getAuthString(e,p);if(t){p.auth=t}return p}a.getOctokitOptions=getOctokitOptions},5526:function(e,a){"use strict";var p=this&&this.__awaiter||function(e,a,p,t){function adopt(e){return e instanceof p?e:new p((function(a){a(e)}))}return new(p||(p=Promise))((function(p,r){function fulfilled(e){try{step(t.next(e))}catch(e){r(e)}}function rejected(e){try{step(t["throw"](e))}catch(e){r(e)}}function step(e){e.done?p(e.value):adopt(e.value).then(fulfilled,rejected)}step((t=t.apply(e,a||[])).next())}))};Object.defineProperty(a,"__esModule",{value:true});a.PersonalAccessTokenCredentialHandler=a.BearerCredentialHandler=a.BasicCredentialHandler=void 0;class BasicCredentialHandler{constructor(e,a){this.username=e;this.password=a}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 p(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}a.BasicCredentialHandler=BasicCredentialHandler;class 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 p(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}a.BearerCredentialHandler=BearerCredentialHandler;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 p(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}a.PersonalAccessTokenCredentialHandler=PersonalAccessTokenCredentialHandler},6255:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;Object.defineProperty(e,t,{enumerable:true,get:function(){return a[p]}})}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};var s=this&&this.__awaiter||function(e,a,p,t){function adopt(e){return e instanceof p?e:new p((function(a){a(e)}))}return new(p||(p=Promise))((function(p,r){function fulfilled(e){try{step(t.next(e))}catch(e){r(e)}}function rejected(e){try{step(t["throw"](e))}catch(e){r(e)}}function step(e){e.done?p(e.value):adopt(e.value).then(fulfilled,rejected)}step((t=t.apply(e,a||[])).next())}))};Object.defineProperty(a,"__esModule",{value:true});a.HttpClient=a.isHttps=a.HttpClientResponse=a.HttpClientError=a.getProxyUrl=a.MediaTypes=a.Headers=a.HttpCodes=void 0;const i=d(p(3685));const o=d(p(5687));const n=d(p(9835));const l=d(p(4294));var m;(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"})(m=a.HttpCodes||(a.HttpCodes={}));var u;(function(e){e["Accept"]="accept";e["ContentType"]="content-type"})(u=a.Headers||(a.Headers={}));var c;(function(e){e["ApplicationJson"]="application/json"})(c=a.MediaTypes||(a.MediaTypes={}));function getProxyUrl(e){const a=n.getProxyUrl(new URL(e));return a?a.href:""}a.getProxyUrl=getProxyUrl;const v=[m.MovedPermanently,m.ResourceMoved,m.SeeOther,m.TemporaryRedirect,m.PermanentRedirect];const h=[m.BadGateway,m.ServiceUnavailable,m.GatewayTimeout];const g=["OPTIONS","GET","DELETE","HEAD"];const w=10;const _=5;class HttpClientError extends Error{constructor(e,a){super(e);this.name="HttpClientError";this.statusCode=a;Object.setPrototypeOf(this,HttpClientError.prototype)}}a.HttpClientError=HttpClientError;class HttpClientResponse{constructor(e){this.message=e}readBody(){return s(this,void 0,void 0,(function*(){return new Promise((e=>s(this,void 0,void 0,(function*(){let a=Buffer.alloc(0);this.message.on("data",(e=>{a=Buffer.concat([a,e])}));this.message.on("end",(()=>{e(a.toString())}))}))))}))}}a.HttpClientResponse=HttpClientResponse;function isHttps(e){const a=new URL(e);return a.protocol==="https:"}a.isHttps=isHttps;class HttpClient{constructor(e,a,p){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=e;this.handlers=a||[];this.requestOptions=p;if(p){if(p.ignoreSslError!=null){this._ignoreSslError=p.ignoreSslError}this._socketTimeout=p.socketTimeout;if(p.allowRedirects!=null){this._allowRedirects=p.allowRedirects}if(p.allowRedirectDowngrade!=null){this._allowRedirectDowngrade=p.allowRedirectDowngrade}if(p.maxRedirects!=null){this._maxRedirects=Math.max(p.maxRedirects,0)}if(p.keepAlive!=null){this._keepAlive=p.keepAlive}if(p.allowRetries!=null){this._allowRetries=p.allowRetries}if(p.maxRetries!=null){this._maxRetries=p.maxRetries}}}options(e,a){return s(this,void 0,void 0,(function*(){return this.request("OPTIONS",e,null,a||{})}))}get(e,a){return s(this,void 0,void 0,(function*(){return this.request("GET",e,null,a||{})}))}del(e,a){return s(this,void 0,void 0,(function*(){return this.request("DELETE",e,null,a||{})}))}post(e,a,p){return s(this,void 0,void 0,(function*(){return this.request("POST",e,a,p||{})}))}patch(e,a,p){return s(this,void 0,void 0,(function*(){return this.request("PATCH",e,a,p||{})}))}put(e,a,p){return s(this,void 0,void 0,(function*(){return this.request("PUT",e,a,p||{})}))}head(e,a){return s(this,void 0,void 0,(function*(){return this.request("HEAD",e,null,a||{})}))}sendStream(e,a,p,t){return s(this,void 0,void 0,(function*(){return this.request(e,a,p,t)}))}getJson(e,a={}){return s(this,void 0,void 0,(function*(){a[u.Accept]=this._getExistingOrDefaultHeader(a,u.Accept,c.ApplicationJson);const p=yield this.get(e,a);return this._processResponse(p,this.requestOptions)}))}postJson(e,a,p={}){return s(this,void 0,void 0,(function*(){const t=JSON.stringify(a,null,2);p[u.Accept]=this._getExistingOrDefaultHeader(p,u.Accept,c.ApplicationJson);p[u.ContentType]=this._getExistingOrDefaultHeader(p,u.ContentType,c.ApplicationJson);const r=yield this.post(e,t,p);return this._processResponse(r,this.requestOptions)}))}putJson(e,a,p={}){return s(this,void 0,void 0,(function*(){const t=JSON.stringify(a,null,2);p[u.Accept]=this._getExistingOrDefaultHeader(p,u.Accept,c.ApplicationJson);p[u.ContentType]=this._getExistingOrDefaultHeader(p,u.ContentType,c.ApplicationJson);const r=yield this.put(e,t,p);return this._processResponse(r,this.requestOptions)}))}patchJson(e,a,p={}){return s(this,void 0,void 0,(function*(){const t=JSON.stringify(a,null,2);p[u.Accept]=this._getExistingOrDefaultHeader(p,u.Accept,c.ApplicationJson);p[u.ContentType]=this._getExistingOrDefaultHeader(p,u.ContentType,c.ApplicationJson);const r=yield this.patch(e,t,p);return this._processResponse(r,this.requestOptions)}))}request(e,a,p,t){return s(this,void 0,void 0,(function*(){if(this._disposed){throw new Error("Client has already been disposed.")}const r=new URL(a);let d=this._prepareRequest(e,r,t);const s=this._allowRetries&&g.includes(e)?this._maxRetries+1:1;let i=0;let o;do{o=yield this.requestRaw(d,p);if(o&&o.message&&o.message.statusCode===m.Unauthorized){let e;for(const a of this.handlers){if(a.canHandleAuthentication(o)){e=a;break}}if(e){return e.handleAuthentication(this,d,p)}else{return o}}let a=this._maxRedirects;while(o.message.statusCode&&v.includes(o.message.statusCode)&&this._allowRedirects&&a>0){const s=o.message.headers["location"];if(!s){break}const i=new URL(s);if(r.protocol==="https:"&&r.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 o.readBody();if(i.hostname!==r.hostname){for(const e in t){if(e.toLowerCase()==="authorization"){delete t[e]}}}d=this._prepareRequest(e,i,t);o=yield this.requestRaw(d,p);a--}if(!o.message.statusCode||!h.includes(o.message.statusCode)){return o}i+=1;if(i{function callbackForResult(e,a){if(e){t(e)}else if(!a){t(new Error("Unknown error"))}else{p(a)}}this.requestRawWithCallback(e,a,callbackForResult)}))}))}requestRawWithCallback(e,a,p){if(typeof a==="string"){if(!e.options.headers){e.options.headers={}}e.options.headers["Content-Length"]=Buffer.byteLength(a,"utf8")}let t=false;function handleResult(e,a){if(!t){t=true;p(e,a)}}const r=e.httpModule.request(e.options,(e=>{const a=new HttpClientResponse(e);handleResult(undefined,a)}));let d;r.on("socket",(e=>{d=e}));r.setTimeout(this._socketTimeout||3*6e4,(()=>{if(d){d.end()}handleResult(new Error(`Request timeout: ${e.options.path}`))}));r.on("error",(function(e){handleResult(e)}));if(a&&typeof a==="string"){r.write(a,"utf8")}if(a&&typeof a!=="string"){a.on("close",(function(){r.end()}));a.pipe(r)}else{r.end()}}getAgent(e){const a=new URL(e);return this._getAgent(a)}_prepareRequest(e,a,p){const t={};t.parsedUrl=a;const r=t.parsedUrl.protocol==="https:";t.httpModule=r?o:i;const d=r?443:80;t.options={};t.options.host=t.parsedUrl.hostname;t.options.port=t.parsedUrl.port?parseInt(t.parsedUrl.port):d;t.options.path=(t.parsedUrl.pathname||"")+(t.parsedUrl.search||"");t.options.method=e;t.options.headers=this._mergeHeaders(p);if(this.userAgent!=null){t.options.headers["user-agent"]=this.userAgent}t.options.agent=this._getAgent(t.parsedUrl);if(this.handlers){for(const e of this.handlers){e.prepareRequest(t.options)}}return t}_mergeHeaders(e){if(this.requestOptions&&this.requestOptions.headers){return Object.assign({},lowercaseKeys(this.requestOptions.headers),lowercaseKeys(e||{}))}return lowercaseKeys(e||{})}_getExistingOrDefaultHeader(e,a,p){let t;if(this.requestOptions&&this.requestOptions.headers){t=lowercaseKeys(this.requestOptions.headers)[a]}return e[a]||t||p}_getAgent(e){let a;const p=n.getProxyUrl(e);const t=p&&p.hostname;if(this._keepAlive&&t){a=this._proxyAgent}if(this._keepAlive&&!t){a=this._agent}if(a){return a}const r=e.protocol==="https:";let d=100;if(this.requestOptions){d=this.requestOptions.maxSockets||i.globalAgent.maxSockets}if(p&&p.hostname){const e={maxSockets:d,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(p.username||p.password)&&{proxyAuth:`${p.username}:${p.password}`}),{host:p.hostname,port:p.port})};let t;const s=p.protocol==="https:";if(r){t=s?l.httpsOverHttps:l.httpsOverHttp}else{t=s?l.httpOverHttps:l.httpOverHttp}a=t(e);this._proxyAgent=a}if(this._keepAlive&&!a){const e={keepAlive:this._keepAlive,maxSockets:d};a=r?new o.Agent(e):new i.Agent(e);this._agent=a}if(!a){a=r?o.globalAgent:i.globalAgent}if(r&&this._ignoreSslError){a.options=Object.assign(a.options||{},{rejectUnauthorized:false})}return a}_performExponentialBackoff(e){return s(this,void 0,void 0,(function*(){e=Math.min(w,e);const a=_*Math.pow(2,e);return new Promise((e=>setTimeout((()=>e()),a)))}))}_processResponse(e,a){return s(this,void 0,void 0,(function*(){return new Promise(((p,t)=>s(this,void 0,void 0,(function*(){const r=e.message.statusCode||0;const d={statusCode:r,result:null,headers:{}};if(r===m.NotFound){p(d)}function dateTimeDeserializer(e,a){if(typeof a==="string"){const e=new Date(a);if(!isNaN(e.valueOf())){return e}}return a}let s;let i;try{i=yield e.readBody();if(i&&i.length>0){if(a&&a.deserializeDates){s=JSON.parse(i,dateTimeDeserializer)}else{s=JSON.parse(i)}d.result=s}d.headers=e.message.headers}catch(e){}if(r>299){let e;if(s&&s.message){e=s.message}else if(i&&i.length>0){e=i}else{e=`Failed request: (${r})`}const a=new HttpClientError(e,r);a.result=d.result;t(a)}else{p(d)}}))))}))}}a.HttpClient=HttpClient;const lowercaseKeys=e=>Object.keys(e).reduce(((a,p)=>(a[p.toLowerCase()]=e[p],a)),{})},9835:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:true});a.checkBypass=a.getProxyUrl=void 0;function getProxyUrl(e){const a=e.protocol==="https:";if(checkBypass(e)){return undefined}const p=(()=>{if(a){return process.env["https_proxy"]||process.env["HTTPS_PROXY"]}else{return process.env["http_proxy"]||process.env["HTTP_PROXY"]}})();if(p){return new URL(p)}else{return undefined}}a.getProxyUrl=getProxyUrl;function checkBypass(e){if(!e.hostname){return false}const a=e.hostname;if(isLoopbackAddress(a)){return true}const p=process.env["no_proxy"]||process.env["NO_PROXY"]||"";if(!p){return false}let t;if(e.port){t=Number(e.port)}else if(e.protocol==="http:"){t=80}else if(e.protocol==="https:"){t=443}const r=[e.hostname.toUpperCase()];if(typeof t==="number"){r.push(`${r[0]}:${t}`)}for(const e of p.split(",").map((e=>e.trim().toUpperCase())).filter((e=>e))){if(e==="*"||r.some((a=>a===e||a.endsWith(`.${e}`)||e.startsWith(".")&&a.endsWith(`${e}`)))){return true}}return false}a.checkBypass=checkBypass;function isLoopbackAddress(e){const a=e.toLowerCase();return a==="localhost"||a.startsWith("127.")||a.startsWith("[::1]")||a.startsWith("[0:0:0:0:0:0:0:1]")}},334:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:true});const p=/^v1\./;const t=/^ghs_/;const r=/^ghu_/;async function auth(e){const a=e.split(/\./).length===3;const d=p.test(e)||t.test(e);const s=r.test(e);const i=a?"app":d?"installation":s?"user-to-server":"oauth";return{type:"token",token:e,tokenType:i}}function withAuthorizationPrefix(e){if(e.split(/\./).length===3){return`bearer ${e}`}return`token ${e}`}async function hook(e,a,p,t){const r=a.endpoint.merge(p,t);r.headers.authorization=withAuthorizationPrefix(e);return a(r)}const d=function createTokenAuth(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)})};a.createTokenAuth=d},6762:(e,a,p)=>{"use strict";Object.defineProperty(a,"__esModule",{value:true});var t=p(5030);var r=p(3682);var d=p(6234);var s=p(8467);var i=p(334);function _objectWithoutPropertiesLoose(e,a){if(e==null)return{};var p={};var t=Object.keys(e);var r,d;for(d=0;d=0)continue;p[r]=e[r]}return p}function _objectWithoutProperties(e,a){if(e==null)return{};var p=_objectWithoutPropertiesLoose(e,a);var t,r;if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(e);for(r=0;r=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,t))continue;p[t]=e[t]}}return p}const o="3.6.0";const n=["authStrategy"];class Octokit{constructor(e={}){const a=new r.Collection;const p={baseUrl:d.request.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},e.request,{hook:a.bind(null,"request")}),mediaType:{previews:[],format:""}};p.headers["user-agent"]=[e.userAgent,`octokit-core.js/${o} ${t.getUserAgent()}`].filter(Boolean).join(" ");if(e.baseUrl){p.baseUrl=e.baseUrl}if(e.previews){p.mediaType.previews=e.previews}if(e.timeZone){p.headers["time-zone"]=e.timeZone}this.request=d.request.defaults(p);this.graphql=s.withCustomRequest(this.request).defaults(p);this.log=Object.assign({debug:()=>{},info:()=>{},warn:console.warn.bind(console),error:console.error.bind(console)},e.log);this.hook=a;if(!e.authStrategy){if(!e.auth){this.auth=async()=>({type:"unauthenticated"})}else{const p=i.createTokenAuth(e.auth);a.wrap("request",p.hook);this.auth=p}}else{const{authStrategy:p}=e,t=_objectWithoutProperties(e,n);const r=p(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:t},e.auth));a.wrap("request",r.hook);this.auth=r}const l=this.constructor;l.plugins.forEach((a=>{Object.assign(this,a(this,e))}))}static defaults(e){const a=class extends(this){constructor(...a){const p=a[0]||{};if(typeof e==="function"){super(e(p));return}super(Object.assign({},e,p,p.userAgent&&e.userAgent?{userAgent:`${p.userAgent} ${e.userAgent}`}:null))}};return a}static plugin(...e){var a;const p=this.plugins;const t=(a=class extends(this){},a.plugins=p.concat(e.filter((e=>!p.includes(e)))),a);return t}}Octokit.VERSION=o;Octokit.plugins=[];a.Octokit=Octokit},9440:(e,a,p)=>{"use strict";Object.defineProperty(a,"__esModule",{value:true});var t=p(3287);var r=p(5030);function lowercaseKeys(e){if(!e){return{}}return Object.keys(e).reduce(((a,p)=>{a[p.toLowerCase()]=e[p];return a}),{})}function mergeDeep(e,a){const p=Object.assign({},e);Object.keys(a).forEach((r=>{if(t.isPlainObject(a[r])){if(!(r in e))Object.assign(p,{[r]:a[r]});else p[r]=mergeDeep(e[r],a[r])}else{Object.assign(p,{[r]:a[r]})}}));return p}function removeUndefinedProperties(e){for(const a in e){if(e[a]===undefined){delete e[a]}}return e}function merge(e,a,p){if(typeof a==="string"){let[e,t]=a.split(" ");p=Object.assign(t?{method:e,url:t}:{url:e},p)}else{p=Object.assign({},a)}p.headers=lowercaseKeys(p.headers);removeUndefinedProperties(p);removeUndefinedProperties(p.headers);const t=mergeDeep(e||{},p);if(e&&e.mediaType.previews.length){t.mediaType.previews=e.mediaType.previews.filter((e=>!t.mediaType.previews.includes(e))).concat(t.mediaType.previews)}t.mediaType.previews=t.mediaType.previews.map((e=>e.replace(/-preview/,"")));return t}function addQueryParameters(e,a){const p=/\?/.test(e)?"&":"?";const t=Object.keys(a);if(t.length===0){return e}return e+p+t.map((e=>{if(e==="q"){return"q="+a.q.split("+").map(encodeURIComponent).join("+")}return`${e}=${encodeURIComponent(a[e])}`})).join("&")}const d=/\{[^}]+\}/g;function removeNonChars(e){return e.replace(/^\W+|\W+$/g,"").split(/,/)}function extractUrlVariableNames(e){const a=e.match(d);if(!a){return[]}return a.map(removeNonChars).reduce(((e,a)=>e.concat(a)),[])}function omit(e,a){return Object.keys(e).filter((e=>!a.includes(e))).reduce(((a,p)=>{a[p]=e[p];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,a,p){a=e==="+"||e==="#"?encodeReserved(a):encodeUnreserved(a);if(p){return encodeUnreserved(p)+"="+a}else{return a}}function isDefined(e){return e!==undefined&&e!==null}function isKeyOperator(e){return e===";"||e==="&"||e==="?"}function getValues(e,a,p,t){var r=e[p],d=[];if(isDefined(r)&&r!==""){if(typeof r==="string"||typeof r==="number"||typeof r==="boolean"){r=r.toString();if(t&&t!=="*"){r=r.substring(0,parseInt(t,10))}d.push(encodeValue(a,r,isKeyOperator(a)?p:""))}else{if(t==="*"){if(Array.isArray(r)){r.filter(isDefined).forEach((function(e){d.push(encodeValue(a,e,isKeyOperator(a)?p:""))}))}else{Object.keys(r).forEach((function(e){if(isDefined(r[e])){d.push(encodeValue(a,r[e],e))}}))}}else{const e=[];if(Array.isArray(r)){r.filter(isDefined).forEach((function(p){e.push(encodeValue(a,p))}))}else{Object.keys(r).forEach((function(p){if(isDefined(r[p])){e.push(encodeUnreserved(p));e.push(encodeValue(a,r[p].toString()))}}))}if(isKeyOperator(a)){d.push(encodeUnreserved(p)+"="+e.join(","))}else if(e.length!==0){d.push(e.join(","))}}}}else{if(a===";"){if(isDefined(r)){d.push(encodeUnreserved(p))}}else if(r===""&&(a==="&"||a==="?")){d.push(encodeUnreserved(p)+"=")}else if(r===""){d.push("")}}return d}function parseUrl(e){return{expand:expand.bind(null,e)}}function expand(e,a){var p=["+","#",".","/",";","?","&"];return e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,(function(e,t,r){if(t){let e="";const r=[];if(p.indexOf(t.charAt(0))!==-1){e=t.charAt(0);t=t.substr(1)}t.split(/,/g).forEach((function(p){var t=/([^:\*]*)(?::(\d+)|(\*))?/.exec(p);r.push(getValues(a,e,t[1],t[2]||t[3]))}));if(e&&e!=="+"){var d=",";if(e==="?"){d="&"}else if(e!=="#"){d=e}return(r.length!==0?e:"")+r.join(d)}else{return r.join(",")}}else{return encodeReserved(r)}}))}function parse(e){let a=e.method.toUpperCase();let p=(e.url||"/").replace(/:([a-z]\w+)/g,"{$1}");let t=Object.assign({},e.headers);let r;let d=omit(e,["method","baseUrl","url","headers","request","mediaType"]);const s=extractUrlVariableNames(p);p=parseUrl(p).expand(d);if(!/^http/.test(p)){p=e.baseUrl+p}const i=Object.keys(e).filter((e=>s.includes(e))).concat("baseUrl");const o=omit(d,i);const n=/application\/octet-stream/i.test(t.accept);if(!n){if(e.mediaType.format){t.accept=t.accept.split(/,/).map((a=>a.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${e.mediaType.format}`))).join(",")}if(e.mediaType.previews.length){const a=t.accept.match(/[\w-]+(?=-preview)/g)||[];t.accept=a.concat(e.mediaType.previews).map((a=>{const p=e.mediaType.format?`.${e.mediaType.format}`:"+json";return`application/vnd.github.${a}-preview${p}`})).join(",")}}if(["GET","HEAD"].includes(a)){p=addQueryParameters(p,o)}else{if("data"in o){r=o.data}else{if(Object.keys(o).length){r=o}else{t["content-length"]=0}}}if(!t["content-type"]&&typeof r!=="undefined"){t["content-type"]="application/json; charset=utf-8"}if(["PATCH","PUT"].includes(a)&&typeof r==="undefined"){r=""}return Object.assign({method:a,url:p,headers:t},typeof r!=="undefined"?{body:r}:null,e.request?{request:e.request}:null)}function endpointWithDefaults(e,a,p){return parse(merge(e,a,p))}function withDefaults(e,a){const p=merge(e,a);const t=endpointWithDefaults.bind(null,p);return Object.assign(t,{DEFAULTS:p,defaults:withDefaults.bind(null,p),merge:merge.bind(null,p),parse:parse})}const s="6.0.12";const i=`octokit-endpoint.js/${s} ${r.getUserAgent()}`;const o={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":i},mediaType:{format:"",previews:[]}};const n=withDefaults(null,o);a.endpoint=n},8467:(e,a,p)=>{"use strict";Object.defineProperty(a,"__esModule",{value:true});var t=p(6234);var r=p(5030);const d="4.8.0";function _buildMessageForResponseErrors(e){return`Request failed due to following response errors:\n`+e.errors.map((e=>` - ${e.message}`)).join("\n")}class GraphqlResponseError extends Error{constructor(e,a,p){super(_buildMessageForResponseErrors(p));this.request=e;this.headers=a;this.response=p;this.name="GraphqlResponseError";this.errors=p.errors;this.data=p.data;if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}}}const s=["method","baseUrl","url","headers","request","query","mediaType"];const i=["query","method","url"];const o=/\/api\/v3\/?$/;function graphql(e,a,p){if(p){if(typeof a==="string"&&"query"in p){return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`))}for(const e in p){if(!i.includes(e))continue;return Promise.reject(new Error(`[@octokit/graphql] "${e}" cannot be used as variable name`))}}const t=typeof a==="string"?Object.assign({query:a},p):a;const r=Object.keys(t).reduce(((e,a)=>{if(s.includes(a)){e[a]=t[a];return e}if(!e.variables){e.variables={}}e.variables[a]=t[a];return e}),{});const d=t.baseUrl||e.endpoint.DEFAULTS.baseUrl;if(o.test(d)){r.url=d.replace(o,"/api/graphql")}return e(r).then((e=>{if(e.data.errors){const a={};for(const p of Object.keys(e.headers)){a[p]=e.headers[p]}throw new GraphqlResponseError(r,a,e.data)}return e.data.data}))}function withDefaults(e,a){const p=e.defaults(a);const newApi=(e,a)=>graphql(p,e,a);return Object.assign(newApi,{defaults:withDefaults.bind(null,p),endpoint:t.request.endpoint})}const n=withDefaults(t.request,{headers:{"user-agent":`octokit-graphql.js/${d} ${r.getUserAgent()}`},method:"POST",url:"/graphql"});function withCustomRequest(e){return withDefaults(e,{method:"POST",url:"/graphql"})}a.GraphqlResponseError=GraphqlResponseError;a.graphql=n;a.withCustomRequest=withCustomRequest},4193:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:true});const p="2.21.3";function ownKeys(e,a){var p=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),p.push.apply(p,t)}return p}function _objectSpread2(e){for(var a=1;a({async next(){if(!i)return{done:true};try{const e=await r({method:d,url:i,headers:s});const a=normalizePaginatedListResponse(e);i=((a.headers.link||"").match(/<([^>]+)>;\s*rel="next"/)||[])[1];return{value:a}}catch(e){if(e.status!==409)throw e;i="";return{value:{status:200,headers:{},data:[]}}}}})}}function paginate(e,a,p,t){if(typeof p==="function"){t=p;p=undefined}return gather(e,[],iterator(e,a,p)[Symbol.asyncIterator](),t)}function gather(e,a,p,t){return p.next().then((r=>{if(r.done){return a}let d=false;function done(){d=true}a=a.concat(t?t(r.value,done):r.value.data);if(d){return a}return gather(e,a,p,t)}))}const t=Object.assign(paginate,{iterator:iterator});const r=["GET /app/hook/deliveries","GET /app/installations","GET /applications/grants","GET /authorizations","GET /enterprises/{enterprise}/actions/permissions/organizations","GET /enterprises/{enterprise}/actions/runner-groups","GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations","GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners","GET /enterprises/{enterprise}/actions/runners","GET /enterprises/{enterprise}/audit-log","GET /enterprises/{enterprise}/secret-scanning/alerts","GET /enterprises/{enterprise}/settings/billing/advanced-security","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 /orgs/{org}/actions/cache/usage-by-repository","GET /orgs/{org}/actions/permissions/repositories","GET /orgs/{org}/actions/runner-groups","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}/audit-log","GET /orgs/{org}/blocks","GET /orgs/{org}/code-scanning/alerts","GET /orgs/{org}/codespaces","GET /orgs/{org}/credential-authorizations","GET /orgs/{org}/dependabot/secrets","GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories","GET /orgs/{org}/events","GET /orgs/{org}/external-groups","GET /orgs/{org}/failed_invitations","GET /orgs/{org}/hooks","GET /orgs/{org}/hooks/{hook_id}/deliveries","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}/migrations","GET /orgs/{org}/migrations/{migration_id}/repositories","GET /orgs/{org}/outside_collaborators","GET /orgs/{org}/packages","GET /orgs/{org}/packages/{package_type}/{package_name}/versions","GET /orgs/{org}/projects","GET /orgs/{org}/public_members","GET /orgs/{org}/repos","GET /orgs/{org}/secret-scanning/alerts","GET /orgs/{org}/settings/billing/advanced-security","GET /orgs/{org}/team-sync/groups","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/columns/{column_id}/cards","GET /projects/{project_id}/collaborators","GET /projects/{project_id}/columns","GET /repos/{owner}/{repo}/actions/artifacts","GET /repos/{owner}/{repo}/actions/caches","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/workflows","GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs","GET /repos/{owner}/{repo}/assignees","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}/contributors","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}/events","GET /repos/{owner}/{repo}/forks","GET /repos/{owner}/{repo}/git/matching-refs/{ref}","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}/events","GET /repos/{owner}/{repo}/issues/{issue_number}/labels","GET /repos/{owner}/{repo}/issues/{issue_number}/reactions","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}/requested_reviewers","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}/secret-scanning/alerts","GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations","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 /repositories/{repository_id}/environments/{environment_name}/secrets","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/starred","GET /user/subscriptions","GET /user/teams","GET /users","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}/received_events","GET /users/{username}/received_events/public","GET /users/{username}/repos","GET /users/{username}/starred","GET /users/{username}/subscriptions"];function isPaginatingEndpoint(e){if(typeof e==="string"){return r.includes(e)}else{return false}}function paginateRest(e){return{paginate:Object.assign(paginate.bind(null,e),{iterator:iterator.bind(null,e)})}}paginateRest.VERSION=p;a.composePaginateRest=t;a.isPaginatingEndpoint=isPaginatingEndpoint;a.paginateRest=paginateRest;a.paginatingEndpoints=r},3044:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:true});function ownKeys(e,a){var p=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);if(a){t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))}p.push.apply(p,t)}return p}function _objectSpread2(e){for(var a=1;a{"use strict";Object.defineProperty(a,"__esModule",{value:true});function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var t=p(8932);var r=_interopDefault(p(1223));const d=r((e=>console.warn(e)));const s=r((e=>console.warn(e)));class RequestError extends Error{constructor(e,a,p){super(e);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}this.name="HttpError";this.status=a;let r;if("headers"in p&&typeof p.headers!=="undefined"){r=p.headers}if("response"in p){this.response=p.response;r=p.response.headers}const i=Object.assign({},p.request);if(p.request.headers.authorization){i.headers=Object.assign({},p.request.headers,{authorization:p.request.headers.authorization.replace(/ .*$/," [REDACTED]")})}i.url=i.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]");this.request=i;Object.defineProperty(this,"code",{get(){d(new t.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));return a}});Object.defineProperty(this,"headers",{get(){s(new t.Deprecation("[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`."));return r||{}}})}}a.RequestError=RequestError},6234:(e,a,p)=>{"use strict";Object.defineProperty(a,"__esModule",{value:true});function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var t=p(9440);var r=p(5030);var d=p(3287);var s=_interopDefault(p(467));var i=p(537);const o="5.6.3";function getBufferResponse(e){return e.arrayBuffer()}function fetchWrapper(e){const a=e.request&&e.request.log?e.request.log:console;if(d.isPlainObject(e.body)||Array.isArray(e.body)){e.body=JSON.stringify(e.body)}let p={};let t;let r;const o=e.request&&e.request.fetch||s;return o(e.url,Object.assign({method:e.method,body:e.body,headers:e.headers,redirect:e.redirect},e.request)).then((async d=>{r=d.url;t=d.status;for(const e of d.headers){p[e[0]]=e[1]}if("deprecation"in p){const t=p.link&&p.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 ${p.sunset}${r?`. See ${r}`:""}`)}if(t===204||t===205){return}if(e.method==="HEAD"){if(t<400){return}throw new i.RequestError(d.statusText,t,{response:{url:r,status:t,headers:p,data:undefined},request:e})}if(t===304){throw new i.RequestError("Not modified",t,{response:{url:r,status:t,headers:p,data:await getResponseData(d)},request:e})}if(t>=400){const a=await getResponseData(d);const s=new i.RequestError(toErrorMessage(a),t,{response:{url:r,status:t,headers:p,data:a},request:e});throw s}return getResponseData(d)})).then((e=>({status:t,url:r,headers:p,data:e}))).catch((a=>{if(a instanceof i.RequestError)throw a;throw new i.RequestError(a.message,500,{request:e})}))}async function getResponseData(e){const a=e.headers.get("content-type");if(/application\/json/.test(a)){return e.json()}if(!a||/^text\/|charset=utf-8$/.test(a)){return e.text()}return getBufferResponse(e)}function toErrorMessage(e){if(typeof e==="string")return e;if("message"in e){if(Array.isArray(e.errors)){return`${e.message}: ${e.errors.map(JSON.stringify).join(", ")}`}return e.message}return`Unknown error: ${JSON.stringify(e)}`}function withDefaults(e,a){const p=e.defaults(a);const newApi=function(e,a){const t=p.merge(e,a);if(!t.request||!t.request.hook){return fetchWrapper(p.parse(t))}const request=(e,a)=>fetchWrapper(p.parse(p.merge(e,a)));Object.assign(request,{endpoint:p,defaults:withDefaults.bind(null,p)});return t.request.hook(request,t)};return Object.assign(newApi,{endpoint:p,defaults:withDefaults.bind(null,p)})}const n=withDefaults(t.endpoint,{headers:{"user-agent":`octokit-request.js/${o} ${r.getUserAgent()}`}});a.request=n},3682:(e,a,p)=>{var t=p(4670);var r=p(5549);var d=p(6819);var s=Function.bind;var i=s.bind(s);function bindApi(e,a,p){var t=i(d,null).apply(null,p?[a,p]:[a]);e.api={remove:t};e.remove=t;["before","error","after","wrap"].forEach((function(t){var d=p?[a,t,p]:[a,t];e[t]=e.api[t]=i(r,null).apply(null,d)}))}function HookSingular(){var e="h";var a={registry:{}};var p=t.bind(null,a,e);bindApi(p,a,e);return p}function HookCollection(){var e={registry:{}};var a=t.bind(null,e);bindApi(a,e);return a}var o=false;function Hook(){if(!o){console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4');o=true}return HookCollection()}Hook.Singular=HookSingular.bind();Hook.Collection=HookCollection.bind();e.exports=Hook;e.exports.Hook=Hook;e.exports.Singular=Hook.Singular;e.exports.Collection=Hook.Collection},5549:e=>{e.exports=addHook;function addHook(e,a,p,t){var r=t;if(!e.registry[p]){e.registry[p]=[]}if(a==="before"){t=function(e,a){return Promise.resolve().then(r.bind(null,a)).then(e.bind(null,a))}}if(a==="after"){t=function(e,a){var p;return Promise.resolve().then(e.bind(null,a)).then((function(e){p=e;return r(p,a)})).then((function(){return p}))}}if(a==="error"){t=function(e,a){return Promise.resolve().then(e.bind(null,a)).catch((function(e){return r(e,a)}))}}e.registry[p].push({hook:t,orig:r})}},4670:e=>{e.exports=register;function register(e,a,p,t){if(typeof p!=="function"){throw new Error("method for before hook must be a function")}if(!t){t={}}if(Array.isArray(a)){return a.reverse().reduce((function(a,p){return register.bind(null,e,p,a,t)}),p)()}return Promise.resolve().then((function(){if(!e.registry[a]){return p(t)}return e.registry[a].reduce((function(e,a){return a.hook.bind(null,e,t)}),p)()}))}},6819:e=>{e.exports=removeHook;function removeHook(e,a,p){if(!e.registry[a]){return}var t=e.registry[a].map((function(e){return e.orig})).indexOf(p);if(t===-1){return}e.registry[a].splice(t,1)}},8932:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:true});class Deprecation extends Error{constructor(e){super(e);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}this.name="Deprecation"}}a.Deprecation=Deprecation},3287:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:true}); +(()=>{var __webpack_modules__={9419:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;var r=Object.getOwnPropertyDescriptor(a,p);if(!r||("get"in r?!a.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return a[p]}}}Object.defineProperty(e,t,r)}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.prototype.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:true});a.callKubernetesPathAsync=a.callKubernetesAsync=a.callKubernetesPath=a.callKubernetes=a.callAsync=a.call=a.prepareAWS=a.prepareK8S=void 0;const i=d(p(2186));const o=p(2081);const n=p(7147);const l=p(2037);const m=s(p(1017));const u=p(8990);let c=null;let v=0;function prepareK8S(e){return(0,u.logGroup)("Prepare k8s",(()=>{const a=m.default.join((0,l.homedir)(),".kube");i.info(`mkdir ${a}`);try{(0,n.mkdirSync)(a)}catch(e){i.debug("error"+JSON.stringify(e));if((e===null||e===void 0?void 0:e.code)==="EEXIST"){i.debug(a+" EEXIST")}else throw e}if(e.length>0){i.debug("Get kubeconfig string");const a=Buffer.from(e,"base64").toString("utf8");i.info(`Write kubeconfig to ~/.kube/config`);(0,n.writeFileSync)(m.default.join((0,l.homedir)(),".kube/config"),a)}c=call("which kubectl").split("\n")[0];i.info(`kubectl path: ${c}`)}))}a.prepareK8S=prepareK8S;function prepareAWS(e,a){const p=m.default.join((0,l.homedir)(),".aws");i.info(`mkdir ${p}`);try{(0,n.mkdirSync)(p)}catch(e){i.debug("error"+JSON.stringify(e));if((e===null||e===void 0?void 0:e.code)==="EEXIST"){i.debug(p+" EEXIST")}else throw e}if(e.length>0){i.debug("Get aws credentials string");const a=Buffer.from(e,"base64").toString("utf8");i.info(`Write awsCredentials to ~/.aws/credentials`);(0,n.writeFileSync)(m.default.join((0,l.homedir)(),".aws/credentials"),a)}if(a.length>0){i.debug("Get aws credentials string");const e=Buffer.from(a,"base64").toString("utf8");i.info(`Write awsConfig to ~/.aws/config`);(0,n.writeFileSync)(m.default.join((0,l.homedir)(),".aws/config"),e)}}a.prepareAWS=prepareAWS;function call(e,a=false){const p=++v;!a&&i.info(`Call #${p} command: '${e}'`);const t=(0,o.execSync)(e,{encoding:"utf8",maxBuffer:Infinity,stdio:"pipe"});i.debug(`Call #${p} result ${t}`);return t}a.call=call;function callAsync(e,a=false,p="."){return new Promise(((t,r)=>{const d=++v;!a&&i.info(`Call #${d} command: '${e}' with cwd '${p}'`);const s=(0,o.exec)(e,{encoding:"utf8",maxBuffer:Infinity,cwd:p});if(!s.stdio||!s.stdout||!s.stderr){i.info(`Error in callAsync #${d}: can't spawn process`);throw new Error(`Error in callAsync #${d}: can't spawn process`)}let n="",l="";s.stdout.on("data",(e=>n+=e.toString()));s.stderr.on("data",(e=>l+=e.toString()));s.on("close",(e=>{i.debug(`Call #${d} async code = ${e}`);if(e==0){if(n.length>3e3)i.debug(`Call #${d} async TRUNCATED (full size is ${n.length/1024}kb - showing 3000 symbols) output: \n${n.slice(0,1500)}\n.........\n${n.slice(-1500)}`);else i.debug(`Call #${d} async output \n${n}`);t(n)}else{if(a)i.info(`Call #${d} async with secrets failed - on close`);else i.info(`Call #${d} async failed - on close:\nError: ${l}\nOutput: ${n}`);r(new Error(l))}}));s.on("error",(e=>{if(a)i.info(`Call #${d} async with secrets failed - on error`);else i.info(`Call #${d} async failed - on error:\nError: ${e}\nOutput: ${n}`);r(e)}))}))}a.callAsync=callAsync;function callKubernetes(e){if(c===null)throw new Error("K8s not initialized, call prepareK8S first");return call(`${c} ${e}`)}a.callKubernetes=callKubernetes;function callKubernetesPath(e){if(c===null)throw new Error("K8s not initialized, call prepareK8S first");return call(e(c))}a.callKubernetesPath=callKubernetesPath;function callKubernetesAsync(e){if(c===null)throw new Error("K8s not initialized, call prepareK8S first");return callAsync(`${c} ${e}`)}a.callKubernetesAsync=callKubernetesAsync;function callKubernetesPathAsync(e){if(c===null)throw new Error("K8s not initialized, call prepareK8S first");return callAsync(e(c))}a.callKubernetesPathAsync=callKubernetesPathAsync},843:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;var r=Object.getOwnPropertyDescriptor(a,p);if(!r||("get"in r?!a.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return a[p]}}}Object.defineProperty(e,t,r)}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.prototype.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};var s=this&&this.__awaiter||function(e,a,p,t){function adopt(e){return e instanceof p?e:new p((function(a){a(e)}))}return new(p||(p=Promise))((function(p,r){function fulfilled(e){try{step(t.next(e))}catch(e){r(e)}}function rejected(e){try{step(t["throw"](e))}catch(e){r(e)}}function step(e){e.done?p(e.value):adopt(e.value).then(fulfilled,rejected)}step((t=t.apply(e,a||[])).next())}))};var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:true});a.checkResults=a.checkGraphValues=a.filterGraphData=a.parseRawGraph=a.getDataFromGrafana=a.getUUID=void 0;const o=i(p(6113));const n=d(p(2186));const l=d(p(5438));const m=p(9419);const u=p(4542);function getUUID(){const e=o.default.randomBytes(16).toString("hex");return e.substring(0,8)+"-"+e.substring(8,12)+"-"+e.substring(12,16)+"-"+e.substring(16,20)+"-"+e.substring(20)}a.getUUID=getUUID;function getDataFromGrafana(e,a,p){return s(this,void 0,void 0,(function*(){const t={queries:p.map(((e,a)=>Object.assign(Object.assign({refId:e.refId,expr:e.expr,key:`Q-${getUUID()}-${a}`,interval:e.interval},e.format?{format:e.format}:{}),{datasource:{type:"prometheus",uid:"prometheus"},editorMode:"code",legendFormat:"__auto",range:false,instant:true,exemplar:false,hide:false,queryType:"timeSeriesQuery",utcOffsetSec:14400,datasourceId:1,intervalMs:5e3,maxDataPoints:1514}))),range:{from:e.toISOString(),to:a.toISOString(),raw:{from:e.toISOString(),to:a.toISOString()}},from:""+e.valueOf(),to:""+a.valueOf()};let r=t.queries.reduce(((e,a)=>e+=a.key),"");t.queries=t.queries.map((e=>Object.assign({requestId:`${r}${e.refId}`},e)));let d=`wget -q -O- --header='content-type: application/json' --post-data='${JSON.stringify(t)}' 'http://grafana/api/ds/query' | base64`;d=d.replace(/'/g,"'\\''");n.debug(`getDataFromGrafana kube request:\nkubectl run -q -i --image=busybox --rm grafana-result-peeker --restart=Never -- sh -c '${d}'`);return Buffer.from(yield(0,m.callKubernetesPathAsync)((e=>`${e} run -q -i --image=busybox --rm grafana-result-peeker-${Math.ceil(Math.random()*1e3%1e3)} --restart=Never -- sh -c '${d}'`)),"base64").toString("utf8")}))}a.getDataFromGrafana=getDataFromGrafana;function parseRawGraph(e){const a=JSON.parse(e);n.debug("Parsed JSON graph data "+JSON.stringify(a));const p=Object.keys(a.results);n.debug("Process graph data");return p.reduce(((e,p)=>{e[p]=a.results[p].frames.map((e=>{var a,p,t,r,d,s;return{value:(t=(p=(a=e===null||e===void 0?void 0:e.data)===null||a===void 0?void 0:a.values)===null||p===void 0?void 0:p[1])===null||t===void 0?void 0:t[0],labels:(s=(d=(r=e===null||e===void 0?void 0:e.schema)===null||r===void 0?void 0:r.fields)===null||d===void 0?void 0:d[1])===null||s===void 0?void 0:s.labels}}));return e}),{})}a.parseRawGraph=parseRawGraph;function filterGraphData(e){return function filterGraphFun(a){return Object.entries(e).reduce(((e,p)=>e&&a.labels[p[0]]===p[1]),true)}}a.filterGraphData=filterGraphData;function checkGraphValues(e,a,p){let t=[];for(const r of Object.keys(p)){const d=a[r];const s=p[r];n.debug(`Check query '${r}': result: ${JSON.stringify(d)}; desired result:${JSON.stringify(s)}`);for(const a of s){const p=Object.assign({job:`workload-${e}`},a.filter);let s=(d||[]).filter(filterGraphData(p));n.debug(`Apply filter '${JSON.stringify(p)}': ${JSON.stringify(s)}`);const i=`${r}${JSON.stringify(p)}`;const o=`slo-${i.replace(/[{":}\[\]]/g,"-")}`;if(s.length===0){n.debug(`Not found results by filter to inspect`);t.push([o,"notfound",i,`Not found results by filter to inspect`])}else{n.debug(`Found results by filter to inspect: ${JSON.stringify(Object.entries(s))}`);for(const[e,p]of Object.entries(s)){const r=a.value[0]===">"?p.value>a.value[1]:p.value0",interval:"1s"},{refId:"max_99_latency",expr:'max_over_time(latency{quantile="0.99"}[$__range])>0',interval:""},{refId:"fail_interval",expr:"sum_over_time(clamp(irate(not_oks[2s])*2, 0, 1)[$__range:1s])>0",interval:"1s"}];const i=yield(0,u.retry)(2,(()=>s(this,void 0,void 0,(function*(){const e=yield getDataFromGrafana(p,t,d);n.debug("graphsRaw: "+e);return parseRawGraph(e)}))));n.debug("parsed: "+JSON.stringify(i));const o=checkGraphValues(a,i,r);n.info("checks: "+JSON.stringify(o));let m=false;let c="SLO check failed: ";for(let a=0;ae[1]=="error")).length>0}))}a.checkResults=checkResults},3179:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;var r=Object.getOwnPropertyDescriptor(a,p);if(!r||("get"in r?!a.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return a[p]}}}Object.defineProperty(e,t,r)}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.prototype.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};var s=this&&this.__awaiter||function(e,a,p,t){function adopt(e){return e instanceof p?e:new p((function(a){a(e)}))}return new(p||(p=Promise))((function(p,r){function fulfilled(e){try{step(t.next(e))}catch(e){r(e)}}function rejected(e){try{step(t["throw"](e))}catch(e){r(e)}}function step(e){e.done?p(e.value):adopt(e.value).then(fulfilled,rejected)}step((t=t.apply(e,a||[])).next())}))};var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:true});a.deleteCluster=a.getYdbVersions=a.createCluster=void 0;const o=d(p(2186));const n=p(8990);const l=p(9419);const m=i(p(1542));const u=p(5476);let c=m.default["k8s/ci/database.yaml"].content;let v=m.default["k8s/ci/storage.yaml"].content;function createCluster(e="23.1.19",a,p=10){return s(this,void 0,void 0,(function*(){return(0,n.logGroup)("Create cluster",(()=>s(this,void 0,void 0,(function*(){c=c.replace("${{VERSION}}",e);v=v.replace("${{VERSION}}",e);o.debug("database manifest:\n\n"+c);o.debug("storage manifest:\n\n"+v);o.info("Apply database and storage manifests");o.info("storage apply result:\n"+(0,l.callKubernetesPath)((e=>`${e} apply -f - <`${e} apply -f - <s(this,void 0,void 0,(function*(){o.debug("check status of cluster");const e=getStatus("database");const a=getStatus("storage");o.debug(`Current status of cluster: database - ${e}, storage - ${a}`);if(e!==t){o.info(`Database become '${e}', storage is '${a}'`);t=e}if(a!==r){o.info(`Storage become '${a}', database is '${e}'`);r=a}if(e==="Ready"&&a==="Ready")return true;return false}))))}))))}))}a.createCluster=createCluster;function getYdbVersions(){return(0,n.logGroup)("Get versions",(()=>{const e=(0,l.call)("docker run --rm ghcr.io/regclient/regctl:v0.4.8 tag ls cr.yandex/crptqonuodf51kdj7a7d/ydb");const a=e.split("\n").filter((e=>e.length>0));a.sort();return a}))}a.getYdbVersions=getYdbVersions;function getStatus(e){const a=(0,l.callKubernetes)(`get ${e}s.ydb.tech ${e}-sample -ojsonpath={.status}`);return JSON.parse(a).state}function deleteCluster(){return(0,n.logGroup)("Delete cluster",(()=>{o.info("Delete database and storage manifests");try{o.info("Database delete result:\n"+(0,l.callKubernetes)("delete databases.ydb.tech database-sample"))}catch(e){o.info("Error while deleting database"+JSON.stringify(e))}try{o.info("Storage delete result:\n"+(0,l.callKubernetes)("delete storages.ydb.tech storage-sample"))}catch(e){o.info("Error while deleting storage"+JSON.stringify(e))}try{const e=(0,l.callKubernetes)('get pvc -o=jsonpath="{.items[*].metadata.name}" -l ydb-cluster=slo-storage');o.debug("pvcs"+e);o.info("PVC delete result:\n"+(0,l.callKubernetes)(`delete pvc ${e}`))}catch(e){o.info("Error while deleting pvcs"+JSON.stringify(e))}}))}a.deleteCluster=deleteCluster},8995:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;var r=Object.getOwnPropertyDescriptor(a,p);if(!r||("get"in r?!a.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return a[p]}}}Object.defineProperty(e,t,r)}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.prototype.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};var s=this&&this.__awaiter||function(e,a,p,t){function adopt(e){return e instanceof p?e:new p((function(a){a(e)}))}return new(p||(p=Promise))((function(p,r){function fulfilled(e){try{step(t.next(e))}catch(e){r(e)}}function rejected(e){try{step(t["throw"](e))}catch(e){r(e)}}function step(e){e.done?p(e.value):adopt(e.value).then(fulfilled,rejected)}step((t=t.apply(e,a||[])).next())}))};Object.defineProperty(a,"__esModule",{value:true});a.annotate=a.errorScheduler=void 0;const i=d(p(2186));const o=p(9419);let n=null;function errorScheduler(e,a){return s(this,void 0,void 0,(function*(){const p=(yield(0,o.callKubernetesAsync)(`get pods database-sample-0 -o=jsonpath='{.status.podIP}'`)).split("\n")[0];i.info(`Target of the error scheduler (database-sample-0) IP: ${p}`);n=e;i.info(`Grafana pod name: ${n}`);yield new Promise((e=>{setTimeout(e,a*1e3)}));const freezeCmd=e=>`run -it --image=busybox --rm tablet-${e==="0"?"un":""}freezer --restart=Never --`+` sh -c "wget -q -O- '${p}:8765/tablets/app?`+`TabletID=72057594037968897&node=1&page=SetFreeze&freeze=${e}' "`;yield createError("Freeze tablet",freezeCmd("1"),a);yield createError("Unfreeze tablet",freezeCmd("0"),a);yield createError("Delete database pod",`delete pod database-sample-1`,a);yield createError("Force delete database pod",`delete pod database-sample-1 --force=true --grace-period=0`,a);yield createError("Kill database from inside",`exec -it database-sample-0 -- /bin/bash -c "kill -2 1 && echo 'process killed'"`,a)}))}a.errorScheduler=errorScheduler;function createError(e,a,p){return s(this,void 0,void 0,(function*(){return yield Promise.allSettled([(0,o.callKubernetesAsync)(a),annotate(e,i.getInput("grafana_dashboard")||"7CzMl5t4k"),new Promise((e=>{setTimeout(e,p*1e3)}))]).then((e=>{if(e.filter((e=>e.status==="rejected")).length>0)return Promise.reject("Error in YDB error creation")}))}))}function annotate(e,a="7CzMl5t4k"){const p="http://localhost:3000/api/annotations";const createWgetPost=(e,a)=>`wget -qS -O- --header 'Accept: application/json' --header 'Content-Type: application/json' --post-data '${a}' '${e}'`;const t=`{\\"dashboardUID\\":\\"${a}\\", \\"text\\":\\"${e}\\", \\"tags\\":[]}`;return(0,o.callKubernetes)(`exec -it ${n} --container grafana -- /bin/bash -c "${createWgetPost(p,t)}"`)}a.annotate=annotate},8660:function(e,a,p){"use strict";var t=this&&this.__awaiter||function(e,a,p,t){function adopt(e){return e instanceof p?e:new p((function(a){a(e)}))}return new(p||(p=Promise))((function(p,r){function fulfilled(e){try{step(t.next(e))}catch(e){r(e)}}function rejected(e){try{step(t["throw"](e))}catch(e){r(e)}}function step(e){e.done?p(e.value):adopt(e.value).then(fulfilled,rejected)}step((t=t.apply(e,a||[])).next())}))};Object.defineProperty(a,"__esModule",{value:true});a.getInfrastractureEndpoints=void 0;const r=p(9419);const d=p(4542);const s=p(5476);function getInfrastractureEndpoints(){return t(this,void 0,void 0,(function*(){const e=["prometheus-operator","prometheus","prometheus-pushgateway","grafana","grafana-renderer","ydb-operator"];return Promise.allSettled(e.map(getEndpoint)).then((a=>{const p=e.filter(((e,p)=>a[p].status==="rejected"));if(p.length>0){throw new Error(`Not found those required k8s pods: ${p.join(", ")}`)}return{prometheusOperator:a[0].value,prometheus:a[1].value,prometheusPushgateway:a[2].value,grafana:a[3].value,grafanaRenderer:a[4].value,ydbOperator:a[5].value}}))}))}a.getInfrastractureEndpoints=getInfrastractureEndpoints;function getEndpoint(e){return(0,d.retry)(2,(()=>(0,s.withTimeoutSimple)(10,(0,r.callKubernetesAsync)(`get pods -l "app.kubernetes.io/name=${e}" -o jsonpath="{.items[0].metadata.name}"`).then((e=>e.split("\n")[0])))))}},1413:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;var r=Object.getOwnPropertyDescriptor(a,p);if(!r||("get"in r?!a.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return a[p]}}}Object.defineProperty(e,t,r)}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.prototype.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};var s=this&&this.__awaiter||function(e,a,p,t){function adopt(e){return e instanceof p?e:new p((function(a){a(e)}))}return new(p||(p=Promise))((function(p,r){function fulfilled(e){try{step(t.next(e))}catch(e){r(e)}}function rejected(e){try{step(t["throw"](e))}catch(e){r(e)}}function step(e){e.done?p(e.value):adopt(e.value).then(fulfilled,rejected)}step((t=t.apply(e,a||[])).next())}))};var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:true});a.postComment=a.grafanaScreenshot=void 0;const o=i(p(1017));const n=d(p(2186));const l=p(5438);const m=p(9419);const u=p(3292);function grafanaScreenshot(e,a,p,t,r,d="7CzMl5t4k",i=1500,l=1100){return s(this,void 0,void 0,(function*(){n.debug(`grafanaScreenshot(${e}, ${a}, ${p}, ${t}, ${r}, ${d}, ${i}, ${l})`);const s=`http://grafana/render/d/${d.split("/")[0]}/slo?orgId=1&from=${t.valueOf()}&to=${r.valueOf()}&width=${i}&height=${l}&tz=Europe%2FIstanbul&kiosk=tv&var-filter=job|=|workload-${p}`;n.debug("grafana query: "+s);const c=yield n.group("Get base64 image",(()=>(0,m.callKubernetesAsync)(`run -q -i --image=busybox --rm grafana-screenshoter-${p} --restart=Never -- sh -c "wget -q -O- '${s}' | base64"`)));n.debug("grafana imageb64: "+c.slice(0,100)+"...TRUNCATED..."+c.slice(-100));n.debug("Write picture to FS");const v=`${p}-${(new Date).valueOf()}.png`;yield(0,u.writeFile)(v,Buffer.from(c,"base64"));yield(0,m.callAsync)(`aws s3 --endpoint-url=${e} cp ./${v} "s3://${o.default.join(a,v)}"`);yield(0,m.callAsync)(`rm ${v}`);const h="https://"+o.default.join(e.split("//")[1],a,v);n.debug("fullPictureUri: "+h);return`${h}`}))}a.grafanaScreenshot=grafanaScreenshot;function postComment(e,a,p){return s(this,void 0,void 0,(function*(){if(!l.context.payload.pull_request)return;const t=`\x3c!-- slo-test-action "${a}" --\x3e`;const r=yield e.rest.issues.listComments(Object.assign({issue_number:l.context.payload.pull_request.number},l.context.repo));const d=r.data.filter((e=>{var a;return(a=e.body)===null||a===void 0?void 0:a.includes(t)}));if(d.length===0){const r=Object.assign(Object.assign({},l.context.repo),{issue_number:l.context.payload.pull_request.number,comment_id:a,body:p+`\n${t}`});n.debug("Create comment with data:"+JSON.stringify(r));const d=yield e.rest.issues.createComment(r);n.debug("Create comment result:"+JSON.stringify(d))}else{const a=Object.assign(Object.assign({},l.context.repo),{comment_id:d[0].id,body:p+`\n${t}`});n.debug("Update comment with data:"+JSON.stringify(a));const r=yield e.rest.issues.updateComment(a);n.debug("Update comment result:"+JSON.stringify(r))}}))}a.postComment=postComment},3109:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;var r=Object.getOwnPropertyDescriptor(a,p);if(!r||("get"in r?!a.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return a[p]}}}Object.defineProperty(e,t,r)}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.prototype.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};var s=this&&this.__awaiter||function(e,a,p,t){function adopt(e){return e instanceof p?e:new p((function(a){a(e)}))}return new(p||(p=Promise))((function(p,r){function fulfilled(e){try{step(t.next(e))}catch(e){r(e)}}function rejected(e){try{step(t["throw"](e))}catch(e){r(e)}}function step(e){e.done?p(e.value):adopt(e.value).then(fulfilled,rejected)}step((t=t.apply(e,a||[])).next())}))};Object.defineProperty(a,"__esModule",{value:true});const i=d(p(2186));const o=d(p(5438));const n=p(7653);const l=p(9419);const m=p(1762);const u=p(3179);const c=p(6186);const v=p(8660);const h=p(8995);const g=p(4542);const w=p(843);const _=p(1413);const b=p(6113);const T=!!o.context.payload.pull_request;let E=false;let y=false;function main(){return s(this,void 0,void 0,(function*(){try{let{workloads:e,githubToken:a,kubeconfig:p,awsCredentials:t,awsConfig:r,s3Endpoint:d,s3Folder:S,dockerRepo:O,dockerFolder:D,dockerUsername:k,dockerPassword:P,ydbVersion:A,timeBetweenPhases:N,shutdownTime:G,grafanaDomain:R,grafanaDashboard:C,grafanaDashboardWidth:V,grafanaDashboardHeight:U}=(0,n.parseArguments)();i.debug(`Setting up OctoKit`);const F=o.getOctokit(a);(0,l.prepareK8S)(p);(0,l.prepareAWS)(t,r);yield(0,c.dockerLogin)(O,k,P);const j=yield(0,v.getInfrastractureEndpoints)();i.info(`Services pods: ${JSON.stringify(j)}`);i.info("Run SLO tests for: \n"+e.map((e=>{let a=`#${e.id}`;a+=e.name?`(${e.name})\n`:"\n";a+=`path: '${e.path}'\n`;a+=e.buildContext?`build context: '${e.buildContext}'\n`:"";a+=e.buildOptions?`build options: '${e.buildOptions}'\n`:"";return a})).join("==="));const B=e.length>1?e.map((e=>e.id)).join("__+__"):e[0].id;yield(0,m.obtainMutex)(B,Math.ceil(((5+4)*N+G)/60)+1,30);i.info("Mutex obtained!");E=true;const L=e.map((e=>(0,c.generateDockerPath)(O,D,e.id)));i.info("Create cluster and build all workloads");const x=e.map((()=>false));const I=yield Promise.allSettled([(0,u.createCluster)(A,15),...e.map(((e,a)=>(0,c.buildWorkload)(e.id,L[a],e.path,e.buildOptions,e.buildContext).then((()=>{x[a]=true}))))]);const $=I[0].status==="fulfilled"&&x.filter((e=>e)).length>0;i.debug(`builded: [${x.toString()}], continueRun: ${$}`);if(I[0].status==="fulfilled"){y=true}if(x.every((e=>e))){i.info("All workloads builded successfully")}else{if($){x.map(((a,p)=>{if(!a)i.info(`Error in '${e[p].id}' build`);else i.info(`'${e[p].id}' build successful`)}))}else{i.info("No workloads builded!")}}if($){const a=yield Promise.allSettled(e.map(((e,a)=>s(this,void 0,void 0,(function*(){return(0,g.retry)(2,(()=>(0,c.runWorkload)("create",{id:e.id,dockerPath:L[a],timeoutMins:2,args:`--min-partitions-count 6 --max-partitions-count 1000 `+`--partition-size 1 --initial-data-count 1000`})))})))));i.debug("create results: "+JSON.stringify(a));if(a.filter((e=>e.status==="fulfilled")).length===0){throw new Error("No workloads performed `create` action, exit")}else{const a=yield Promise.allSettled([...e.map(((e,a)=>(0,c.runWorkload)("run",{id:e.id,dockerPath:L[a],timeoutMins:Math.ceil(((5+4)*N+G)/60),args:`--time ${(5+2)*N} --shutdown-time ${G} --read-rps 1000 `+`--write-rps 100 --prom-pgw http://prometheus-pushgateway:9091`}))),(0,h.errorScheduler)(j.grafana,N)]);i.debug("run results: "+JSON.stringify(a));if(a.slice(0,e.length).filter((e=>e.status==="fulfilled")).length===0){i.info("No successfull workload runs!");throw new Error("No workloads runs completed successfully")}else{const p={success_rate:[{filter:{},value:[">",.98]}],max_99_latency:[{filter:{status:"ok"},value:["<",100]},{filter:{status:"err"},value:["<",3e4]}],fail_interval:[{filter:{},value:["<",20]}]};let t=[];a.map(((r,o)=>{if(r.status==="fulfilled"&&o!==a.length-1){const a=r.value;t.push((0,w.checkResults)(F,e[o].id,a.startTime,a.endTime,p));i.debug("isPullRequest="+T);if(T){i.debug("Push to promises grafana screenshot and postComment");t.push((()=>s(this,void 0,void 0,(function*(){var p;const t=yield(0,_.grafanaScreenshot)(d,S,e[o].id,a.startTime,a.endTime,C,V,U);const r=`\n:volcano: Here are results of SLO test for **${(p=e[o].name)!==null&&p!==void 0?p:e[o].id}**:\n\n[Grafana Dashboard](${R}/d/${C}?orgId=1&from=${a.startTime.valueOf()}&to=${a.endTime.valueOf()})\n\n![SLO-${e[o].id}](${t})\n`;yield(0,_.postComment)(F,(0,b.createHash)("sha1").update(e[o].id).digest().readUint16BE(),r)})))())}}}));const r=yield Promise.allSettled(t);i.info("checkResults and grafana screenshot result: "+JSON.stringify(r))}}}(0,u.deleteCluster)();(0,m.releaseMutex)()}catch(e){if(e instanceof Error)i.setFailed(e.message);if(y){try{(0,u.deleteCluster)()}catch(e){i.info("Failed to delete cluster:"+JSON.stringify(e))}}if(E){try{(0,m.releaseMutex)()}catch(e){i.info("Failed to release mutex:"+JSON.stringify(e))}}}}))}i.info("Main SLO action");main()},1762:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;var r=Object.getOwnPropertyDescriptor(a,p);if(!r||("get"in r?!a.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return a[p]}}}Object.defineProperty(e,t,r)}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.prototype.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};var s=this&&this.__awaiter||function(e,a,p,t){function adopt(e){return e instanceof p?e:new p((function(a){a(e)}))}return new(p||(p=Promise))((function(p,r){function fulfilled(e){try{step(t.next(e))}catch(e){r(e)}}function rejected(e){try{step(t["throw"](e))}catch(e){r(e)}}function step(e){e.done?p(e.value):adopt(e.value).then(fulfilled,rejected)}step((t=t.apply(e,a||[])).next())}))};Object.defineProperty(a,"__esModule",{value:true});a.releaseMutex=a.obtainMutex=a.setBusy=a.isBusy=void 0;const i=d(p(2186));const o=p(9419);const n=p(8990);const l=p(5476);function isBusy(e){var a,p,t,r,d;i.debug(`isBusy(${e})`);const s=(0,o.callKubernetes)(`get configmaps ${e} -ojson`);i.debug("isBusy result: "+s);const n=JSON.parse(s);i.debug("configmap parsed: "+JSON.stringify(n));if(((a=n===null||n===void 0?void 0:n.data)===null||a===void 0?void 0:a.busy)!==undefined&&typeof((p=n===null||n===void 0?void 0:n.data)===null||p===void 0?void 0:p.lockedTill)==="string"&&parseInt(n.data.lockedTill)>=Date.now()){i.info(`Mutex locked by ${(t=n===null||n===void 0?void 0:n.data)===null||t===void 0?void 0:t.lockedBy} till ${new Date(parseInt((r=n===null||n===void 0?void 0:n.data)===null||r===void 0?void 0:r.lockedTill))}`);return(d=n===null||n===void 0?void 0:n.data)===null||d===void 0?void 0:d.lockedBy}return false}a.isBusy=isBusy;function setBusy(e,a){i.debug(`setBusy(${e})`);(0,o.callKubernetesPath)((p=>`${p} create configmap slo-mutex --from-literal=busy=true --from-literal=lockedBy=${e} --from-literal=lockedTill=${Date.now()+a*6e4} -o=yaml --dry-run=client | ${p} apply -f -`))}a.setBusy=setBusy;function obtainMutex(e,a,p,t=20){return(0,n.logGroup)("Obtain mutex",(()=>s(this,void 0,void 0,(function*(){return(0,l.withTimeout)(p,t,"Obtain mutex",(()=>{const p=isBusy("slo-mutex");if(typeof p==="boolean"&&!p){i.debug("Set mutex");setBusy(e,a);i.info("Mutex obtained");i.debug("Mutex sleep 5s");(0,o.call)("sleep 5");i.debug("Re-check after sleep");const p=isBusy("slo-mutex");if(p!==e){i.info("Mutex is not obtained!");return false}return true}return false}))}))))}a.obtainMutex=obtainMutex;function releaseMutex(){return(0,n.logGroup)("Release mutex",(()=>{(0,o.callKubernetesPath)((e=>`${e} create configmap slo-mutex -o=yaml --dry-run=client | ${e} apply -f -`))}))}a.releaseMutex=releaseMutex},7653:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;var r=Object.getOwnPropertyDescriptor(a,p);if(!r||("get"in r?!a.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return a[p]}}}Object.defineProperty(e,t,r)}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.prototype.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};Object.defineProperty(a,"__esModule",{value:true});a.parseArguments=void 0;const s=d(p(2186));const i=p(8990);const o=p(3179);function parseArguments(){return(0,i.logGroup)("Parse arguments",(()=>{let e=[];let a=-1,p=true;do{const t=getWorkloadParam(a);if(null===t){if(a!==-1)p=false}else{e.push(t)}a++}while(p);const t=s.getInput("GITHUB_TOKEN");const r=s.getInput("KUBECONFIG_B64");const d=s.getInput("DOCKER_REPO");const i=s.getInput("DOCKER_FOLDER");const n=s.getInput("DOCKER_USERNAME");const l=s.getInput("DOCKER_PASSWORD");const m=s.getInput("AWS_CREDENTIALS_B64");const u=s.getInput("AWS_CONFIG_B64");const c=s.getInput("s3_endpoint");const v=s.getInput("s3_images_folder");const h=s.getInput("grafana_domain");const g=s.getInput("grafana_dashboard")||"7CzMl5t4k";const w=Number(s.getInput("grafana_dashboard_width")||"1500");const _=Number(s.getInput("grafana_dashboard_height")||"1700");let b=s.getInput("ydb_version");const T=Number(s.getInput("time_between_phases")||"20");const E=Number(s.getInput("shutdown_time")||"30");if(isNaN(T))throw new Error("time_between_phases is not a number");if(isNaN(E))throw new Error("shutdown_time is not a number");if(b==="")b="23.1.26";if(b==="newest"){s.info("Get YDB docker versions");const e=(0,o.getYdbVersions)();b=e[e.length-1];s.info(`Use YDB docker version = '${b}'`)}return{workloads:e,githubToken:t,kubeconfig:r,awsCredentials:m,awsConfig:u,s3Endpoint:c,s3Folder:v,dockerRepo:d,dockerFolder:i,dockerUsername:n,dockerPassword:l,ydbVersion:b,timeBetweenPhases:T,shutdownTime:E,grafanaDomain:h,grafanaDashboard:g,grafanaDashboardWidth:w,grafanaDashboardHeight:_}}))}a.parseArguments=parseArguments;function getWorkloadParam(e){let a=e==-1?"":`${e}`;const p=s.getInput("language_id"+a);const t=s.getInput("language"+a);const r=s.getInput("workload_path"+a);const d=s.getInput("workload_build_context"+a);const i=s.getInput("workload_build_options"+a);s.debug(`getWorkloadParam(${e}):\n suffix='${a}'\n languageId='${p}'\n languageName='${t}'\n workloadPath='${r}'\n workloadBuildContext='${d}'\n workloadBuildOptions='${i}'`);if(p.length===0||r.length===0){s.debug(`Not found params for ${e} workload - ${"language_id"+a} and ${"workload_path"+a} are not presented`);return null}let o={id:p,path:r};if(t)o.name=t;if(d)o.buildContext=d;if(i)o.buildOptions=i;return o}},8990:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;var r=Object.getOwnPropertyDescriptor(a,p);if(!r||("get"in r?!a.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return a[p]}}}Object.defineProperty(e,t,r)}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.prototype.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};Object.defineProperty(a,"__esModule",{value:true});a.logGroup=void 0;const s=d(p(2186));function logGroup(e,a){s.startGroup(e);const p=a();if(p instanceof Promise){return p.finally((()=>{s.endGroup()}))}else{s.endGroup();return p}}a.logGroup=logGroup},4542:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;var r=Object.getOwnPropertyDescriptor(a,p);if(!r||("get"in r?!a.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return a[p]}}}Object.defineProperty(e,t,r)}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.prototype.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};var s=this&&this.__awaiter||function(e,a,p,t){function adopt(e){return e instanceof p?e:new p((function(a){a(e)}))}return new(p||(p=Promise))((function(p,r){function fulfilled(e){try{step(t.next(e))}catch(e){r(e)}}function rejected(e){try{step(t["throw"](e))}catch(e){r(e)}}function step(e){e.done?p(e.value):adopt(e.value).then(fulfilled,rejected)}step((t=t.apply(e,a||[])).next())}))};Object.defineProperty(a,"__esModule",{value:true});a.retry=void 0;const i=d(p(2186));function retry(e,a){return s(this,void 0,void 0,(function*(){let p;while(e>0){try{return yield a()}catch(e){p=e}e--}i.info("All retries have been used, re-throwing error");throw p}))}a.retry=retry},5476:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;var r=Object.getOwnPropertyDescriptor(a,p);if(!r||("get"in r?!a.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return a[p]}}}Object.defineProperty(e,t,r)}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.prototype.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};var s=this&&this.__awaiter||function(e,a,p,t){function adopt(e){return e instanceof p?e:new p((function(a){a(e)}))}return new(p||(p=Promise))((function(p,r){function fulfilled(e){try{step(t.next(e))}catch(e){r(e)}}function rejected(e){try{step(t["throw"](e))}catch(e){r(e)}}function step(e){e.done?p(e.value):adopt(e.value).then(fulfilled,rejected)}step((t=t.apply(e,a||[])).next())}))};Object.defineProperty(a,"__esModule",{value:true});a.withTimeoutSimple=a.withTimeout=a.TimeoutExceededError=void 0;const i=d(p(2186));class TimeoutExceededError extends Error{}a.TimeoutExceededError=TimeoutExceededError;function withTimeout(e,a,p,t){return s(this,void 0,void 0,(function*(){i.debug(`Call withTimeout: timeout=${e}mins refreshPeriod=${a}s now: ${(new Date).toISOString()}`);const r=(new Date).valueOf()+e*1e3*60;i.debug(`Deadline is set to: ${r} ( ${new Date(r).toISOString()} )`);do{i.debug(`withTimeout check: ${r} ( ${new Date(r).toISOString()} )`);if(yield t())return;yield new Promise((e=>setTimeout(e,a*1e3)))}while((new Date).valueOf()setTimeout(p,e*1e3)));return Promise.race([a,p])}))}a.withTimeoutSimple=withTimeoutSimple},6186:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;var r=Object.getOwnPropertyDescriptor(a,p);if(!r||("get"in r?!a.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return a[p]}}}Object.defineProperty(e,t,r)}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.prototype.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};var s=this&&this.__awaiter||function(e,a,p,t){function adopt(e){return e instanceof p?e:new p((function(a){a(e)}))}return new(p||(p=Promise))((function(p,r){function fulfilled(e){try{step(t.next(e))}catch(e){r(e)}}function rejected(e){try{step(t["throw"](e))}catch(e){r(e)}}function step(e){e.done?p(e.value):adopt(e.value).then(fulfilled,rejected)}step((t=t.apply(e,a||[])).next())}))};var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:true});a.runWorkload=a.buildWorkload=a.generateDockerPath=a.dockerLogin=void 0;const o=d(p(2186));const n=d(p(5438));const l=p(9419);const m=p(8990);const u=i(p(1542));const c=p(5476);const v=u.default["k8s/ci/workload.yaml"].content;const h=p(7147);function dockerLogin(e,a,p){return(0,m.logGroup)("Docker login",(()=>s(this,void 0,void 0,(function*(){try{yield(0,l.callAsync)(`echo "${p}" | base64 -d | docker login ${e} -u ${a} --password-stdin`,true);o.info("Successfully logged in")}catch(e){const a="Incorrect docker repo, username or password";if((e===null||e===void 0?void 0:e.message)&&(e===null||e===void 0?void 0:e.message).indexOf("username or password")>-1){o.info(a)}else{o.info("Something went wrong in docker login")}throw new Error(a)}}))))}a.dockerLogin=dockerLogin;function generateDockerPath(e,a,p){return`${e}/${a}/${p}`}a.generateDockerPath=generateDockerPath;function buildWorkload(e,a,p,t,r){if(!t||t.length===0)t="";if(!r||r.length===0)r=".";return o.group(`Build workload ${e}`,(()=>s(this,void 0,void 0,(function*(){o.info("Build docker image");yield(0,l.callAsync)(`docker buildx build --platform linux/amd64 `+`-t ${a}:latest `+`-t ${a}:gh-${n.context.sha} `+`${t} `+`${r}`,false,p);o.info("Push docker tag @latest");yield(0,l.callAsync)(`docker image push ${a}:latest`);o.info(`Push docker tag '@gh-${n.context.sha}'`);yield(0,l.callAsync)(`docker image push ${a}:gh-${n.context.sha}`)}))))}a.buildWorkload=buildWorkload;function runWorkload(e,a){return o.group(`Workload ${a.id} - ${e}`,(()=>s(this,void 0,void 0,(function*(){const p=`grpc://database-sample-grpc:2135 /root/database-sample --table-name slo-${a.id} ${a.args}`;const t=v.replace(/\$\{\{LANGUAGE_ID}}/g,a.id).replace(/\$\{\{COMMAND}}/g,e).replace(/\$\{\{DOCKER_IMAGE}}/g,a.dockerPath).replace("${{ARGS}}",p.split(" ").map((e=>`'${e}'`)).join("\n - "));o.debug(`Workload manifest: \n\n${t}`);const r=new Date;o.info(`Workload apply ${e} result:\n`+(yield(0,l.callKubernetesPathAsync)((e=>`${e} apply -f - <s(this,void 0,void 0,(function*(){const p=JSON.parse(yield(0,l.callKubernetesAsync)(`get job/${a.id}-wl-${e} -o=jsonpath={.status}`));o.debug("Workload status check: "+JSON.stringify(p));if(p.failed){const p=`Workload ${a.id} ${e} failed`;o.info(p);yield saveLogs(a.id,e);throw new Error(p)}return p.complete||p.succeeded}))))}finally{const p=new Date;yield saveLogs(a.id,e);return{startTime:r,endTime:p}}}))))}a.runWorkload=runWorkload;function saveLogs(e,a){return s(this,void 0,void 0,(function*(){let p=yield(0,l.callKubernetesAsync)(`logs job/${e}-wl-${a}`);try{let t="./logs";if(!h.existsSync(t)){yield h.promises.mkdir(t)}yield h.promises.writeFile(`${t}/${e}-${a}.log`,p)}catch(t){o.info(`error write file for ${e}-${a}: ${t.message}`);o.group(`Workload ${e} ${a} logs`,(()=>s(this,void 0,void 0,(function*(){o.info(p)}))))}}))}},7351:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;Object.defineProperty(e,t,{enumerable:true,get:function(){return a[p]}})}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};Object.defineProperty(a,"__esModule",{value:true});a.issue=a.issueCommand=void 0;const s=d(p(2037));const i=p(5278);function issueCommand(e,a,p){const t=new Command(e,a,p);process.stdout.write(t.toString()+s.EOL)}a.issueCommand=issueCommand;function issue(e,a=""){issueCommand(e,{},a)}a.issue=issue;const o="::";class Command{constructor(e,a,p){if(!e){e="missing.command"}this.command=e;this.properties=a;this.message=p}toString(){let e=o+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";let a=true;for(const p in this.properties){if(this.properties.hasOwnProperty(p)){const t=this.properties[p];if(t){if(a){a=false}else{e+=","}e+=`${p}=${escapeProperty(t)}`}}}}e+=`${o}${escapeData(this.message)}`;return e}}function escapeData(e){return i.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(e){return i.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}},2186:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;Object.defineProperty(e,t,{enumerable:true,get:function(){return a[p]}})}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};var s=this&&this.__awaiter||function(e,a,p,t){function adopt(e){return e instanceof p?e:new p((function(a){a(e)}))}return new(p||(p=Promise))((function(p,r){function fulfilled(e){try{step(t.next(e))}catch(e){r(e)}}function rejected(e){try{step(t["throw"](e))}catch(e){r(e)}}function step(e){e.done?p(e.value):adopt(e.value).then(fulfilled,rejected)}step((t=t.apply(e,a||[])).next())}))};Object.defineProperty(a,"__esModule",{value:true});a.getIDToken=a.getState=a.saveState=a.group=a.endGroup=a.startGroup=a.info=a.notice=a.warning=a.error=a.debug=a.isDebug=a.setFailed=a.setCommandEcho=a.setOutput=a.getBooleanInput=a.getMultilineInput=a.getInput=a.addPath=a.setSecret=a.exportVariable=a.ExitCode=void 0;const i=p(7351);const o=p(717);const n=p(5278);const l=d(p(2037));const m=d(p(1017));const u=p(8041);var c;(function(e){e[e["Success"]=0]="Success";e[e["Failure"]=1]="Failure"})(c=a.ExitCode||(a.ExitCode={}));function exportVariable(e,a){const p=n.toCommandValue(a);process.env[e]=p;const t=process.env["GITHUB_ENV"]||"";if(t){return o.issueFileCommand("ENV",o.prepareKeyValueMessage(e,a))}i.issueCommand("set-env",{name:e},p)}a.exportVariable=exportVariable;function setSecret(e){i.issueCommand("add-mask",{},e)}a.setSecret=setSecret;function addPath(e){const a=process.env["GITHUB_PATH"]||"";if(a){o.issueFileCommand("PATH",e)}else{i.issueCommand("add-path",{},e)}process.env["PATH"]=`${e}${m.delimiter}${process.env["PATH"]}`}a.addPath=addPath;function getInput(e,a){const p=process.env[`INPUT_${e.replace(/ /g,"_").toUpperCase()}`]||"";if(a&&a.required&&!p){throw new Error(`Input required and not supplied: ${e}`)}if(a&&a.trimWhitespace===false){return p}return p.trim()}a.getInput=getInput;function getMultilineInput(e,a){const p=getInput(e,a).split("\n").filter((e=>e!==""));if(a&&a.trimWhitespace===false){return p}return p.map((e=>e.trim()))}a.getMultilineInput=getMultilineInput;function getBooleanInput(e,a){const p=["true","True","TRUE"];const t=["false","False","FALSE"];const r=getInput(e,a);if(p.includes(r))return true;if(t.includes(r))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\``)}a.getBooleanInput=getBooleanInput;function setOutput(e,a){const p=process.env["GITHUB_OUTPUT"]||"";if(p){return o.issueFileCommand("OUTPUT",o.prepareKeyValueMessage(e,a))}process.stdout.write(l.EOL);i.issueCommand("set-output",{name:e},n.toCommandValue(a))}a.setOutput=setOutput;function setCommandEcho(e){i.issue("echo",e?"on":"off")}a.setCommandEcho=setCommandEcho;function setFailed(e){process.exitCode=c.Failure;error(e)}a.setFailed=setFailed;function isDebug(){return process.env["RUNNER_DEBUG"]==="1"}a.isDebug=isDebug;function debug(e){i.issueCommand("debug",{},e)}a.debug=debug;function error(e,a={}){i.issueCommand("error",n.toCommandProperties(a),e instanceof Error?e.toString():e)}a.error=error;function warning(e,a={}){i.issueCommand("warning",n.toCommandProperties(a),e instanceof Error?e.toString():e)}a.warning=warning;function notice(e,a={}){i.issueCommand("notice",n.toCommandProperties(a),e instanceof Error?e.toString():e)}a.notice=notice;function info(e){process.stdout.write(e+l.EOL)}a.info=info;function startGroup(e){i.issue("group",e)}a.startGroup=startGroup;function endGroup(){i.issue("endgroup")}a.endGroup=endGroup;function group(e,a){return s(this,void 0,void 0,(function*(){startGroup(e);let p;try{p=yield a()}finally{endGroup()}return p}))}a.group=group;function saveState(e,a){const p=process.env["GITHUB_STATE"]||"";if(p){return o.issueFileCommand("STATE",o.prepareKeyValueMessage(e,a))}i.issueCommand("save-state",{name:e},n.toCommandValue(a))}a.saveState=saveState;function getState(e){return process.env[`STATE_${e}`]||""}a.getState=getState;function getIDToken(e){return s(this,void 0,void 0,(function*(){return yield u.OidcClient.getIDToken(e)}))}a.getIDToken=getIDToken;var v=p(1327);Object.defineProperty(a,"summary",{enumerable:true,get:function(){return v.summary}});var h=p(1327);Object.defineProperty(a,"markdownSummary",{enumerable:true,get:function(){return h.markdownSummary}});var g=p(2981);Object.defineProperty(a,"toPosixPath",{enumerable:true,get:function(){return g.toPosixPath}});Object.defineProperty(a,"toWin32Path",{enumerable:true,get:function(){return g.toWin32Path}});Object.defineProperty(a,"toPlatformPath",{enumerable:true,get:function(){return g.toPlatformPath}})},717:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;Object.defineProperty(e,t,{enumerable:true,get:function(){return a[p]}})}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};Object.defineProperty(a,"__esModule",{value:true});a.prepareKeyValueMessage=a.issueFileCommand=void 0;const s=d(p(7147));const i=d(p(2037));const o=p(5840);const n=p(5278);function issueFileCommand(e,a){const p=process.env[`GITHUB_${e}`];if(!p){throw new Error(`Unable to find environment variable for file command ${e}`)}if(!s.existsSync(p)){throw new Error(`Missing file at path: ${p}`)}s.appendFileSync(p,`${n.toCommandValue(a)}${i.EOL}`,{encoding:"utf8"})}a.issueFileCommand=issueFileCommand;function prepareKeyValueMessage(e,a){const p=`ghadelimiter_${o.v4()}`;const t=n.toCommandValue(a);if(e.includes(p)){throw new Error(`Unexpected input: name should not contain the delimiter "${p}"`)}if(t.includes(p)){throw new Error(`Unexpected input: value should not contain the delimiter "${p}"`)}return`${e}<<${p}${i.EOL}${t}${i.EOL}${p}`}a.prepareKeyValueMessage=prepareKeyValueMessage},8041:function(e,a,p){"use strict";var t=this&&this.__awaiter||function(e,a,p,t){function adopt(e){return e instanceof p?e:new p((function(a){a(e)}))}return new(p||(p=Promise))((function(p,r){function fulfilled(e){try{step(t.next(e))}catch(e){r(e)}}function rejected(e){try{step(t["throw"](e))}catch(e){r(e)}}function step(e){e.done?p(e.value):adopt(e.value).then(fulfilled,rejected)}step((t=t.apply(e,a||[])).next())}))};Object.defineProperty(a,"__esModule",{value:true});a.OidcClient=void 0;const r=p(6255);const d=p(5526);const s=p(2186);class OidcClient{static createHttpClient(e=true,a=10){const p={allowRetries:e,maxRetries:a};return new r.HttpClient("actions/oidc-client",[new d.BearerCredentialHandler(OidcClient.getRequestToken())],p)}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){var a;return t(this,void 0,void 0,(function*(){const p=OidcClient.createHttpClient();const t=yield p.getJson(e).catch((e=>{throw new Error(`Failed to get ID Token. \n \n Error Code : ${e.statusCode}\n \n Error Message: ${e.result.message}`)}));const r=(a=t.result)===null||a===void 0?void 0:a.value;if(!r){throw new Error("Response json body do not have ID Token field")}return r}))}static getIDToken(e){return t(this,void 0,void 0,(function*(){try{let a=OidcClient.getIDTokenUrl();if(e){const p=encodeURIComponent(e);a=`${a}&audience=${p}`}s.debug(`ID token url is ${a}`);const p=yield OidcClient.getCall(a);s.setSecret(p);return p}catch(e){throw new Error(`Error message: ${e.message}`)}}))}}a.OidcClient=OidcClient},2981:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;Object.defineProperty(e,t,{enumerable:true,get:function(){return a[p]}})}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};Object.defineProperty(a,"__esModule",{value:true});a.toPlatformPath=a.toWin32Path=a.toPosixPath=void 0;const s=d(p(1017));function toPosixPath(e){return e.replace(/[\\]/g,"/")}a.toPosixPath=toPosixPath;function toWin32Path(e){return e.replace(/[/]/g,"\\")}a.toWin32Path=toWin32Path;function toPlatformPath(e){return e.replace(/[/\\]/g,s.sep)}a.toPlatformPath=toPlatformPath},1327:function(e,a,p){"use strict";var t=this&&this.__awaiter||function(e,a,p,t){function adopt(e){return e instanceof p?e:new p((function(a){a(e)}))}return new(p||(p=Promise))((function(p,r){function fulfilled(e){try{step(t.next(e))}catch(e){r(e)}}function rejected(e){try{step(t["throw"](e))}catch(e){r(e)}}function step(e){e.done?p(e.value):adopt(e.value).then(fulfilled,rejected)}step((t=t.apply(e,a||[])).next())}))};Object.defineProperty(a,"__esModule",{value:true});a.summary=a.markdownSummary=a.SUMMARY_DOCS_URL=a.SUMMARY_ENV_VAR=void 0;const r=p(2037);const d=p(7147);const{access:s,appendFile:i,writeFile:o}=d.promises;a.SUMMARY_ENV_VAR="GITHUB_STEP_SUMMARY";a.SUMMARY_DOCS_URL="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[a.SUMMARY_ENV_VAR];if(!e){throw new Error(`Unable to find environment variable for $${a.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`)}try{yield s(e,d.constants.R_OK|d.constants.W_OK)}catch(a){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,a,p={}){const t=Object.entries(p).map((([e,a])=>` ${e}="${a}"`)).join("");if(!a){return`<${e}${t}>`}return`<${e}${t}>${a}`}write(e){return t(this,void 0,void 0,(function*(){const a=!!(e===null||e===void 0?void 0:e.overwrite);const p=yield this.filePath();const t=a?o:i;yield t(p,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,a=false){this._buffer+=e;return a?this.addEOL():this}addEOL(){return this.addRaw(r.EOL)}addCodeBlock(e,a){const p=Object.assign({},a&&{lang:a});const t=this.wrap("pre",this.wrap("code",e),p);return this.addRaw(t).addEOL()}addList(e,a=false){const p=a?"ol":"ul";const t=e.map((e=>this.wrap("li",e))).join("");const r=this.wrap(p,t);return this.addRaw(r).addEOL()}addTable(e){const a=e.map((e=>{const a=e.map((e=>{if(typeof e==="string"){return this.wrap("td",e)}const{header:a,data:p,colspan:t,rowspan:r}=e;const d=a?"th":"td";const s=Object.assign(Object.assign({},t&&{colspan:t}),r&&{rowspan:r});return this.wrap(d,p,s)})).join("");return this.wrap("tr",a)})).join("");const p=this.wrap("table",a);return this.addRaw(p).addEOL()}addDetails(e,a){const p=this.wrap("details",this.wrap("summary",e)+a);return this.addRaw(p).addEOL()}addImage(e,a,p){const{width:t,height:r}=p||{};const d=Object.assign(Object.assign({},t&&{width:t}),r&&{height:r});const s=this.wrap("img",null,Object.assign({src:e,alt:a},d));return this.addRaw(s).addEOL()}addHeading(e,a){const p=`h${a}`;const t=["h1","h2","h3","h4","h5","h6"].includes(p)?p:"h1";const r=this.wrap(t,e);return this.addRaw(r).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,a){const p=Object.assign({},a&&{cite:a});const t=this.wrap("blockquote",e,p);return this.addRaw(t).addEOL()}addLink(e,a){const p=this.wrap("a",e,{href:a});return this.addRaw(p).addEOL()}}const n=new Summary;a.markdownSummary=n;a.summary=n},5278:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:true});a.toCommandProperties=a.toCommandValue=void 0;function toCommandValue(e){if(e===null||e===undefined){return""}else if(typeof e==="string"||e instanceof String){return e}return JSON.stringify(e)}a.toCommandValue=toCommandValue;function 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}}a.toCommandProperties=toCommandProperties},4087:(e,a,p)=>{"use strict";Object.defineProperty(a,"__esModule",{value:true});a.Context=void 0;const t=p(7147);const r=p(2037);class Context{constructor(){var e,a,p;this.payload={};if(process.env.GITHUB_EVENT_PATH){if(t.existsSync(process.env.GITHUB_EVENT_PATH)){this.payload=JSON.parse(t.readFileSync(process.env.GITHUB_EVENT_PATH,{encoding:"utf8"}))}else{const e=process.env.GITHUB_EVENT_PATH;process.stdout.write(`GITHUB_EVENT_PATH ${e} does not exist${r.EOL}`)}}this.eventName=process.env.GITHUB_EVENT_NAME;this.sha=process.env.GITHUB_SHA;this.ref=process.env.GITHUB_REF;this.workflow=process.env.GITHUB_WORKFLOW;this.action=process.env.GITHUB_ACTION;this.actor=process.env.GITHUB_ACTOR;this.job=process.env.GITHUB_JOB;this.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=(a=process.env.GITHUB_SERVER_URL)!==null&&a!==void 0?a:`https://github.com`;this.graphqlUrl=(p=process.env.GITHUB_GRAPHQL_URL)!==null&&p!==void 0?p:`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,a]=process.env.GITHUB_REPOSITORY.split("/");return{owner:e,repo:a}}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'")}}a.Context=Context},5438:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;Object.defineProperty(e,t,{enumerable:true,get:function(){return a[p]}})}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};Object.defineProperty(a,"__esModule",{value:true});a.getOctokit=a.context=void 0;const s=d(p(4087));const i=p(3030);a.context=new s.Context;function getOctokit(e,a,...p){const t=i.GitHub.plugin(...p);return new t(i.getOctokitOptions(e,a))}a.getOctokit=getOctokit},7914:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;Object.defineProperty(e,t,{enumerable:true,get:function(){return a[p]}})}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};Object.defineProperty(a,"__esModule",{value:true});a.getApiBaseUrl=a.getProxyAgent=a.getAuthString=void 0;const s=d(p(6255));function getAuthString(e,a){if(!e&&!a.auth){throw new Error("Parameter token or opts.auth is required")}else if(e&&a.auth){throw new Error("Parameters token and opts.auth may not both be specified")}return typeof a.auth==="string"?a.auth:`token ${e}`}a.getAuthString=getAuthString;function getProxyAgent(e){const a=new s.HttpClient;return a.getAgent(e)}a.getProxyAgent=getProxyAgent;function getApiBaseUrl(){return process.env["GITHUB_API_URL"]||"https://api.github.com"}a.getApiBaseUrl=getApiBaseUrl},3030:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;Object.defineProperty(e,t,{enumerable:true,get:function(){return a[p]}})}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};Object.defineProperty(a,"__esModule",{value:true});a.getOctokitOptions=a.GitHub=a.defaults=a.context=void 0;const s=d(p(4087));const i=d(p(7914));const o=p(6762);const n=p(3044);const l=p(4193);a.context=new s.Context;const m=i.getApiBaseUrl();a.defaults={baseUrl:m,request:{agent:i.getProxyAgent(m)}};a.GitHub=o.Octokit.plugin(n.restEndpointMethods,l.paginateRest).defaults(a.defaults);function getOctokitOptions(e,a){const p=Object.assign({},a||{});const t=i.getAuthString(e,p);if(t){p.auth=t}return p}a.getOctokitOptions=getOctokitOptions},5526:function(e,a){"use strict";var p=this&&this.__awaiter||function(e,a,p,t){function adopt(e){return e instanceof p?e:new p((function(a){a(e)}))}return new(p||(p=Promise))((function(p,r){function fulfilled(e){try{step(t.next(e))}catch(e){r(e)}}function rejected(e){try{step(t["throw"](e))}catch(e){r(e)}}function step(e){e.done?p(e.value):adopt(e.value).then(fulfilled,rejected)}step((t=t.apply(e,a||[])).next())}))};Object.defineProperty(a,"__esModule",{value:true});a.PersonalAccessTokenCredentialHandler=a.BearerCredentialHandler=a.BasicCredentialHandler=void 0;class BasicCredentialHandler{constructor(e,a){this.username=e;this.password=a}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 p(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}a.BasicCredentialHandler=BasicCredentialHandler;class 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 p(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}a.BearerCredentialHandler=BearerCredentialHandler;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 p(this,void 0,void 0,(function*(){throw new Error("not implemented")}))}}a.PersonalAccessTokenCredentialHandler=PersonalAccessTokenCredentialHandler},6255:function(e,a,p){"use strict";var t=this&&this.__createBinding||(Object.create?function(e,a,p,t){if(t===undefined)t=p;Object.defineProperty(e,t,{enumerable:true,get:function(){return a[p]}})}:function(e,a,p,t){if(t===undefined)t=p;e[t]=a[p]});var r=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:true,value:a})}:function(e,a){e["default"]=a});var d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var p in e)if(p!=="default"&&Object.hasOwnProperty.call(e,p))t(a,e,p);r(a,e);return a};var s=this&&this.__awaiter||function(e,a,p,t){function adopt(e){return e instanceof p?e:new p((function(a){a(e)}))}return new(p||(p=Promise))((function(p,r){function fulfilled(e){try{step(t.next(e))}catch(e){r(e)}}function rejected(e){try{step(t["throw"](e))}catch(e){r(e)}}function step(e){e.done?p(e.value):adopt(e.value).then(fulfilled,rejected)}step((t=t.apply(e,a||[])).next())}))};Object.defineProperty(a,"__esModule",{value:true});a.HttpClient=a.isHttps=a.HttpClientResponse=a.HttpClientError=a.getProxyUrl=a.MediaTypes=a.Headers=a.HttpCodes=void 0;const i=d(p(3685));const o=d(p(5687));const n=d(p(9835));const l=d(p(4294));var m;(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"})(m=a.HttpCodes||(a.HttpCodes={}));var u;(function(e){e["Accept"]="accept";e["ContentType"]="content-type"})(u=a.Headers||(a.Headers={}));var c;(function(e){e["ApplicationJson"]="application/json"})(c=a.MediaTypes||(a.MediaTypes={}));function getProxyUrl(e){const a=n.getProxyUrl(new URL(e));return a?a.href:""}a.getProxyUrl=getProxyUrl;const v=[m.MovedPermanently,m.ResourceMoved,m.SeeOther,m.TemporaryRedirect,m.PermanentRedirect];const h=[m.BadGateway,m.ServiceUnavailable,m.GatewayTimeout];const g=["OPTIONS","GET","DELETE","HEAD"];const w=10;const _=5;class HttpClientError extends Error{constructor(e,a){super(e);this.name="HttpClientError";this.statusCode=a;Object.setPrototypeOf(this,HttpClientError.prototype)}}a.HttpClientError=HttpClientError;class HttpClientResponse{constructor(e){this.message=e}readBody(){return s(this,void 0,void 0,(function*(){return new Promise((e=>s(this,void 0,void 0,(function*(){let a=Buffer.alloc(0);this.message.on("data",(e=>{a=Buffer.concat([a,e])}));this.message.on("end",(()=>{e(a.toString())}))}))))}))}}a.HttpClientResponse=HttpClientResponse;function isHttps(e){const a=new URL(e);return a.protocol==="https:"}a.isHttps=isHttps;class HttpClient{constructor(e,a,p){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=e;this.handlers=a||[];this.requestOptions=p;if(p){if(p.ignoreSslError!=null){this._ignoreSslError=p.ignoreSslError}this._socketTimeout=p.socketTimeout;if(p.allowRedirects!=null){this._allowRedirects=p.allowRedirects}if(p.allowRedirectDowngrade!=null){this._allowRedirectDowngrade=p.allowRedirectDowngrade}if(p.maxRedirects!=null){this._maxRedirects=Math.max(p.maxRedirects,0)}if(p.keepAlive!=null){this._keepAlive=p.keepAlive}if(p.allowRetries!=null){this._allowRetries=p.allowRetries}if(p.maxRetries!=null){this._maxRetries=p.maxRetries}}}options(e,a){return s(this,void 0,void 0,(function*(){return this.request("OPTIONS",e,null,a||{})}))}get(e,a){return s(this,void 0,void 0,(function*(){return this.request("GET",e,null,a||{})}))}del(e,a){return s(this,void 0,void 0,(function*(){return this.request("DELETE",e,null,a||{})}))}post(e,a,p){return s(this,void 0,void 0,(function*(){return this.request("POST",e,a,p||{})}))}patch(e,a,p){return s(this,void 0,void 0,(function*(){return this.request("PATCH",e,a,p||{})}))}put(e,a,p){return s(this,void 0,void 0,(function*(){return this.request("PUT",e,a,p||{})}))}head(e,a){return s(this,void 0,void 0,(function*(){return this.request("HEAD",e,null,a||{})}))}sendStream(e,a,p,t){return s(this,void 0,void 0,(function*(){return this.request(e,a,p,t)}))}getJson(e,a={}){return s(this,void 0,void 0,(function*(){a[u.Accept]=this._getExistingOrDefaultHeader(a,u.Accept,c.ApplicationJson);const p=yield this.get(e,a);return this._processResponse(p,this.requestOptions)}))}postJson(e,a,p={}){return s(this,void 0,void 0,(function*(){const t=JSON.stringify(a,null,2);p[u.Accept]=this._getExistingOrDefaultHeader(p,u.Accept,c.ApplicationJson);p[u.ContentType]=this._getExistingOrDefaultHeader(p,u.ContentType,c.ApplicationJson);const r=yield this.post(e,t,p);return this._processResponse(r,this.requestOptions)}))}putJson(e,a,p={}){return s(this,void 0,void 0,(function*(){const t=JSON.stringify(a,null,2);p[u.Accept]=this._getExistingOrDefaultHeader(p,u.Accept,c.ApplicationJson);p[u.ContentType]=this._getExistingOrDefaultHeader(p,u.ContentType,c.ApplicationJson);const r=yield this.put(e,t,p);return this._processResponse(r,this.requestOptions)}))}patchJson(e,a,p={}){return s(this,void 0,void 0,(function*(){const t=JSON.stringify(a,null,2);p[u.Accept]=this._getExistingOrDefaultHeader(p,u.Accept,c.ApplicationJson);p[u.ContentType]=this._getExistingOrDefaultHeader(p,u.ContentType,c.ApplicationJson);const r=yield this.patch(e,t,p);return this._processResponse(r,this.requestOptions)}))}request(e,a,p,t){return s(this,void 0,void 0,(function*(){if(this._disposed){throw new Error("Client has already been disposed.")}const r=new URL(a);let d=this._prepareRequest(e,r,t);const s=this._allowRetries&&g.includes(e)?this._maxRetries+1:1;let i=0;let o;do{o=yield this.requestRaw(d,p);if(o&&o.message&&o.message.statusCode===m.Unauthorized){let e;for(const a of this.handlers){if(a.canHandleAuthentication(o)){e=a;break}}if(e){return e.handleAuthentication(this,d,p)}else{return o}}let a=this._maxRedirects;while(o.message.statusCode&&v.includes(o.message.statusCode)&&this._allowRedirects&&a>0){const s=o.message.headers["location"];if(!s){break}const i=new URL(s);if(r.protocol==="https:"&&r.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 o.readBody();if(i.hostname!==r.hostname){for(const e in t){if(e.toLowerCase()==="authorization"){delete t[e]}}}d=this._prepareRequest(e,i,t);o=yield this.requestRaw(d,p);a--}if(!o.message.statusCode||!h.includes(o.message.statusCode)){return o}i+=1;if(i{function callbackForResult(e,a){if(e){t(e)}else if(!a){t(new Error("Unknown error"))}else{p(a)}}this.requestRawWithCallback(e,a,callbackForResult)}))}))}requestRawWithCallback(e,a,p){if(typeof a==="string"){if(!e.options.headers){e.options.headers={}}e.options.headers["Content-Length"]=Buffer.byteLength(a,"utf8")}let t=false;function handleResult(e,a){if(!t){t=true;p(e,a)}}const r=e.httpModule.request(e.options,(e=>{const a=new HttpClientResponse(e);handleResult(undefined,a)}));let d;r.on("socket",(e=>{d=e}));r.setTimeout(this._socketTimeout||3*6e4,(()=>{if(d){d.end()}handleResult(new Error(`Request timeout: ${e.options.path}`))}));r.on("error",(function(e){handleResult(e)}));if(a&&typeof a==="string"){r.write(a,"utf8")}if(a&&typeof a!=="string"){a.on("close",(function(){r.end()}));a.pipe(r)}else{r.end()}}getAgent(e){const a=new URL(e);return this._getAgent(a)}_prepareRequest(e,a,p){const t={};t.parsedUrl=a;const r=t.parsedUrl.protocol==="https:";t.httpModule=r?o:i;const d=r?443:80;t.options={};t.options.host=t.parsedUrl.hostname;t.options.port=t.parsedUrl.port?parseInt(t.parsedUrl.port):d;t.options.path=(t.parsedUrl.pathname||"")+(t.parsedUrl.search||"");t.options.method=e;t.options.headers=this._mergeHeaders(p);if(this.userAgent!=null){t.options.headers["user-agent"]=this.userAgent}t.options.agent=this._getAgent(t.parsedUrl);if(this.handlers){for(const e of this.handlers){e.prepareRequest(t.options)}}return t}_mergeHeaders(e){if(this.requestOptions&&this.requestOptions.headers){return Object.assign({},lowercaseKeys(this.requestOptions.headers),lowercaseKeys(e||{}))}return lowercaseKeys(e||{})}_getExistingOrDefaultHeader(e,a,p){let t;if(this.requestOptions&&this.requestOptions.headers){t=lowercaseKeys(this.requestOptions.headers)[a]}return e[a]||t||p}_getAgent(e){let a;const p=n.getProxyUrl(e);const t=p&&p.hostname;if(this._keepAlive&&t){a=this._proxyAgent}if(this._keepAlive&&!t){a=this._agent}if(a){return a}const r=e.protocol==="https:";let d=100;if(this.requestOptions){d=this.requestOptions.maxSockets||i.globalAgent.maxSockets}if(p&&p.hostname){const e={maxSockets:d,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(p.username||p.password)&&{proxyAuth:`${p.username}:${p.password}`}),{host:p.hostname,port:p.port})};let t;const s=p.protocol==="https:";if(r){t=s?l.httpsOverHttps:l.httpsOverHttp}else{t=s?l.httpOverHttps:l.httpOverHttp}a=t(e);this._proxyAgent=a}if(this._keepAlive&&!a){const e={keepAlive:this._keepAlive,maxSockets:d};a=r?new o.Agent(e):new i.Agent(e);this._agent=a}if(!a){a=r?o.globalAgent:i.globalAgent}if(r&&this._ignoreSslError){a.options=Object.assign(a.options||{},{rejectUnauthorized:false})}return a}_performExponentialBackoff(e){return s(this,void 0,void 0,(function*(){e=Math.min(w,e);const a=_*Math.pow(2,e);return new Promise((e=>setTimeout((()=>e()),a)))}))}_processResponse(e,a){return s(this,void 0,void 0,(function*(){return new Promise(((p,t)=>s(this,void 0,void 0,(function*(){const r=e.message.statusCode||0;const d={statusCode:r,result:null,headers:{}};if(r===m.NotFound){p(d)}function dateTimeDeserializer(e,a){if(typeof a==="string"){const e=new Date(a);if(!isNaN(e.valueOf())){return e}}return a}let s;let i;try{i=yield e.readBody();if(i&&i.length>0){if(a&&a.deserializeDates){s=JSON.parse(i,dateTimeDeserializer)}else{s=JSON.parse(i)}d.result=s}d.headers=e.message.headers}catch(e){}if(r>299){let e;if(s&&s.message){e=s.message}else if(i&&i.length>0){e=i}else{e=`Failed request: (${r})`}const a=new HttpClientError(e,r);a.result=d.result;t(a)}else{p(d)}}))))}))}}a.HttpClient=HttpClient;const lowercaseKeys=e=>Object.keys(e).reduce(((a,p)=>(a[p.toLowerCase()]=e[p],a)),{})},9835:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:true});a.checkBypass=a.getProxyUrl=void 0;function getProxyUrl(e){const a=e.protocol==="https:";if(checkBypass(e)){return undefined}const p=(()=>{if(a){return process.env["https_proxy"]||process.env["HTTPS_PROXY"]}else{return process.env["http_proxy"]||process.env["HTTP_PROXY"]}})();if(p){return new URL(p)}else{return undefined}}a.getProxyUrl=getProxyUrl;function checkBypass(e){if(!e.hostname){return false}const a=e.hostname;if(isLoopbackAddress(a)){return true}const p=process.env["no_proxy"]||process.env["NO_PROXY"]||"";if(!p){return false}let t;if(e.port){t=Number(e.port)}else if(e.protocol==="http:"){t=80}else if(e.protocol==="https:"){t=443}const r=[e.hostname.toUpperCase()];if(typeof t==="number"){r.push(`${r[0]}:${t}`)}for(const e of p.split(",").map((e=>e.trim().toUpperCase())).filter((e=>e))){if(e==="*"||r.some((a=>a===e||a.endsWith(`.${e}`)||e.startsWith(".")&&a.endsWith(`${e}`)))){return true}}return false}a.checkBypass=checkBypass;function isLoopbackAddress(e){const a=e.toLowerCase();return a==="localhost"||a.startsWith("127.")||a.startsWith("[::1]")||a.startsWith("[0:0:0:0:0:0:0:1]")}},334:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:true});const p=/^v1\./;const t=/^ghs_/;const r=/^ghu_/;async function auth(e){const a=e.split(/\./).length===3;const d=p.test(e)||t.test(e);const s=r.test(e);const i=a?"app":d?"installation":s?"user-to-server":"oauth";return{type:"token",token:e,tokenType:i}}function withAuthorizationPrefix(e){if(e.split(/\./).length===3){return`bearer ${e}`}return`token ${e}`}async function hook(e,a,p,t){const r=a.endpoint.merge(p,t);r.headers.authorization=withAuthorizationPrefix(e);return a(r)}const d=function createTokenAuth(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)})};a.createTokenAuth=d},6762:(e,a,p)=>{"use strict";Object.defineProperty(a,"__esModule",{value:true});var t=p(5030);var r=p(3682);var d=p(6234);var s=p(8467);var i=p(334);function _objectWithoutPropertiesLoose(e,a){if(e==null)return{};var p={};var t=Object.keys(e);var r,d;for(d=0;d=0)continue;p[r]=e[r]}return p}function _objectWithoutProperties(e,a){if(e==null)return{};var p=_objectWithoutPropertiesLoose(e,a);var t,r;if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(e);for(r=0;r=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,t))continue;p[t]=e[t]}}return p}const o="3.6.0";const n=["authStrategy"];class Octokit{constructor(e={}){const a=new r.Collection;const p={baseUrl:d.request.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},e.request,{hook:a.bind(null,"request")}),mediaType:{previews:[],format:""}};p.headers["user-agent"]=[e.userAgent,`octokit-core.js/${o} ${t.getUserAgent()}`].filter(Boolean).join(" ");if(e.baseUrl){p.baseUrl=e.baseUrl}if(e.previews){p.mediaType.previews=e.previews}if(e.timeZone){p.headers["time-zone"]=e.timeZone}this.request=d.request.defaults(p);this.graphql=s.withCustomRequest(this.request).defaults(p);this.log=Object.assign({debug:()=>{},info:()=>{},warn:console.warn.bind(console),error:console.error.bind(console)},e.log);this.hook=a;if(!e.authStrategy){if(!e.auth){this.auth=async()=>({type:"unauthenticated"})}else{const p=i.createTokenAuth(e.auth);a.wrap("request",p.hook);this.auth=p}}else{const{authStrategy:p}=e,t=_objectWithoutProperties(e,n);const r=p(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:t},e.auth));a.wrap("request",r.hook);this.auth=r}const l=this.constructor;l.plugins.forEach((a=>{Object.assign(this,a(this,e))}))}static defaults(e){const a=class extends(this){constructor(...a){const p=a[0]||{};if(typeof e==="function"){super(e(p));return}super(Object.assign({},e,p,p.userAgent&&e.userAgent?{userAgent:`${p.userAgent} ${e.userAgent}`}:null))}};return a}static plugin(...e){var a;const p=this.plugins;const t=(a=class extends(this){},a.plugins=p.concat(e.filter((e=>!p.includes(e)))),a);return t}}Octokit.VERSION=o;Octokit.plugins=[];a.Octokit=Octokit},9440:(e,a,p)=>{"use strict";Object.defineProperty(a,"__esModule",{value:true});var t=p(3287);var r=p(5030);function lowercaseKeys(e){if(!e){return{}}return Object.keys(e).reduce(((a,p)=>{a[p.toLowerCase()]=e[p];return a}),{})}function mergeDeep(e,a){const p=Object.assign({},e);Object.keys(a).forEach((r=>{if(t.isPlainObject(a[r])){if(!(r in e))Object.assign(p,{[r]:a[r]});else p[r]=mergeDeep(e[r],a[r])}else{Object.assign(p,{[r]:a[r]})}}));return p}function removeUndefinedProperties(e){for(const a in e){if(e[a]===undefined){delete e[a]}}return e}function merge(e,a,p){if(typeof a==="string"){let[e,t]=a.split(" ");p=Object.assign(t?{method:e,url:t}:{url:e},p)}else{p=Object.assign({},a)}p.headers=lowercaseKeys(p.headers);removeUndefinedProperties(p);removeUndefinedProperties(p.headers);const t=mergeDeep(e||{},p);if(e&&e.mediaType.previews.length){t.mediaType.previews=e.mediaType.previews.filter((e=>!t.mediaType.previews.includes(e))).concat(t.mediaType.previews)}t.mediaType.previews=t.mediaType.previews.map((e=>e.replace(/-preview/,"")));return t}function addQueryParameters(e,a){const p=/\?/.test(e)?"&":"?";const t=Object.keys(a);if(t.length===0){return e}return e+p+t.map((e=>{if(e==="q"){return"q="+a.q.split("+").map(encodeURIComponent).join("+")}return`${e}=${encodeURIComponent(a[e])}`})).join("&")}const d=/\{[^}]+\}/g;function removeNonChars(e){return e.replace(/^\W+|\W+$/g,"").split(/,/)}function extractUrlVariableNames(e){const a=e.match(d);if(!a){return[]}return a.map(removeNonChars).reduce(((e,a)=>e.concat(a)),[])}function omit(e,a){return Object.keys(e).filter((e=>!a.includes(e))).reduce(((a,p)=>{a[p]=e[p];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,a,p){a=e==="+"||e==="#"?encodeReserved(a):encodeUnreserved(a);if(p){return encodeUnreserved(p)+"="+a}else{return a}}function isDefined(e){return e!==undefined&&e!==null}function isKeyOperator(e){return e===";"||e==="&"||e==="?"}function getValues(e,a,p,t){var r=e[p],d=[];if(isDefined(r)&&r!==""){if(typeof r==="string"||typeof r==="number"||typeof r==="boolean"){r=r.toString();if(t&&t!=="*"){r=r.substring(0,parseInt(t,10))}d.push(encodeValue(a,r,isKeyOperator(a)?p:""))}else{if(t==="*"){if(Array.isArray(r)){r.filter(isDefined).forEach((function(e){d.push(encodeValue(a,e,isKeyOperator(a)?p:""))}))}else{Object.keys(r).forEach((function(e){if(isDefined(r[e])){d.push(encodeValue(a,r[e],e))}}))}}else{const e=[];if(Array.isArray(r)){r.filter(isDefined).forEach((function(p){e.push(encodeValue(a,p))}))}else{Object.keys(r).forEach((function(p){if(isDefined(r[p])){e.push(encodeUnreserved(p));e.push(encodeValue(a,r[p].toString()))}}))}if(isKeyOperator(a)){d.push(encodeUnreserved(p)+"="+e.join(","))}else if(e.length!==0){d.push(e.join(","))}}}}else{if(a===";"){if(isDefined(r)){d.push(encodeUnreserved(p))}}else if(r===""&&(a==="&"||a==="?")){d.push(encodeUnreserved(p)+"=")}else if(r===""){d.push("")}}return d}function parseUrl(e){return{expand:expand.bind(null,e)}}function expand(e,a){var p=["+","#",".","/",";","?","&"];return e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,(function(e,t,r){if(t){let e="";const r=[];if(p.indexOf(t.charAt(0))!==-1){e=t.charAt(0);t=t.substr(1)}t.split(/,/g).forEach((function(p){var t=/([^:\*]*)(?::(\d+)|(\*))?/.exec(p);r.push(getValues(a,e,t[1],t[2]||t[3]))}));if(e&&e!=="+"){var d=",";if(e==="?"){d="&"}else if(e!=="#"){d=e}return(r.length!==0?e:"")+r.join(d)}else{return r.join(",")}}else{return encodeReserved(r)}}))}function parse(e){let a=e.method.toUpperCase();let p=(e.url||"/").replace(/:([a-z]\w+)/g,"{$1}");let t=Object.assign({},e.headers);let r;let d=omit(e,["method","baseUrl","url","headers","request","mediaType"]);const s=extractUrlVariableNames(p);p=parseUrl(p).expand(d);if(!/^http/.test(p)){p=e.baseUrl+p}const i=Object.keys(e).filter((e=>s.includes(e))).concat("baseUrl");const o=omit(d,i);const n=/application\/octet-stream/i.test(t.accept);if(!n){if(e.mediaType.format){t.accept=t.accept.split(/,/).map((a=>a.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${e.mediaType.format}`))).join(",")}if(e.mediaType.previews.length){const a=t.accept.match(/[\w-]+(?=-preview)/g)||[];t.accept=a.concat(e.mediaType.previews).map((a=>{const p=e.mediaType.format?`.${e.mediaType.format}`:"+json";return`application/vnd.github.${a}-preview${p}`})).join(",")}}if(["GET","HEAD"].includes(a)){p=addQueryParameters(p,o)}else{if("data"in o){r=o.data}else{if(Object.keys(o).length){r=o}else{t["content-length"]=0}}}if(!t["content-type"]&&typeof r!=="undefined"){t["content-type"]="application/json; charset=utf-8"}if(["PATCH","PUT"].includes(a)&&typeof r==="undefined"){r=""}return Object.assign({method:a,url:p,headers:t},typeof r!=="undefined"?{body:r}:null,e.request?{request:e.request}:null)}function endpointWithDefaults(e,a,p){return parse(merge(e,a,p))}function withDefaults(e,a){const p=merge(e,a);const t=endpointWithDefaults.bind(null,p);return Object.assign(t,{DEFAULTS:p,defaults:withDefaults.bind(null,p),merge:merge.bind(null,p),parse:parse})}const s="6.0.12";const i=`octokit-endpoint.js/${s} ${r.getUserAgent()}`;const o={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":i},mediaType:{format:"",previews:[]}};const n=withDefaults(null,o);a.endpoint=n},8467:(e,a,p)=>{"use strict";Object.defineProperty(a,"__esModule",{value:true});var t=p(6234);var r=p(5030);const d="4.8.0";function _buildMessageForResponseErrors(e){return`Request failed due to following response errors:\n`+e.errors.map((e=>` - ${e.message}`)).join("\n")}class GraphqlResponseError extends Error{constructor(e,a,p){super(_buildMessageForResponseErrors(p));this.request=e;this.headers=a;this.response=p;this.name="GraphqlResponseError";this.errors=p.errors;this.data=p.data;if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}}}const s=["method","baseUrl","url","headers","request","query","mediaType"];const i=["query","method","url"];const o=/\/api\/v3\/?$/;function graphql(e,a,p){if(p){if(typeof a==="string"&&"query"in p){return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`))}for(const e in p){if(!i.includes(e))continue;return Promise.reject(new Error(`[@octokit/graphql] "${e}" cannot be used as variable name`))}}const t=typeof a==="string"?Object.assign({query:a},p):a;const r=Object.keys(t).reduce(((e,a)=>{if(s.includes(a)){e[a]=t[a];return e}if(!e.variables){e.variables={}}e.variables[a]=t[a];return e}),{});const d=t.baseUrl||e.endpoint.DEFAULTS.baseUrl;if(o.test(d)){r.url=d.replace(o,"/api/graphql")}return e(r).then((e=>{if(e.data.errors){const a={};for(const p of Object.keys(e.headers)){a[p]=e.headers[p]}throw new GraphqlResponseError(r,a,e.data)}return e.data.data}))}function withDefaults(e,a){const p=e.defaults(a);const newApi=(e,a)=>graphql(p,e,a);return Object.assign(newApi,{defaults:withDefaults.bind(null,p),endpoint:t.request.endpoint})}const n=withDefaults(t.request,{headers:{"user-agent":`octokit-graphql.js/${d} ${r.getUserAgent()}`},method:"POST",url:"/graphql"});function withCustomRequest(e){return withDefaults(e,{method:"POST",url:"/graphql"})}a.GraphqlResponseError=GraphqlResponseError;a.graphql=n;a.withCustomRequest=withCustomRequest},4193:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:true});const p="2.21.3";function ownKeys(e,a){var p=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),p.push.apply(p,t)}return p}function _objectSpread2(e){for(var a=1;a({async next(){if(!i)return{done:true};try{const e=await r({method:d,url:i,headers:s});const a=normalizePaginatedListResponse(e);i=((a.headers.link||"").match(/<([^>]+)>;\s*rel="next"/)||[])[1];return{value:a}}catch(e){if(e.status!==409)throw e;i="";return{value:{status:200,headers:{},data:[]}}}}})}}function paginate(e,a,p,t){if(typeof p==="function"){t=p;p=undefined}return gather(e,[],iterator(e,a,p)[Symbol.asyncIterator](),t)}function gather(e,a,p,t){return p.next().then((r=>{if(r.done){return a}let d=false;function done(){d=true}a=a.concat(t?t(r.value,done):r.value.data);if(d){return a}return gather(e,a,p,t)}))}const t=Object.assign(paginate,{iterator:iterator});const r=["GET /app/hook/deliveries","GET /app/installations","GET /applications/grants","GET /authorizations","GET /enterprises/{enterprise}/actions/permissions/organizations","GET /enterprises/{enterprise}/actions/runner-groups","GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations","GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners","GET /enterprises/{enterprise}/actions/runners","GET /enterprises/{enterprise}/audit-log","GET /enterprises/{enterprise}/secret-scanning/alerts","GET /enterprises/{enterprise}/settings/billing/advanced-security","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 /orgs/{org}/actions/cache/usage-by-repository","GET /orgs/{org}/actions/permissions/repositories","GET /orgs/{org}/actions/runner-groups","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}/audit-log","GET /orgs/{org}/blocks","GET /orgs/{org}/code-scanning/alerts","GET /orgs/{org}/codespaces","GET /orgs/{org}/credential-authorizations","GET /orgs/{org}/dependabot/secrets","GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories","GET /orgs/{org}/events","GET /orgs/{org}/external-groups","GET /orgs/{org}/failed_invitations","GET /orgs/{org}/hooks","GET /orgs/{org}/hooks/{hook_id}/deliveries","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}/migrations","GET /orgs/{org}/migrations/{migration_id}/repositories","GET /orgs/{org}/outside_collaborators","GET /orgs/{org}/packages","GET /orgs/{org}/packages/{package_type}/{package_name}/versions","GET /orgs/{org}/projects","GET /orgs/{org}/public_members","GET /orgs/{org}/repos","GET /orgs/{org}/secret-scanning/alerts","GET /orgs/{org}/settings/billing/advanced-security","GET /orgs/{org}/team-sync/groups","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/columns/{column_id}/cards","GET /projects/{project_id}/collaborators","GET /projects/{project_id}/columns","GET /repos/{owner}/{repo}/actions/artifacts","GET /repos/{owner}/{repo}/actions/caches","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/workflows","GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs","GET /repos/{owner}/{repo}/assignees","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}/contributors","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}/events","GET /repos/{owner}/{repo}/forks","GET /repos/{owner}/{repo}/git/matching-refs/{ref}","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}/events","GET /repos/{owner}/{repo}/issues/{issue_number}/labels","GET /repos/{owner}/{repo}/issues/{issue_number}/reactions","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}/requested_reviewers","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}/secret-scanning/alerts","GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations","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 /repositories/{repository_id}/environments/{environment_name}/secrets","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/starred","GET /user/subscriptions","GET /user/teams","GET /users","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}/received_events","GET /users/{username}/received_events/public","GET /users/{username}/repos","GET /users/{username}/starred","GET /users/{username}/subscriptions"];function isPaginatingEndpoint(e){if(typeof e==="string"){return r.includes(e)}else{return false}}function paginateRest(e){return{paginate:Object.assign(paginate.bind(null,e),{iterator:iterator.bind(null,e)})}}paginateRest.VERSION=p;a.composePaginateRest=t;a.isPaginatingEndpoint=isPaginatingEndpoint;a.paginateRest=paginateRest;a.paginatingEndpoints=r},3044:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:true});function ownKeys(e,a){var p=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);if(a){t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))}p.push.apply(p,t)}return p}function _objectSpread2(e){for(var a=1;a{"use strict";Object.defineProperty(a,"__esModule",{value:true});function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var t=p(8932);var r=_interopDefault(p(1223));const d=r((e=>console.warn(e)));const s=r((e=>console.warn(e)));class RequestError extends Error{constructor(e,a,p){super(e);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}this.name="HttpError";this.status=a;let r;if("headers"in p&&typeof p.headers!=="undefined"){r=p.headers}if("response"in p){this.response=p.response;r=p.response.headers}const i=Object.assign({},p.request);if(p.request.headers.authorization){i.headers=Object.assign({},p.request.headers,{authorization:p.request.headers.authorization.replace(/ .*$/," [REDACTED]")})}i.url=i.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]");this.request=i;Object.defineProperty(this,"code",{get(){d(new t.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));return a}});Object.defineProperty(this,"headers",{get(){s(new t.Deprecation("[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`."));return r||{}}})}}a.RequestError=RequestError},6234:(e,a,p)=>{"use strict";Object.defineProperty(a,"__esModule",{value:true});function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var t=p(9440);var r=p(5030);var d=p(3287);var s=_interopDefault(p(467));var i=p(537);const o="5.6.3";function getBufferResponse(e){return e.arrayBuffer()}function fetchWrapper(e){const a=e.request&&e.request.log?e.request.log:console;if(d.isPlainObject(e.body)||Array.isArray(e.body)){e.body=JSON.stringify(e.body)}let p={};let t;let r;const o=e.request&&e.request.fetch||s;return o(e.url,Object.assign({method:e.method,body:e.body,headers:e.headers,redirect:e.redirect},e.request)).then((async d=>{r=d.url;t=d.status;for(const e of d.headers){p[e[0]]=e[1]}if("deprecation"in p){const t=p.link&&p.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 ${p.sunset}${r?`. See ${r}`:""}`)}if(t===204||t===205){return}if(e.method==="HEAD"){if(t<400){return}throw new i.RequestError(d.statusText,t,{response:{url:r,status:t,headers:p,data:undefined},request:e})}if(t===304){throw new i.RequestError("Not modified",t,{response:{url:r,status:t,headers:p,data:await getResponseData(d)},request:e})}if(t>=400){const a=await getResponseData(d);const s=new i.RequestError(toErrorMessage(a),t,{response:{url:r,status:t,headers:p,data:a},request:e});throw s}return getResponseData(d)})).then((e=>({status:t,url:r,headers:p,data:e}))).catch((a=>{if(a instanceof i.RequestError)throw a;throw new i.RequestError(a.message,500,{request:e})}))}async function getResponseData(e){const a=e.headers.get("content-type");if(/application\/json/.test(a)){return e.json()}if(!a||/^text\/|charset=utf-8$/.test(a)){return e.text()}return getBufferResponse(e)}function toErrorMessage(e){if(typeof e==="string")return e;if("message"in e){if(Array.isArray(e.errors)){return`${e.message}: ${e.errors.map(JSON.stringify).join(", ")}`}return e.message}return`Unknown error: ${JSON.stringify(e)}`}function withDefaults(e,a){const p=e.defaults(a);const newApi=function(e,a){const t=p.merge(e,a);if(!t.request||!t.request.hook){return fetchWrapper(p.parse(t))}const request=(e,a)=>fetchWrapper(p.parse(p.merge(e,a)));Object.assign(request,{endpoint:p,defaults:withDefaults.bind(null,p)});return t.request.hook(request,t)};return Object.assign(newApi,{endpoint:p,defaults:withDefaults.bind(null,p)})}const n=withDefaults(t.endpoint,{headers:{"user-agent":`octokit-request.js/${o} ${r.getUserAgent()}`}});a.request=n},3682:(e,a,p)=>{var t=p(4670);var r=p(5549);var d=p(6819);var s=Function.bind;var i=s.bind(s);function bindApi(e,a,p){var t=i(d,null).apply(null,p?[a,p]:[a]);e.api={remove:t};e.remove=t;["before","error","after","wrap"].forEach((function(t){var d=p?[a,t,p]:[a,t];e[t]=e.api[t]=i(r,null).apply(null,d)}))}function HookSingular(){var e="h";var a={registry:{}};var p=t.bind(null,a,e);bindApi(p,a,e);return p}function HookCollection(){var e={registry:{}};var a=t.bind(null,e);bindApi(a,e);return a}var o=false;function Hook(){if(!o){console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4');o=true}return HookCollection()}Hook.Singular=HookSingular.bind();Hook.Collection=HookCollection.bind();e.exports=Hook;e.exports.Hook=Hook;e.exports.Singular=Hook.Singular;e.exports.Collection=Hook.Collection},5549:e=>{e.exports=addHook;function addHook(e,a,p,t){var r=t;if(!e.registry[p]){e.registry[p]=[]}if(a==="before"){t=function(e,a){return Promise.resolve().then(r.bind(null,a)).then(e.bind(null,a))}}if(a==="after"){t=function(e,a){var p;return Promise.resolve().then(e.bind(null,a)).then((function(e){p=e;return r(p,a)})).then((function(){return p}))}}if(a==="error"){t=function(e,a){return Promise.resolve().then(e.bind(null,a)).catch((function(e){return r(e,a)}))}}e.registry[p].push({hook:t,orig:r})}},4670:e=>{e.exports=register;function register(e,a,p,t){if(typeof p!=="function"){throw new Error("method for before hook must be a function")}if(!t){t={}}if(Array.isArray(a)){return a.reverse().reduce((function(a,p){return register.bind(null,e,p,a,t)}),p)()}return Promise.resolve().then((function(){if(!e.registry[a]){return p(t)}return e.registry[a].reduce((function(e,a){return a.hook.bind(null,e,t)}),p)()}))}},6819:e=>{e.exports=removeHook;function removeHook(e,a,p){if(!e.registry[a]){return}var t=e.registry[a].map((function(e){return e.orig})).indexOf(p);if(t===-1){return}e.registry[a].splice(t,1)}},8932:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:true});class Deprecation extends Error{constructor(e){super(e);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}this.name="Deprecation"}}a.Deprecation=Deprecation},3287:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:true}); /*! * is-plain-object *