push-to-registry/dist/index.js
RJ Trujillo e9018d36eb Normalize registry before creating path to destination images
Ensures usernames in the registry path are always lowercase. This fixes
an issue where user's with uppercase letters in their username can't push
to container registries
2023-12-20 16:11:24 -07:00

2 lines
No EOL
70 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

require('./sourcemap-register.js');module.exports=(()=>{var e={351:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){if(r===undefined)r=n;Object.defineProperty(e,r,{enumerable:true,get:function(){return t[n]}})}:function(e,t,n,r){if(r===undefined)r=n;e[r]=t[n]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)if(n!=="default"&&Object.hasOwnProperty.call(e,n))r(t,e,n);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.issue=t.issueCommand=void 0;const s=o(n(87));const a=n(278);function issueCommand(e,t,n){const r=new Command(e,t,n);process.stdout.write(r.toString()+s.EOL)}t.issueCommand=issueCommand;function issue(e,t=""){issueCommand(e,{},t)}t.issue=issue;const u="::";class Command{constructor(e,t,n){if(!e){e="missing.command"}this.command=e;this.properties=t;this.message=n}toString(){let e=u+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";let t=true;for(const n in this.properties){if(this.properties.hasOwnProperty(n)){const r=this.properties[n];if(r){if(t){t=false}else{e+=","}e+=`${n}=${escapeProperty(r)}`}}}}e+=`${u}${escapeData(this.message)}`;return e}}function escapeData(e){return a.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(e){return a.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}},186:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){if(r===undefined)r=n;Object.defineProperty(e,r,{enumerable:true,get:function(){return t[n]}})}:function(e,t,n,r){if(r===undefined)r=n;e[r]=t[n]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)if(n!=="default"&&Object.hasOwnProperty.call(e,n))r(t,e,n);i(t,e);return t};var s=this&&this.__awaiter||function(e,t,n,r){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){i(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:true});t.getIDToken=t.getState=t.saveState=t.group=t.endGroup=t.startGroup=t.info=t.notice=t.warning=t.error=t.debug=t.isDebug=t.setFailed=t.setCommandEcho=t.setOutput=t.getBooleanInput=t.getMultilineInput=t.getInput=t.addPath=t.setSecret=t.exportVariable=t.ExitCode=void 0;const a=n(351);const u=n(717);const c=n(278);const l=o(n(87));const f=o(n(622));const d=n(41);var p;(function(e){e[e["Success"]=0]="Success";e[e["Failure"]=1]="Failure"})(p=t.ExitCode||(t.ExitCode={}));function exportVariable(e,t){const n=c.toCommandValue(t);process.env[e]=n;const r=process.env["GITHUB_ENV"]||"";if(r){return u.issueFileCommand("ENV",u.prepareKeyValueMessage(e,t))}a.issueCommand("set-env",{name:e},n)}t.exportVariable=exportVariable;function setSecret(e){a.issueCommand("add-mask",{},e)}t.setSecret=setSecret;function addPath(e){const t=process.env["GITHUB_PATH"]||"";if(t){u.issueFileCommand("PATH",e)}else{a.issueCommand("add-path",{},e)}process.env["PATH"]=`${e}${f.delimiter}${process.env["PATH"]}`}t.addPath=addPath;function getInput(e,t){const n=process.env[`INPUT_${e.replace(/ /g,"_").toUpperCase()}`]||"";if(t&&t.required&&!n){throw new Error(`Input required and not supplied: ${e}`)}if(t&&t.trimWhitespace===false){return n}return n.trim()}t.getInput=getInput;function getMultilineInput(e,t){const n=getInput(e,t).split("\n").filter(e=>e!=="");if(t&&t.trimWhitespace===false){return n}return n.map(e=>e.trim())}t.getMultilineInput=getMultilineInput;function getBooleanInput(e,t){const n=["true","True","TRUE"];const r=["false","False","FALSE"];const i=getInput(e,t);if(n.includes(i))return true;if(r.includes(i))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\``)}t.getBooleanInput=getBooleanInput;function setOutput(e,t){const n=process.env["GITHUB_OUTPUT"]||"";if(n){return u.issueFileCommand("OUTPUT",u.prepareKeyValueMessage(e,t))}process.stdout.write(l.EOL);a.issueCommand("set-output",{name:e},c.toCommandValue(t))}t.setOutput=setOutput;function setCommandEcho(e){a.issue("echo",e?"on":"off")}t.setCommandEcho=setCommandEcho;function setFailed(e){process.exitCode=p.Failure;error(e)}t.setFailed=setFailed;function isDebug(){return process.env["RUNNER_DEBUG"]==="1"}t.isDebug=isDebug;function debug(e){a.issueCommand("debug",{},e)}t.debug=debug;function error(e,t={}){a.issueCommand("error",c.toCommandProperties(t),e instanceof Error?e.toString():e)}t.error=error;function warning(e,t={}){a.issueCommand("warning",c.toCommandProperties(t),e instanceof Error?e.toString():e)}t.warning=warning;function notice(e,t={}){a.issueCommand("notice",c.toCommandProperties(t),e instanceof Error?e.toString():e)}t.notice=notice;function info(e){process.stdout.write(e+l.EOL)}t.info=info;function startGroup(e){a.issue("group",e)}t.startGroup=startGroup;function endGroup(){a.issue("endgroup")}t.endGroup=endGroup;function group(e,t){return s(this,void 0,void 0,function*(){startGroup(e);let n;try{n=yield t()}finally{endGroup()}return n})}t.group=group;function saveState(e,t){const n=process.env["GITHUB_STATE"]||"";if(n){return u.issueFileCommand("STATE",u.prepareKeyValueMessage(e,t))}a.issueCommand("save-state",{name:e},c.toCommandValue(t))}t.saveState=saveState;function getState(e){return process.env[`STATE_${e}`]||""}t.getState=getState;function getIDToken(e){return s(this,void 0,void 0,function*(){return yield d.OidcClient.getIDToken(e)})}t.getIDToken=getIDToken;var h=n(327);Object.defineProperty(t,"summary",{enumerable:true,get:function(){return h.summary}});var m=n(327);Object.defineProperty(t,"markdownSummary",{enumerable:true,get:function(){return m.markdownSummary}});var g=n(981);Object.defineProperty(t,"toPosixPath",{enumerable:true,get:function(){return g.toPosixPath}});Object.defineProperty(t,"toWin32Path",{enumerable:true,get:function(){return g.toWin32Path}});Object.defineProperty(t,"toPlatformPath",{enumerable:true,get:function(){return g.toPlatformPath}})},717:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){if(r===undefined)r=n;Object.defineProperty(e,r,{enumerable:true,get:function(){return t[n]}})}:function(e,t,n,r){if(r===undefined)r=n;e[r]=t[n]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)if(n!=="default"&&Object.hasOwnProperty.call(e,n))r(t,e,n);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.prepareKeyValueMessage=t.issueFileCommand=void 0;const s=o(n(747));const a=o(n(87));const u=n(521);const c=n(278);function issueFileCommand(e,t){const n=process.env[`GITHUB_${e}`];if(!n){throw new Error(`Unable to find environment variable for file command ${e}`)}if(!s.existsSync(n)){throw new Error(`Missing file at path: ${n}`)}s.appendFileSync(n,`${c.toCommandValue(t)}${a.EOL}`,{encoding:"utf8"})}t.issueFileCommand=issueFileCommand;function prepareKeyValueMessage(e,t){const n=`ghadelimiter_${u.v4()}`;const r=c.toCommandValue(t);if(e.includes(n)){throw new Error(`Unexpected input: name should not contain the delimiter "${n}"`)}if(r.includes(n)){throw new Error(`Unexpected input: value should not contain the delimiter "${n}"`)}return`${e}<<${n}${a.EOL}${r}${a.EOL}${n}`}t.prepareKeyValueMessage=prepareKeyValueMessage},41:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){i(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:true});t.OidcClient=void 0;const i=n(255);const o=n(526);const s=n(186);class OidcClient{static createHttpClient(e=true,t=10){const n={allowRetries:e,maxRetries:t};return new i.HttpClient("actions/oidc-client",[new o.BearerCredentialHandler(OidcClient.getRequestToken())],n)}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 t;return r(this,void 0,void 0,function*(){const n=OidcClient.createHttpClient();const r=yield n.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 i=(t=r.result)===null||t===void 0?void 0:t.value;if(!i){throw new Error("Response json body do not have ID Token field")}return i})}static getIDToken(e){return r(this,void 0,void 0,function*(){try{let t=OidcClient.getIDTokenUrl();if(e){const n=encodeURIComponent(e);t=`${t}&audience=${n}`}s.debug(`ID token url is ${t}`);const n=yield OidcClient.getCall(t);s.setSecret(n);return n}catch(e){throw new Error(`Error message: ${e.message}`)}})}}t.OidcClient=OidcClient},981:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){if(r===undefined)r=n;Object.defineProperty(e,r,{enumerable:true,get:function(){return t[n]}})}:function(e,t,n,r){if(r===undefined)r=n;e[r]=t[n]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)if(n!=="default"&&Object.hasOwnProperty.call(e,n))r(t,e,n);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.toPlatformPath=t.toWin32Path=t.toPosixPath=void 0;const s=o(n(622));function toPosixPath(e){return e.replace(/[\\]/g,"/")}t.toPosixPath=toPosixPath;function toWin32Path(e){return e.replace(/[/]/g,"\\")}t.toWin32Path=toWin32Path;function toPlatformPath(e){return e.replace(/[/\\]/g,s.sep)}t.toPlatformPath=toPlatformPath},327:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){i(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:true});t.summary=t.markdownSummary=t.SUMMARY_DOCS_URL=t.SUMMARY_ENV_VAR=void 0;const i=n(87);const o=n(747);const{access:s,appendFile:a,writeFile:u}=o.promises;t.SUMMARY_ENV_VAR="GITHUB_STEP_SUMMARY";t.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 r(this,void 0,void 0,function*(){if(this._filePath){return this._filePath}const e=process.env[t.SUMMARY_ENV_VAR];if(!e){throw new Error(`Unable to find environment variable for $${t.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`)}try{yield s(e,o.constants.R_OK|o.constants.W_OK)}catch(t){throw new Error(`Unable to access summary file: '${e}'. Check if the file has correct read/write permissions.`)}this._filePath=e;return this._filePath})}wrap(e,t,n={}){const r=Object.entries(n).map(([e,t])=>` ${e}="${t}"`).join("");if(!t){return`<${e}${r}>`}return`<${e}${r}>${t}</${e}>`}write(e){return r(this,void 0,void 0,function*(){const t=!!(e===null||e===void 0?void 0:e.overwrite);const n=yield this.filePath();const r=t?u:a;yield r(n,this._buffer,{encoding:"utf8"});return this.emptyBuffer()})}clear(){return r(this,void 0,void 0,function*(){return this.emptyBuffer().write({overwrite:true})})}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){this._buffer="";return this}addRaw(e,t=false){this._buffer+=e;return t?this.addEOL():this}addEOL(){return this.addRaw(i.EOL)}addCodeBlock(e,t){const n=Object.assign({},t&&{lang:t});const r=this.wrap("pre",this.wrap("code",e),n);return this.addRaw(r).addEOL()}addList(e,t=false){const n=t?"ol":"ul";const r=e.map(e=>this.wrap("li",e)).join("");const i=this.wrap(n,r);return this.addRaw(i).addEOL()}addTable(e){const t=e.map(e=>{const t=e.map(e=>{if(typeof e==="string"){return this.wrap("td",e)}const{header:t,data:n,colspan:r,rowspan:i}=e;const o=t?"th":"td";const s=Object.assign(Object.assign({},r&&{colspan:r}),i&&{rowspan:i});return this.wrap(o,n,s)}).join("");return this.wrap("tr",t)}).join("");const n=this.wrap("table",t);return this.addRaw(n).addEOL()}addDetails(e,t){const n=this.wrap("details",this.wrap("summary",e)+t);return this.addRaw(n).addEOL()}addImage(e,t,n){const{width:r,height:i}=n||{};const o=Object.assign(Object.assign({},r&&{width:r}),i&&{height:i});const s=this.wrap("img",null,Object.assign({src:e,alt:t},o));return this.addRaw(s).addEOL()}addHeading(e,t){const n=`h${t}`;const r=["h1","h2","h3","h4","h5","h6"].includes(n)?n:"h1";const i=this.wrap(r,e);return this.addRaw(i).addEOL()}addSeparator(){const e=this.wrap("hr",null);return this.addRaw(e).addEOL()}addBreak(){const e=this.wrap("br",null);return this.addRaw(e).addEOL()}addQuote(e,t){const n=Object.assign({},t&&{cite:t});const r=this.wrap("blockquote",e,n);return this.addRaw(r).addEOL()}addLink(e,t){const n=this.wrap("a",e,{href:t});return this.addRaw(n).addEOL()}}const c=new Summary;t.markdownSummary=c;t.summary=c},278:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.toCommandProperties=t.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)}t.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}}t.toCommandProperties=toCommandProperties},514:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){if(r===undefined)r=n;Object.defineProperty(e,r,{enumerable:true,get:function(){return t[n]}})}:function(e,t,n,r){if(r===undefined)r=n;e[r]=t[n]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)if(n!=="default"&&Object.hasOwnProperty.call(e,n))r(t,e,n);i(t,e);return t};var s=this&&this.__awaiter||function(e,t,n,r){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){i(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:true});t.getExecOutput=t.exec=void 0;const a=n(304);const u=o(n(159));function exec(e,t,n){return s(this,void 0,void 0,function*(){const r=u.argStringToArray(e);if(r.length===0){throw new Error(`Parameter 'commandLine' cannot be null or empty.`)}const i=r[0];t=r.slice(1).concat(t||[]);const o=new u.ToolRunner(i,t,n);return o.exec()})}t.exec=exec;function getExecOutput(e,t,n){var r,i;return s(this,void 0,void 0,function*(){let o="";let s="";const u=new a.StringDecoder("utf8");const c=new a.StringDecoder("utf8");const l=(r=n===null||n===void 0?void 0:n.listeners)===null||r===void 0?void 0:r.stdout;const f=(i=n===null||n===void 0?void 0:n.listeners)===null||i===void 0?void 0:i.stderr;const d=e=>{s+=c.write(e);if(f){f(e)}};const p=e=>{o+=u.write(e);if(l){l(e)}};const h=Object.assign(Object.assign({},n===null||n===void 0?void 0:n.listeners),{stdout:p,stderr:d});const m=yield exec(e,t,Object.assign(Object.assign({},n),{listeners:h}));o+=u.end();s+=c.end();return{exitCode:m,stdout:o,stderr:s}})}t.getExecOutput=getExecOutput},159:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){if(r===undefined)r=n;Object.defineProperty(e,r,{enumerable:true,get:function(){return t[n]}})}:function(e,t,n,r){if(r===undefined)r=n;e[r]=t[n]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)if(n!=="default"&&Object.hasOwnProperty.call(e,n))r(t,e,n);i(t,e);return t};var s=this&&this.__awaiter||function(e,t,n,r){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){i(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:true});t.argStringToArray=t.ToolRunner=void 0;const a=o(n(87));const u=o(n(614));const c=o(n(129));const l=o(n(622));const f=o(n(436));const d=o(n(962));const p=n(213);const h=process.platform==="win32";class ToolRunner extends u.EventEmitter{constructor(e,t,n){super();if(!e){throw new Error("Parameter 'toolPath' cannot be null or empty.")}this.toolPath=e;this.args=t||[];this.options=n||{}}_debug(e){if(this.options.listeners&&this.options.listeners.debug){this.options.listeners.debug(e)}}_getCommandString(e,t){const n=this._getSpawnFileName();const r=this._getSpawnArgs(e);let i=t?"":"[command]";if(h){if(this._isCmdFile()){i+=n;for(const e of r){i+=` ${e}`}}else if(e.windowsVerbatimArguments){i+=`"${n}"`;for(const e of r){i+=` ${e}`}}else{i+=this._windowsQuoteCmdArg(n);for(const e of r){i+=` ${this._windowsQuoteCmdArg(e)}`}}}else{i+=n;for(const e of r){i+=` ${e}`}}return i}_processLineBuffer(e,t,n){try{let r=t+e.toString();let i=r.indexOf(a.EOL);while(i>-1){const e=r.substring(0,i);n(e);r=r.substring(i+a.EOL.length);i=r.indexOf(a.EOL)}return r}catch(e){this._debug(`error processing line. Failed with error ${e}`);return""}}_getSpawnFileName(){if(h){if(this._isCmdFile()){return process.env["COMSPEC"]||"cmd.exe"}}return this.toolPath}_getSpawnArgs(e){if(h){if(this._isCmdFile()){let t=`/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;for(const n of this.args){t+=" ";t+=e.windowsVerbatimArguments?n:this._windowsQuoteCmdArg(n)}t+='"';return[t]}}return this.args}_endsWith(e,t){return e.endsWith(t)}_isCmdFile(){const e=this.toolPath.toUpperCase();return this._endsWith(e,".CMD")||this._endsWith(e,".BAT")}_windowsQuoteCmdArg(e){if(!this._isCmdFile()){return this._uvQuoteCmdArg(e)}if(!e){return'""'}const t=[" ","\t","&","(",")","[","]","{","}","^","=",";","!","'","+",",","`","~","|","<",">",'"'];let n=false;for(const r of e){if(t.some(e=>e===r)){n=true;break}}if(!n){return e}let r='"';let i=true;for(let t=e.length;t>0;t--){r+=e[t-1];if(i&&e[t-1]==="\\"){r+="\\"}else if(e[t-1]==='"'){i=true;r+='"'}else{i=false}}r+='"';return r.split("").reverse().join("")}_uvQuoteCmdArg(e){if(!e){return'""'}if(!e.includes(" ")&&!e.includes("\t")&&!e.includes('"')){return e}if(!e.includes('"')&&!e.includes("\\")){return`"${e}"`}let t='"';let n=true;for(let r=e.length;r>0;r--){t+=e[r-1];if(n&&e[r-1]==="\\"){t+="\\"}else if(e[r-1]==='"'){n=true;t+="\\"}else{n=false}}t+='"';return t.split("").reverse().join("")}_cloneExecOptions(e){e=e||{};const t={cwd:e.cwd||process.cwd(),env:e.env||process.env,silent:e.silent||false,windowsVerbatimArguments:e.windowsVerbatimArguments||false,failOnStdErr:e.failOnStdErr||false,ignoreReturnCode:e.ignoreReturnCode||false,delay:e.delay||1e4};t.outStream=e.outStream||process.stdout;t.errStream=e.errStream||process.stderr;return t}_getSpawnOptions(e,t){e=e||{};const n={};n.cwd=e.cwd;n.env=e.env;n["windowsVerbatimArguments"]=e.windowsVerbatimArguments||this._isCmdFile();if(e.windowsVerbatimArguments){n.argv0=`"${t}"`}return n}exec(){return s(this,void 0,void 0,function*(){if(!d.isRooted(this.toolPath)&&(this.toolPath.includes("/")||h&&this.toolPath.includes("\\"))){this.toolPath=l.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)}this.toolPath=yield f.which(this.toolPath,true);return new Promise((e,t)=>s(this,void 0,void 0,function*(){this._debug(`exec tool: ${this.toolPath}`);this._debug("arguments:");for(const e of this.args){this._debug(` ${e}`)}const n=this._cloneExecOptions(this.options);if(!n.silent&&n.outStream){n.outStream.write(this._getCommandString(n)+a.EOL)}const r=new ExecState(n,this.toolPath);r.on("debug",e=>{this._debug(e)});if(this.options.cwd&&!(yield d.exists(this.options.cwd))){return t(new Error(`The cwd: ${this.options.cwd} does not exist!`))}const i=this._getSpawnFileName();const o=c.spawn(i,this._getSpawnArgs(n),this._getSpawnOptions(this.options,i));let s="";if(o.stdout){o.stdout.on("data",e=>{if(this.options.listeners&&this.options.listeners.stdout){this.options.listeners.stdout(e)}if(!n.silent&&n.outStream){n.outStream.write(e)}s=this._processLineBuffer(e,s,e=>{if(this.options.listeners&&this.options.listeners.stdline){this.options.listeners.stdline(e)}})})}let u="";if(o.stderr){o.stderr.on("data",e=>{r.processStderr=true;if(this.options.listeners&&this.options.listeners.stderr){this.options.listeners.stderr(e)}if(!n.silent&&n.errStream&&n.outStream){const t=n.failOnStdErr?n.errStream:n.outStream;t.write(e)}u=this._processLineBuffer(e,u,e=>{if(this.options.listeners&&this.options.listeners.errline){this.options.listeners.errline(e)}})})}o.on("error",e=>{r.processError=e.message;r.processExited=true;r.processClosed=true;r.CheckComplete()});o.on("exit",e=>{r.processExitCode=e;r.processExited=true;this._debug(`Exit code ${e} received from tool '${this.toolPath}'`);r.CheckComplete()});o.on("close",e=>{r.processExitCode=e;r.processExited=true;r.processClosed=true;this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);r.CheckComplete()});r.on("done",(n,r)=>{if(s.length>0){this.emit("stdline",s)}if(u.length>0){this.emit("errline",u)}o.removeAllListeners();if(n){t(n)}else{e(r)}});if(this.options.input){if(!o.stdin){throw new Error("child process missing stdin")}o.stdin.end(this.options.input)}}))})}}t.ToolRunner=ToolRunner;function argStringToArray(e){const t=[];let n=false;let r=false;let i="";function append(e){if(r&&e!=='"'){i+="\\"}i+=e;r=false}for(let o=0;o<e.length;o++){const s=e.charAt(o);if(s==='"'){if(!r){n=!n}else{append(s)}continue}if(s==="\\"&&r){append(s);continue}if(s==="\\"&&n){r=true;continue}if(s===" "&&!n){if(i.length>0){t.push(i);i=""}continue}append(s)}if(i.length>0){t.push(i.trim())}return t}t.argStringToArray=argStringToArray;class ExecState extends u.EventEmitter{constructor(e,t){super();this.processClosed=false;this.processError="";this.processExitCode=0;this.processExited=false;this.processStderr=false;this.delay=1e4;this.done=false;this.timeout=null;if(!t){throw new Error("toolPath must not be empty")}this.options=e;this.toolPath=t;if(e.delay){this.delay=e.delay}}CheckComplete(){if(this.done){return}if(this.processClosed){this._setResult()}else if(this.processExited){this.timeout=p.setTimeout(ExecState.HandleTimeout,this.delay,this)}}_debug(e){this.emit("debug",e)}_setResult(){let e;if(this.processExited){if(this.processError){e=new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`)}else if(this.processExitCode!==0&&!this.options.ignoreReturnCode){e=new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`)}else if(this.processStderr&&this.options.failOnStdErr){e=new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`)}}if(this.timeout){clearTimeout(this.timeout);this.timeout=null}this.done=true;this.emit("done",e,this.processExitCode)}static HandleTimeout(e){if(e.done){return}if(!e.processClosed&&e.processExited){const t=`The STDIO streams did not close within ${e.delay/1e3} seconds of the exit event from process '${e.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;e._debug(t)}e._setResult()}}},526:function(e,t){"use strict";var n=this&&this.__awaiter||function(e,t,n,r){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){i(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:true});t.PersonalAccessTokenCredentialHandler=t.BearerCredentialHandler=t.BasicCredentialHandler=void 0;class BasicCredentialHandler{constructor(e,t){this.username=e;this.password=t}prepareRequest(e){if(!e.headers){throw Error("The request has no headers")}e.headers["Authorization"]=`Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`}canHandleAuthentication(){return false}handleAuthentication(){return n(this,void 0,void 0,function*(){throw new Error("not implemented")})}}t.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 n(this,void 0,void 0,function*(){throw new Error("not implemented")})}}t.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 n(this,void 0,void 0,function*(){throw new Error("not implemented")})}}t.PersonalAccessTokenCredentialHandler=PersonalAccessTokenCredentialHandler},255:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){if(r===undefined)r=n;Object.defineProperty(e,r,{enumerable:true,get:function(){return t[n]}})}:function(e,t,n,r){if(r===undefined)r=n;e[r]=t[n]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)if(n!=="default"&&Object.hasOwnProperty.call(e,n))r(t,e,n);i(t,e);return t};var s=this&&this.__awaiter||function(e,t,n,r){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){i(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:true});t.HttpClient=t.isHttps=t.HttpClientResponse=t.HttpClientError=t.getProxyUrl=t.MediaTypes=t.Headers=t.HttpCodes=void 0;const a=o(n(605));const u=o(n(211));const c=o(n(835));const l=o(n(294));var f;(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"})(f=t.HttpCodes||(t.HttpCodes={}));var d;(function(e){e["Accept"]="accept";e["ContentType"]="content-type"})(d=t.Headers||(t.Headers={}));var p;(function(e){e["ApplicationJson"]="application/json"})(p=t.MediaTypes||(t.MediaTypes={}));function getProxyUrl(e){const t=c.getProxyUrl(new URL(e));return t?t.href:""}t.getProxyUrl=getProxyUrl;const h=[f.MovedPermanently,f.ResourceMoved,f.SeeOther,f.TemporaryRedirect,f.PermanentRedirect];const m=[f.BadGateway,f.ServiceUnavailable,f.GatewayTimeout];const g=["OPTIONS","GET","DELETE","HEAD"];const v=10;const w=5;class HttpClientError extends Error{constructor(e,t){super(e);this.name="HttpClientError";this.statusCode=t;Object.setPrototypeOf(this,HttpClientError.prototype)}}t.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 t=Buffer.alloc(0);this.message.on("data",e=>{t=Buffer.concat([t,e])});this.message.on("end",()=>{e(t.toString())})}))})}}t.HttpClientResponse=HttpClientResponse;function isHttps(e){const t=new URL(e);return t.protocol==="https:"}t.isHttps=isHttps;class HttpClient{constructor(e,t,n){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=t||[];this.requestOptions=n;if(n){if(n.ignoreSslError!=null){this._ignoreSslError=n.ignoreSslError}this._socketTimeout=n.socketTimeout;if(n.allowRedirects!=null){this._allowRedirects=n.allowRedirects}if(n.allowRedirectDowngrade!=null){this._allowRedirectDowngrade=n.allowRedirectDowngrade}if(n.maxRedirects!=null){this._maxRedirects=Math.max(n.maxRedirects,0)}if(n.keepAlive!=null){this._keepAlive=n.keepAlive}if(n.allowRetries!=null){this._allowRetries=n.allowRetries}if(n.maxRetries!=null){this._maxRetries=n.maxRetries}}}options(e,t){return s(this,void 0,void 0,function*(){return this.request("OPTIONS",e,null,t||{})})}get(e,t){return s(this,void 0,void 0,function*(){return this.request("GET",e,null,t||{})})}del(e,t){return s(this,void 0,void 0,function*(){return this.request("DELETE",e,null,t||{})})}post(e,t,n){return s(this,void 0,void 0,function*(){return this.request("POST",e,t,n||{})})}patch(e,t,n){return s(this,void 0,void 0,function*(){return this.request("PATCH",e,t,n||{})})}put(e,t,n){return s(this,void 0,void 0,function*(){return this.request("PUT",e,t,n||{})})}head(e,t){return s(this,void 0,void 0,function*(){return this.request("HEAD",e,null,t||{})})}sendStream(e,t,n,r){return s(this,void 0,void 0,function*(){return this.request(e,t,n,r)})}getJson(e,t={}){return s(this,void 0,void 0,function*(){t[d.Accept]=this._getExistingOrDefaultHeader(t,d.Accept,p.ApplicationJson);const n=yield this.get(e,t);return this._processResponse(n,this.requestOptions)})}postJson(e,t,n={}){return s(this,void 0,void 0,function*(){const r=JSON.stringify(t,null,2);n[d.Accept]=this._getExistingOrDefaultHeader(n,d.Accept,p.ApplicationJson);n[d.ContentType]=this._getExistingOrDefaultHeader(n,d.ContentType,p.ApplicationJson);const i=yield this.post(e,r,n);return this._processResponse(i,this.requestOptions)})}putJson(e,t,n={}){return s(this,void 0,void 0,function*(){const r=JSON.stringify(t,null,2);n[d.Accept]=this._getExistingOrDefaultHeader(n,d.Accept,p.ApplicationJson);n[d.ContentType]=this._getExistingOrDefaultHeader(n,d.ContentType,p.ApplicationJson);const i=yield this.put(e,r,n);return this._processResponse(i,this.requestOptions)})}patchJson(e,t,n={}){return s(this,void 0,void 0,function*(){const r=JSON.stringify(t,null,2);n[d.Accept]=this._getExistingOrDefaultHeader(n,d.Accept,p.ApplicationJson);n[d.ContentType]=this._getExistingOrDefaultHeader(n,d.ContentType,p.ApplicationJson);const i=yield this.patch(e,r,n);return this._processResponse(i,this.requestOptions)})}request(e,t,n,r){return s(this,void 0,void 0,function*(){if(this._disposed){throw new Error("Client has already been disposed.")}const i=new URL(t);let o=this._prepareRequest(e,i,r);const s=this._allowRetries&&g.includes(e)?this._maxRetries+1:1;let a=0;let u;do{u=yield this.requestRaw(o,n);if(u&&u.message&&u.message.statusCode===f.Unauthorized){let e;for(const t of this.handlers){if(t.canHandleAuthentication(u)){e=t;break}}if(e){return e.handleAuthentication(this,o,n)}else{return u}}let t=this._maxRedirects;while(u.message.statusCode&&h.includes(u.message.statusCode)&&this._allowRedirects&&t>0){const s=u.message.headers["location"];if(!s){break}const a=new URL(s);if(i.protocol==="https:"&&i.protocol!==a.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 u.readBody();if(a.hostname!==i.hostname){for(const e in r){if(e.toLowerCase()==="authorization"){delete r[e]}}}o=this._prepareRequest(e,a,r);u=yield this.requestRaw(o,n);t--}if(!u.message.statusCode||!m.includes(u.message.statusCode)){return u}a+=1;if(a<s){yield u.readBody();yield this._performExponentialBackoff(a)}}while(a<s);return u})}dispose(){if(this._agent){this._agent.destroy()}this._disposed=true}requestRaw(e,t){return s(this,void 0,void 0,function*(){return new Promise((n,r)=>{function callbackForResult(e,t){if(e){r(e)}else if(!t){r(new Error("Unknown error"))}else{n(t)}}this.requestRawWithCallback(e,t,callbackForResult)})})}requestRawWithCallback(e,t,n){if(typeof t==="string"){if(!e.options.headers){e.options.headers={}}e.options.headers["Content-Length"]=Buffer.byteLength(t,"utf8")}let r=false;function handleResult(e,t){if(!r){r=true;n(e,t)}}const i=e.httpModule.request(e.options,e=>{const t=new HttpClientResponse(e);handleResult(undefined,t)});let o;i.on("socket",e=>{o=e});i.setTimeout(this._socketTimeout||3*6e4,()=>{if(o){o.end()}handleResult(new Error(`Request timeout: ${e.options.path}`))});i.on("error",function(e){handleResult(e)});if(t&&typeof t==="string"){i.write(t,"utf8")}if(t&&typeof t!=="string"){t.on("close",function(){i.end()});t.pipe(i)}else{i.end()}}getAgent(e){const t=new URL(e);return this._getAgent(t)}_prepareRequest(e,t,n){const r={};r.parsedUrl=t;const i=r.parsedUrl.protocol==="https:";r.httpModule=i?u:a;const o=i?443:80;r.options={};r.options.host=r.parsedUrl.hostname;r.options.port=r.parsedUrl.port?parseInt(r.parsedUrl.port):o;r.options.path=(r.parsedUrl.pathname||"")+(r.parsedUrl.search||"");r.options.method=e;r.options.headers=this._mergeHeaders(n);if(this.userAgent!=null){r.options.headers["user-agent"]=this.userAgent}r.options.agent=this._getAgent(r.parsedUrl);if(this.handlers){for(const e of this.handlers){e.prepareRequest(r.options)}}return r}_mergeHeaders(e){if(this.requestOptions&&this.requestOptions.headers){return Object.assign({},y(this.requestOptions.headers),y(e||{}))}return y(e||{})}_getExistingOrDefaultHeader(e,t,n){let r;if(this.requestOptions&&this.requestOptions.headers){r=y(this.requestOptions.headers)[t]}return e[t]||r||n}_getAgent(e){let t;const n=c.getProxyUrl(e);const r=n&&n.hostname;if(this._keepAlive&&r){t=this._proxyAgent}if(this._keepAlive&&!r){t=this._agent}if(t){return t}const i=e.protocol==="https:";let o=100;if(this.requestOptions){o=this.requestOptions.maxSockets||a.globalAgent.maxSockets}if(n&&n.hostname){const e={maxSockets:o,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(n.username||n.password)&&{proxyAuth:`${n.username}:${n.password}`}),{host:n.hostname,port:n.port})};let r;const s=n.protocol==="https:";if(i){r=s?l.httpsOverHttps:l.httpsOverHttp}else{r=s?l.httpOverHttps:l.httpOverHttp}t=r(e);this._proxyAgent=t}if(this._keepAlive&&!t){const e={keepAlive:this._keepAlive,maxSockets:o};t=i?new u.Agent(e):new a.Agent(e);this._agent=t}if(!t){t=i?u.globalAgent:a.globalAgent}if(i&&this._ignoreSslError){t.options=Object.assign(t.options||{},{rejectUnauthorized:false})}return t}_performExponentialBackoff(e){return s(this,void 0,void 0,function*(){e=Math.min(v,e);const t=w*Math.pow(2,e);return new Promise(e=>setTimeout(()=>e(),t))})}_processResponse(e,t){return s(this,void 0,void 0,function*(){return new Promise((n,r)=>s(this,void 0,void 0,function*(){const i=e.message.statusCode||0;const o={statusCode:i,result:null,headers:{}};if(i===f.NotFound){n(o)}function dateTimeDeserializer(e,t){if(typeof t==="string"){const e=new Date(t);if(!isNaN(e.valueOf())){return e}}return t}let s;let a;try{a=yield e.readBody();if(a&&a.length>0){if(t&&t.deserializeDates){s=JSON.parse(a,dateTimeDeserializer)}else{s=JSON.parse(a)}o.result=s}o.headers=e.message.headers}catch(e){}if(i>299){let e;if(s&&s.message){e=s.message}else if(a&&a.length>0){e=a}else{e=`Failed request: (${i})`}const t=new HttpClientError(e,i);t.result=o.result;r(t)}else{n(o)}}))})}}t.HttpClient=HttpClient;const y=e=>Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{})},835:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.checkBypass=t.getProxyUrl=void 0;function getProxyUrl(e){const t=e.protocol==="https:";if(checkBypass(e)){return undefined}const n=(()=>{if(t){return process.env["https_proxy"]||process.env["HTTPS_PROXY"]}else{return process.env["http_proxy"]||process.env["HTTP_PROXY"]}})();if(n){return new URL(n)}else{return undefined}}t.getProxyUrl=getProxyUrl;function checkBypass(e){if(!e.hostname){return false}const t=process.env["no_proxy"]||process.env["NO_PROXY"]||"";if(!t){return false}let n;if(e.port){n=Number(e.port)}else if(e.protocol==="http:"){n=80}else if(e.protocol==="https:"){n=443}const r=[e.hostname.toUpperCase()];if(typeof n==="number"){r.push(`${r[0]}:${n}`)}for(const e of t.split(",").map(e=>e.trim().toUpperCase()).filter(e=>e)){if(r.some(t=>t===e)){return true}}return false}t.checkBypass=checkBypass},962:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){if(r===undefined)r=n;Object.defineProperty(e,r,{enumerable:true,get:function(){return t[n]}})}:function(e,t,n,r){if(r===undefined)r=n;e[r]=t[n]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)if(n!=="default"&&Object.hasOwnProperty.call(e,n))r(t,e,n);i(t,e);return t};var s=this&&this.__awaiter||function(e,t,n,r){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){i(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};var a;Object.defineProperty(t,"__esModule",{value:true});t.getCmdPath=t.tryGetExecutablePath=t.isRooted=t.isDirectory=t.exists=t.IS_WINDOWS=t.unlink=t.symlink=t.stat=t.rmdir=t.rename=t.readlink=t.readdir=t.mkdir=t.lstat=t.copyFile=t.chmod=void 0;const u=o(n(747));const c=o(n(622));a=u.promises,t.chmod=a.chmod,t.copyFile=a.copyFile,t.lstat=a.lstat,t.mkdir=a.mkdir,t.readdir=a.readdir,t.readlink=a.readlink,t.rename=a.rename,t.rmdir=a.rmdir,t.stat=a.stat,t.symlink=a.symlink,t.unlink=a.unlink;t.IS_WINDOWS=process.platform==="win32";function exists(e){return s(this,void 0,void 0,function*(){try{yield t.stat(e)}catch(e){if(e.code==="ENOENT"){return false}throw e}return true})}t.exists=exists;function isDirectory(e,n=false){return s(this,void 0,void 0,function*(){const r=n?yield t.stat(e):yield t.lstat(e);return r.isDirectory()})}t.isDirectory=isDirectory;function isRooted(e){e=normalizeSeparators(e);if(!e){throw new Error('isRooted() parameter "p" cannot be empty')}if(t.IS_WINDOWS){return e.startsWith("\\")||/^[A-Z]:/i.test(e)}return e.startsWith("/")}t.isRooted=isRooted;function tryGetExecutablePath(e,n){return s(this,void 0,void 0,function*(){let r=undefined;try{r=yield t.stat(e)}catch(t){if(t.code!=="ENOENT"){console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${t}`)}}if(r&&r.isFile()){if(t.IS_WINDOWS){const t=c.extname(e).toUpperCase();if(n.some(e=>e.toUpperCase()===t)){return e}}else{if(isUnixExecutable(r)){return e}}}const i=e;for(const o of n){e=i+o;r=undefined;try{r=yield t.stat(e)}catch(t){if(t.code!=="ENOENT"){console.log(`Unexpected error attempting to determine if executable file exists '${e}': ${t}`)}}if(r&&r.isFile()){if(t.IS_WINDOWS){try{const n=c.dirname(e);const r=c.basename(e).toUpperCase();for(const i of yield t.readdir(n)){if(r===i.toUpperCase()){e=c.join(n,i);break}}}catch(t){console.log(`Unexpected error attempting to determine the actual case of the file '${e}': ${t}`)}return e}else{if(isUnixExecutable(r)){return e}}}}return""})}t.tryGetExecutablePath=tryGetExecutablePath;function normalizeSeparators(e){e=e||"";if(t.IS_WINDOWS){e=e.replace(/\//g,"\\");return e.replace(/\\\\+/g,"\\")}return e.replace(/\/\/+/g,"/")}function isUnixExecutable(e){return(e.mode&1)>0||(e.mode&8)>0&&e.gid===process.getgid()||(e.mode&64)>0&&e.uid===process.getuid()}function getCmdPath(){var e;return(e=process.env["COMSPEC"])!==null&&e!==void 0?e:`cmd.exe`}t.getCmdPath=getCmdPath},436:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){if(r===undefined)r=n;Object.defineProperty(e,r,{enumerable:true,get:function(){return t[n]}})}:function(e,t,n,r){if(r===undefined)r=n;e[r]=t[n]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)if(n!=="default"&&Object.hasOwnProperty.call(e,n))r(t,e,n);i(t,e);return t};var s=this&&this.__awaiter||function(e,t,n,r){function adopt(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,i){function fulfilled(e){try{step(r.next(e))}catch(e){i(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){i(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:true});t.findInPath=t.which=t.mkdirP=t.rmRF=t.mv=t.cp=void 0;const a=n(357);const u=o(n(129));const c=o(n(622));const l=n(669);const f=o(n(962));const d=l.promisify(u.exec);const p=l.promisify(u.execFile);function cp(e,t,n={}){return s(this,void 0,void 0,function*(){const{force:r,recursive:i,copySourceDirectory:o}=readCopyOptions(n);const s=(yield f.exists(t))?yield f.stat(t):null;if(s&&s.isFile()&&!r){return}const a=s&&s.isDirectory()&&o?c.join(t,c.basename(e)):t;if(!(yield f.exists(e))){throw new Error(`no such file or directory: ${e}`)}const u=yield f.stat(e);if(u.isDirectory()){if(!i){throw new Error(`Failed to copy. ${e} is a directory, but tried to copy without recursive flag.`)}else{yield cpDirRecursive(e,a,0,r)}}else{if(c.relative(e,a)===""){throw new Error(`'${a}' and '${e}' are the same file`)}yield copyFile(e,a,r)}})}t.cp=cp;function mv(e,t,n={}){return s(this,void 0,void 0,function*(){if(yield f.exists(t)){let r=true;if(yield f.isDirectory(t)){t=c.join(t,c.basename(e));r=yield f.exists(t)}if(r){if(n.force==null||n.force){yield rmRF(t)}else{throw new Error("Destination already exists")}}}yield mkdirP(c.dirname(t));yield f.rename(e,t)})}t.mv=mv;function rmRF(e){return s(this,void 0,void 0,function*(){if(f.IS_WINDOWS){if(/[*"<>|]/.test(e)){throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows')}try{const t=f.getCmdPath();if(yield f.isDirectory(e,true)){yield d(`${t} /s /c "rd /s /q "%inputPath%""`,{env:{inputPath:e}})}else{yield d(`${t} /s /c "del /f /a "%inputPath%""`,{env:{inputPath:e}})}}catch(e){if(e.code!=="ENOENT")throw e}try{yield f.unlink(e)}catch(e){if(e.code!=="ENOENT")throw e}}else{let t=false;try{t=yield f.isDirectory(e)}catch(e){if(e.code!=="ENOENT")throw e;return}if(t){yield p(`rm`,[`-rf`,`${e}`])}else{yield f.unlink(e)}}})}t.rmRF=rmRF;function mkdirP(e){return s(this,void 0,void 0,function*(){a.ok(e,"a path argument must be provided");yield f.mkdir(e,{recursive:true})})}t.mkdirP=mkdirP;function which(e,t){return s(this,void 0,void 0,function*(){if(!e){throw new Error("parameter 'tool' is required")}if(t){const t=yield which(e,false);if(!t){if(f.IS_WINDOWS){throw new Error(`Unable to locate executable file: ${e}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`)}else{throw new Error(`Unable to locate executable file: ${e}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`)}}return t}const n=yield findInPath(e);if(n&&n.length>0){return n[0]}return""})}t.which=which;function findInPath(e){return s(this,void 0,void 0,function*(){if(!e){throw new Error("parameter 'tool' is required")}const t=[];if(f.IS_WINDOWS&&process.env["PATHEXT"]){for(const e of process.env["PATHEXT"].split(c.delimiter)){if(e){t.push(e)}}}if(f.isRooted(e)){const n=yield f.tryGetExecutablePath(e,t);if(n){return[n]}return[]}if(e.includes(c.sep)){return[]}const n=[];if(process.env.PATH){for(const e of process.env.PATH.split(c.delimiter)){if(e){n.push(e)}}}const r=[];for(const i of n){const n=yield f.tryGetExecutablePath(c.join(i,e),t);if(n){r.push(n)}}return r})}t.findInPath=findInPath;function readCopyOptions(e){const t=e.force==null?true:e.force;const n=Boolean(e.recursive);const r=e.copySourceDirectory==null?true:Boolean(e.copySourceDirectory);return{force:t,recursive:n,copySourceDirectory:r}}function cpDirRecursive(e,t,n,r){return s(this,void 0,void 0,function*(){if(n>=255)return;n++;yield mkdirP(t);const i=yield f.readdir(e);for(const o of i){const i=`${e}/${o}`;const s=`${t}/${o}`;const a=yield f.lstat(i);if(a.isDirectory()){yield cpDirRecursive(i,s,n,r)}else{yield copyFile(i,s,r)}}yield f.chmod(t,(yield f.stat(e)).mode)})}function copyFile(e,t,n){return s(this,void 0,void 0,function*(){if((yield f.lstat(e)).isSymbolicLink()){try{yield f.lstat(t);yield f.unlink(t)}catch(e){if(e.code==="EPERM"){yield f.chmod(t,"0666");yield f.unlink(t)}}const n=yield f.readlink(e);yield f.symlink(n,t,f.IS_WINDOWS?"junction":null)}else if(!(yield f.exists(t))||n){yield f.copyFile(e,t)}})}},885:e=>{const{hasOwnProperty:t}=Object.prototype;const n=typeof process!=="undefined"&&process.platform==="win32"?"\r\n":"\n";const r=(e,t)=>{const o=[];let s="";if(typeof t==="string"){t={section:t,whitespace:false}}else{t=t||Object.create(null);t.whitespace=t.whitespace===true}const u=t.whitespace?" = ":"=";for(const t of Object.keys(e)){const r=e[t];if(r&&Array.isArray(r)){for(const e of r)s+=a(t+"[]")+u+a(e)+"\n"}else if(r&&typeof r==="object")o.push(t);else s+=a(t)+u+a(r)+n}if(t.section&&s.length)s="["+a(t.section)+"]"+n+s;for(const a of o){const o=i(a).join("\\.");const u=(t.section?t.section+".":"")+o;const{whitespace:c}=t;const l=r(e[a],{section:u,whitespace:c});if(s.length&&l.length)s+=n;s+=l}return s};const i=e=>e.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(e=>e.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,""));const o=e=>{const n=Object.create(null);let r=n;let o=null;const s=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i;const a=e.split(/[\r\n]+/g);for(const e of a){if(!e||e.match(/^\s*[;#]/))continue;const i=e.match(s);if(!i)continue;if(i[1]!==undefined){o=u(i[1]);if(o==="__proto__"){r=Object.create(null);continue}r=n[o]=n[o]||Object.create(null);continue}const a=u(i[2]);const c=a.length>2&&a.slice(-2)==="[]";const l=c?a.slice(0,-2):a;if(l==="__proto__")continue;const f=i[3]?u(i[4]):true;const d=f==="true"||f==="false"||f==="null"?JSON.parse(f):f;if(c){if(!t.call(r,l))r[l]=[];else if(!Array.isArray(r[l]))r[l]=[r[l]]}if(Array.isArray(r[l]))r[l].push(d);else r[l]=d}const c=[];for(const e of Object.keys(n)){if(!t.call(n,e)||typeof n[e]!=="object"||Array.isArray(n[e]))continue;const r=i(e);let o=n;const s=r.pop();const a=s.replace(/\\\./g,".");for(const e of r){if(e==="__proto__")continue;if(!t.call(o,e)||typeof o[e]!=="object")o[e]=Object.create(null);o=o[e]}if(o===n&&a===s)continue;o[a]=n[e];c.push(e)}for(const e of c)delete n[e];return n};const s=e=>e.charAt(0)==='"'&&e.slice(-1)==='"'||e.charAt(0)==="'"&&e.slice(-1)==="'";const a=e=>typeof e!=="string"||e.match(/[=\r\n]/)||e.match(/^\[/)||e.length>1&&s(e)||e!==e.trim()?JSON.stringify(e):e.replace(/;/g,"\\;").replace(/#/g,"\\#");const u=(e,t)=>{e=(e||"").trim();if(s(e)){if(e.charAt(0)==="'")e=e.substr(1,e.length-2);try{e=JSON.parse(e)}catch(e){}}else{let t=false;let n="";for(let r=0,i=e.length;r<i;r++){const i=e.charAt(r);if(t){if("\\;#".indexOf(i)!==-1)n+=i;else n+="\\"+i;t=false}else if(";#".indexOf(i)!==-1)break;else if(i==="\\")t=true;else n+=i}if(t)n+="\\";return n.trim()}return e};e.exports={parse:o,decode:o,stringify:r,encode:r,safe:a,unsafe:u}},294:(e,t,n)=>{e.exports=n(219)},219:(e,t,n)=>{"use strict";var r=n(631);var i=n(16);var o=n(605);var s=n(211);var a=n(614);var u=n(357);var c=n(669);t.httpOverHttp=httpOverHttp;t.httpsOverHttp=httpsOverHttp;t.httpOverHttps=httpOverHttps;t.httpsOverHttps=httpsOverHttps;function httpOverHttp(e){var t=new TunnelingAgent(e);t.request=o.request;return t}function httpsOverHttp(e){var t=new TunnelingAgent(e);t.request=o.request;t.createSocket=createSecureSocket;t.defaultPort=443;return t}function httpOverHttps(e){var t=new TunnelingAgent(e);t.request=s.request;return t}function httpsOverHttps(e){var t=new TunnelingAgent(e);t.request=s.request;t.createSocket=createSecureSocket;t.defaultPort=443;return t}function TunnelingAgent(e){var t=this;t.options=e||{};t.proxyOptions=t.options.proxy||{};t.maxSockets=t.options.maxSockets||o.Agent.defaultMaxSockets;t.requests=[];t.sockets=[];t.on("free",function onFree(e,n,r,i){var o=toOptions(n,r,i);for(var s=0,a=t.requests.length;s<a;++s){var u=t.requests[s];if(u.host===o.host&&u.port===o.port){t.requests.splice(s,1);u.request.onSocket(e);return}}e.destroy();t.removeSocket(e)})}c.inherits(TunnelingAgent,a.EventEmitter);TunnelingAgent.prototype.addRequest=function addRequest(e,t,n,r){var i=this;var o=mergeOptions({request:e},i.options,toOptions(t,n,r));if(i.sockets.length>=this.maxSockets){i.requests.push(o);return}i.createSocket(o,function(t){t.on("free",onFree);t.on("close",onCloseOrRemove);t.on("agentRemove",onCloseOrRemove);e.onSocket(t);function onFree(){i.emit("free",t,o)}function onCloseOrRemove(e){i.removeSocket(t);t.removeListener("free",onFree);t.removeListener("close",onCloseOrRemove);t.removeListener("agentRemove",onCloseOrRemove)}})};TunnelingAgent.prototype.createSocket=function createSocket(e,t){var n=this;var r={};n.sockets.push(r);var i=mergeOptions({},n.proxyOptions,{method:"CONNECT",path:e.host+":"+e.port,agent:false,headers:{host:e.host+":"+e.port}});if(e.localAddress){i.localAddress=e.localAddress}if(i.proxyAuth){i.headers=i.headers||{};i.headers["Proxy-Authorization"]="Basic "+new Buffer(i.proxyAuth).toString("base64")}l("making CONNECT request");var o=n.request(i);o.useChunkedEncodingByDefault=false;o.once("response",onResponse);o.once("upgrade",onUpgrade);o.once("connect",onConnect);o.once("error",onError);o.end();function onResponse(e){e.upgrade=true}function onUpgrade(e,t,n){process.nextTick(function(){onConnect(e,t,n)})}function onConnect(i,s,a){o.removeAllListeners();s.removeAllListeners();if(i.statusCode!==200){l("tunneling socket could not be established, statusCode=%d",i.statusCode);s.destroy();var u=new Error("tunneling socket could not be established, "+"statusCode="+i.statusCode);u.code="ECONNRESET";e.request.emit("error",u);n.removeSocket(r);return}if(a.length>0){l("got illegal response body from proxy");s.destroy();var u=new Error("got illegal response body from proxy");u.code="ECONNRESET";e.request.emit("error",u);n.removeSocket(r);return}l("tunneling connection has established");n.sockets[n.sockets.indexOf(r)]=s;return t(s)}function onError(t){o.removeAllListeners();l("tunneling socket could not be established, cause=%s\n",t.message,t.stack);var i=new Error("tunneling socket could not be established, "+"cause="+t.message);i.code="ECONNRESET";e.request.emit("error",i);n.removeSocket(r)}};TunnelingAgent.prototype.removeSocket=function removeSocket(e){var t=this.sockets.indexOf(e);if(t===-1){return}this.sockets.splice(t,1);var n=this.requests.shift();if(n){this.createSocket(n,function(e){n.request.onSocket(e)})}};function createSecureSocket(e,t){var n=this;TunnelingAgent.prototype.createSocket.call(n,e,function(r){var o=e.request.getHeader("host");var s=mergeOptions({},n.options,{socket:r,servername:o?o.replace(/:.*$/,""):e.host});var a=i.connect(0,s);n.sockets[n.sockets.indexOf(r)]=a;t(a)})}function toOptions(e,t,n){if(typeof e==="string"){return{host:e,port:t,localAddress:n}}return e}function mergeOptions(e){for(var t=1,n=arguments.length;t<n;++t){var r=arguments[t];if(typeof r==="object"){var i=Object.keys(r);for(var o=0,s=i.length;o<s;++o){var a=i[o];if(r[a]!==undefined){e[a]=r[a]}}}}return e}var l;if(process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)){l=function(){var e=Array.prototype.slice.call(arguments);if(typeof e[0]==="string"){e[0]="TUNNEL: "+e[0]}else{e.unshift("TUNNEL:")}console.error.apply(console,e)}}else{l=function(){}}t.debug=l},521:(e,t,n)=>{"use strict";n.r(t);n.d(t,{NIL:()=>x,parse:()=>g,stringify:()=>l,v1:()=>m,v3:()=>b,v4:()=>O,v5:()=>C,validate:()=>u,version:()=>T});const r=require("crypto");var i=n.n(r);const o=new Uint8Array(256);let s=o.length;function rng(){if(s>o.length-16){i().randomFillSync(o);s=0}return o.slice(s,s+=16)}const a=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function validate(e){return typeof e==="string"&&a.test(e)}const u=validate;const c=[];for(let e=0;e<256;++e){c.push((e+256).toString(16).substr(1))}function stringify(e,t=0){const n=(c[e[t+0]]+c[e[t+1]]+c[e[t+2]]+c[e[t+3]]+"-"+c[e[t+4]]+c[e[t+5]]+"-"+c[e[t+6]]+c[e[t+7]]+"-"+c[e[t+8]]+c[e[t+9]]+"-"+c[e[t+10]]+c[e[t+11]]+c[e[t+12]]+c[e[t+13]]+c[e[t+14]]+c[e[t+15]]).toLowerCase();if(!u(n)){throw TypeError("Stringified UUID is invalid")}return n}const l=stringify;let f;let d;let p=0;let h=0;function v1(e,t,n){let r=t&&n||0;const i=t||new Array(16);e=e||{};let o=e.node||f;let s=e.clockseq!==undefined?e.clockseq:d;if(o==null||s==null){const t=e.random||(e.rng||rng)();if(o==null){o=f=[t[0]|1,t[1],t[2],t[3],t[4],t[5]]}if(s==null){s=d=(t[6]<<8|t[7])&16383}}let a=e.msecs!==undefined?e.msecs:Date.now();let u=e.nsecs!==undefined?e.nsecs:h+1;const c=a-p+(u-h)/1e4;if(c<0&&e.clockseq===undefined){s=s+1&16383}if((c<0||a>p)&&e.nsecs===undefined){u=0}if(u>=1e4){throw new Error("uuid.v1(): Can't create more than 10M uuids/sec")}p=a;h=u;d=s;a+=122192928e5;const m=((a&268435455)*1e4+u)%4294967296;i[r++]=m>>>24&255;i[r++]=m>>>16&255;i[r++]=m>>>8&255;i[r++]=m&255;const g=a/4294967296*1e4&268435455;i[r++]=g>>>8&255;i[r++]=g&255;i[r++]=g>>>24&15|16;i[r++]=g>>>16&255;i[r++]=s>>>8|128;i[r++]=s&255;for(let e=0;e<6;++e){i[r+e]=o[e]}return t||l(i)}const m=v1;function parse(e){if(!u(e)){throw TypeError("Invalid UUID")}let t;const n=new Uint8Array(16);n[0]=(t=parseInt(e.slice(0,8),16))>>>24;n[1]=t>>>16&255;n[2]=t>>>8&255;n[3]=t&255;n[4]=(t=parseInt(e.slice(9,13),16))>>>8;n[5]=t&255;n[6]=(t=parseInt(e.slice(14,18),16))>>>8;n[7]=t&255;n[8]=(t=parseInt(e.slice(19,23),16))>>>8;n[9]=t&255;n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255;n[11]=t/4294967296&255;n[12]=t>>>24&255;n[13]=t>>>16&255;n[14]=t>>>8&255;n[15]=t&255;return n}const g=parse;function stringToBytes(e){e=unescape(encodeURIComponent(e));const t=[];for(let n=0;n<e.length;++n){t.push(e.charCodeAt(n))}return t}const v="6ba7b810-9dad-11d1-80b4-00c04fd430c8";const w="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function v35(e,t,n){function generateUUID(e,r,i,o){if(typeof e==="string"){e=stringToBytes(e)}if(typeof r==="string"){r=g(r)}if(r.length!==16){throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)")}let s=new Uint8Array(16+e.length);s.set(r);s.set(e,r.length);s=n(s);s[6]=s[6]&15|t;s[8]=s[8]&63|128;if(i){o=o||0;for(let e=0;e<16;++e){i[o+e]=s[e]}return i}return l(s)}try{generateUUID.name=e}catch(e){}generateUUID.DNS=v;generateUUID.URL=w;return generateUUID}function md5(e){if(Array.isArray(e)){e=Buffer.from(e)}else if(typeof e==="string"){e=Buffer.from(e,"utf8")}return i().createHash("md5").update(e).digest()}const y=md5;const _=v35("v3",48,y);const b=_;function v4(e,t,n){e=e||{};const r=e.random||(e.rng||rng)();r[6]=r[6]&15|64;r[8]=r[8]&63|128;if(t){n=n||0;for(let e=0;e<16;++e){t[n+e]=r[e]}return t}return l(r)}const O=v4;function sha1(e){if(Array.isArray(e)){e=Buffer.from(e)}else if(typeof e==="string"){e=Buffer.from(e,"utf8")}return i().createHash("sha1").update(e).digest()}const E=sha1;const S=v35("v5",80,E);const C=S;const x="00000000-0000-0000-0000-000000000000";function version(e){if(!u(e)){throw TypeError("Invalid UUID")}return parseInt(e.substr(14,1),16)}const T=version},69:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Outputs=t.Inputs=void 0;var n;(function(e){e["DIGESTFILE"]="digestfile";e["EXTRA_ARGS"]="extra-args";e["IMAGE"]="image";e["PASSWORD"]="password";e["REGISTRY"]="registry";e["TAGS"]="tags";e["TLS_VERIFY"]="tls-verify";e["USERNAME"]="username"})(n=t.Inputs||(t.Inputs={}));var r;(function(e){e["DIGEST"]="digest";e["REGISTRY_PATH"]="registry-path";e["REGISTRY_PATHS"]="registry-paths"})(r=t.Outputs||(t.Outputs={}))},144:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=n(186);const i=n(514);const o=n(436);const s=n(747);const a=n(87);const u=n(622);const c=n(629);const l=n(69);let f;let d=false;let p;let h;let m;let g;async function getPodmanPath(){if(f==null){f=await o.which("podman",true);await execute(f,["version"],{group:true})}return f}async function run(){const e="latest";const t=r.getInput(l.Inputs.REGISTRY);const n=r.getInput(l.Inputs.IMAGE);const i=r.getInput(l.Inputs.TAGS);const o=i.trim().split(/\s+/);if(o.length===0){r.info(`Input "${l.Inputs.TAGS}" is not provided, using default tag "${e}"`);o.push(e)}const a=[];let u=false;for(const e of o){a.push(e.toLowerCase());if(e.toLowerCase()!==e){u=true}}if(u){r.warning(`Reference to tag must be lowercase.`+` Reference has been converted to be compliant with standard.`)}const f=n.toLowerCase();if(n!==f){r.warning(`Reference to image must be lowercase.`+` Reference has been converted to be compliant with standard.`)}const m=t.toLowerCase();if(t!==m){r.warning(`Reference to registry must be lowercase.`+` Reference has been converted to be compliant with standard.`)}const v=r.getInput(l.Inputs.USERNAME);const w=r.getInput(l.Inputs.PASSWORD);const y=r.getInput(l.Inputs.TLS_VERIFY);const _=r.getInput(l.Inputs.DIGESTFILE);const b=c.isFullImageName(a[0]);if(a.some(e=>c.isFullImageName(e)!==b)){throw new Error(`Input "${l.Inputs.TAGS}" cannot have a mix of full name and non full name tags`)}if(!b){if(!f){throw new Error(`Input "${l.Inputs.IMAGE}" must be provided when using non full name tags`)}if(!m){throw new Error(`Input "${l.Inputs.REGISTRY}" must be provided when using non full name tags`)}const e=m.replace(/\/$/,"");const t=`${e}/${f}`;r.info(`Combining image name "${f}" and registry "${m}" `+`to form registry path "${t}"`);if(f.indexOf("/")>-1&&m.indexOf("/")>-1){r.warning(`"${t}" does not seem to be a valid registry path. `+`The registry path should not contain more than 2 slashes. `+`Refer to the Inputs section of the readme for naming image and registry.`)}p=a.map(e=>c.getFullImageName(f,e));h=a.map(e=>c.getFullImageName(t,e))}else{if(f){r.warning(`Input "${l.Inputs.IMAGE}" is ignored when using full name tags`)}if(m){r.warning(`Input "${l.Inputs.REGISTRY}" is ignored when using full name tags`)}p=a;h=a}const O=r.getInput(l.Inputs.EXTRA_ARGS);let E=[];if(O){const e=c.splitByNewline(O);E=e.flatMap(e=>e.split(" ")).map(e=>e.trim())}const S=[];const C=await checkIfManifestsExists();if(!C){const e=await checkImageInPodman();const t=e.foundTags;const n=e.missingTags;if(t.length>0){r.info(`Tag${t.length!==1?"s":""} "${t.join(", ")}" `+`found in Podman image storage`)}if(n.length>0&&t.length>0){r.warning(`Tag${n.length!==1?"s":""} "${n.join(", ")}" `+`not found in Podman image storage`)}const i=await pullImageFromDocker();const o=i.foundTags;const s=i.missingTags;if(o.length>0){r.info(`Tag${o.length!==1?"s":""} "${o.join(", ")}" `+`found in Docker image storage`)}if(s.length>0&&o.length>0){r.warning(`Tag${s.length!==1?"s":""} "${s.join(", ")}" `+`not found in Docker image storage`)}if(n.length>0&&s.length>0){throw new Error(`❌ All tags were not found in either Podman image storage, or Docker image storage. `+`Tag${n.length!==1?"s":""} "${n.join(", ")}" `+`not found in Podman image storage, and tag${s.length!==1?"s":""} `+`"${s.join(", ")}" not found in Docker image storage.`)}const u=t.length===a.length;const c=o.length===a.length;if(u&&c){const e=await isPodmanLocalImageLatest();if(!e){r.warning(`The version of "${p[0]}" in the Docker image storage is more recent `+`than the version in the Podman image storage. The image(s) from the Docker image storage `+`will be pushed.`);d=true}else{r.warning(`The version of "${p[0]}" in the Podman image storage is more recent `+`than the version in the Docker image storage. The image(s) from the Podman image `+`storage will be pushed.`)}}else if(c){r.info(`Tag "${p[0]}" was found in the Docker image storage, but not in the Podman `+`image storage. The image(s) will be pulled into Podman image storage, pushed, and then `+`removed from the Podman image storage.`);d=true}else{r.info(`Tag "${p[0]}" was found in the Podman image storage, but not in the Docker `+`image storage. The image(s) will be pushed from Podman image storage.`)}}let x=`⏳ Pushing "${p.join(", ")}" to "${h.join(", ")}" respectively`;if(v){x+=` as "${v}"`}r.info(x);let T="";if(v&&!w){r.warning("Username is provided, but password is missing")}else if(!v&&w){r.warning("Password is provided, but username is missing")}else if(v&&w){T=`${v}:${w}`}let R=_;if(!R){R=`${p[0].replace(/[/\\/?%*:|"<>]/g,"-")}_digest.txt`}for(let e=0;e<h.length;e++){const t=[];if(d){t.push(...g)}if(C){t.push("manifest")}t.push(...["push","--quiet","--digestfile",R,d?c.getFullDockerImageName(p[e]):p[e],h[e]]);if(C){t.push("--all")}if(E.length>0){t.push(...E)}if(y){t.push(`--tls-verify=${y}`)}if(T){t.push(`--creds=${T}`)}await execute(await getPodmanPath(),t);r.info(`✅ Successfully pushed "${p[e]}" to "${h[e]}"`);S.push(h[e]);try{const e=(await s.promises.readFile(R)).toString();r.info(e);r.setOutput(l.Outputs.DIGEST,e)}catch(e){r.warning(`Failed to read digest file "${R}": ${e}`)}}r.setOutput(l.Outputs.REGISTRY_PATH,S[0]);r.setOutput(l.Outputs.REGISTRY_PATHS,JSON.stringify(S))}async function pullImageFromDocker(){r.info(`🔍 Checking if "${p.join(", ")}" present in the local Docker image storage`);const e=[];const t=[];try{for(const n of p){const r=await execute(await getPodmanPath(),[...g,"pull",`docker-daemon:${n}`],{ignoreReturnCode:true,failOnStdErr:false,group:true});if(r.exitCode===0){e.push(n)}else{t.push(n)}}}catch(e){r.warning(e)}return{foundTags:e,missingTags:t}}async function checkImageInPodman(){r.info(`🔍 Checking if "${p.join(", ")}" present in the local Podman image storage`);const e=[];const t=[];try{for(const n of p){const r=await execute(await getPodmanPath(),["image","exists",n],{ignoreReturnCode:true});if(r.exitCode===0){e.push(n)}else{t.push(n)}}}catch(e){r.debug(e)}return{foundTags:e,missingTags:t}}async function isPodmanLocalImageLatest(){const e=p[0];const t=await execute(await getPodmanPath(),["image","inspect",e,"--format","{{.Created}}"]);const n=await execute(await getPodmanPath(),[...g,"image","inspect",c.getFullDockerImageName(e),"--format","{{.Created}}"]);const r=new Date(t.stdout).getTime();const i=new Date(n.stdout).getTime();return r>i}async function createDockerPodmanImageStroage(){r.info(`Creating temporary Podman image storage for pulling from Docker daemon`);m=await s.promises.mkdtemp(u.join(a.tmpdir(),"podman-from-docker-"));g=["--root",m];if(await c.isStorageDriverOverlay()){const e=await c.findFuseOverlayfsPath();if(e){r.info(`Overriding storage mount_program with "fuse-overlayfs" in environment`);g.push("--storage-opt");g.push(`overlay.mount_program=${e}`)}else{r.warning(`"fuse-overlayfs" is not found. Install it before running this action. `+`For more detail see https://github.com/redhat-actions/buildah-build/issues/45`)}}else{r.info("Storage driver is not 'overlay', so not overriding storage configuration")}}async function removeDockerPodmanImageStroage(){if(m){try{r.info(`Removing temporary Podman image storage for pulling from Docker daemon`);await execute(await getPodmanPath(),[...g,"rmi","-a","-f"]);await s.promises.rmdir(m,{recursive:true})}catch(e){r.warning(`Failed to remove podman image stroage ${m}: ${e}`)}}}async function checkIfManifestsExists(){const e=[];const t=[];r.info(`🔍 Checking if the given image is manifest or not.`);for(const n of p){const r=await execute(await getPodmanPath(),["manifest","exists",n],{ignoreReturnCode:true,group:true});if(r.exitCode===0){e.push(n)}else{t.push(n)}}if(e.length>0){r.info(`Image${e.length!==1?"s":""} "${e.join(", ")}" `+`${e.length!==1?"are manifests":"is a manifest"}.`)}if(e.length>0&&t.length>0){throw new Error(`Manifest${t.length!==1?"s":""} "${t.join(", ")}" `+`not found in the Podman image storage. Make sure that all the provided images are either `+`manifests or container images.`)}return e.length===p.length}async function execute(e,t,n={}){let o="";let s="";const a={...n};a.ignoreReturnCode=true;a.listeners={stdline:e=>{o+=`${e}\n`},errline:e=>{s+=`${e}\n`}};if(n.group){const n=[e,...t].join(" ");r.startGroup(n)}try{const c=await i.exec(e,t,a);if(n.ignoreReturnCode!==true&&c!==0){let t=`${u.basename(e)} exited with code ${c}`;if(s){t+=`\n${s}`}throw new Error(t)}return{exitCode:c,stdout:o,stderr:s}}finally{if(n.group){r.endGroup()}}}async function main(){try{await createDockerPodmanImageStroage();await run()}finally{await removeDockerPodmanImageStroage()}}main().catch(e=>{r.setFailed(e.message)})},629:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getFullDockerImageName=t.getFullImageName=t.isFullImageName=t.splitByNewline=t.findFuseOverlayfsPath=t.isStorageDriverOverlay=void 0;const r=n(885);const i=n(747);const o=n(186);const s=n(622);const a=n(436);const u=n(87);async function findStorageDriver(e){let t="";for(const n of e){o.debug(`Checking if the storage file exists at ${n}`);if(await fileExists(n)){o.debug(`Storage file exists at ${n}`);const e=r.parse(await i.promises.readFile(n,"utf-8"));if(e.storage.driver){t=e.storage.driver}}}return t}async function isStorageDriverOverlay(){let e=s.join(u.homedir(),".config");if(process.env.XDG_CONFIG_HOME){e=process.env.XDG_CONFIG_HOME}const t=["/etc/containers/storage.conf",s.join(e,"containers/storage.conf")];const n=await findStorageDriver(t);return n==="overlay"}t.isStorageDriverOverlay=isStorageDriverOverlay;async function fileExists(e){try{await i.promises.access(e);return true}catch(e){return false}}async function findFuseOverlayfsPath(){let e;try{e=await a.which("fuse-overlayfs")}catch(e){o.debug(e)}return e}t.findFuseOverlayfsPath=findFuseOverlayfsPath;function splitByNewline(e){return e.split(/\r?\n/)}t.splitByNewline=splitByNewline;function isFullImageName(e){return e.indexOf(":")>0}t.isFullImageName=isFullImageName;function getFullImageName(e,t){if(isFullImageName(t)){return t}return`${e}:${t}`}t.getFullImageName=getFullImageName;const c=`docker.io`;const l=c+`/library`;function getFullDockerImageName(e){switch(e.split("/").length){case 1:return`${l}/${e}`;case 2:if(e.includes("amazonaws.com"))return e;return`${c}/${e}`;default:return e}}t.getFullDockerImageName=getFullDockerImageName},357:e=>{"use strict";e.exports=require("assert")},129:e=>{"use strict";e.exports=require("child_process")},614:e=>{"use strict";e.exports=require("events")},747:e=>{"use strict";e.exports=require("fs")},605:e=>{"use strict";e.exports=require("http")},211:e=>{"use strict";e.exports=require("https")},631:e=>{"use strict";e.exports=require("net")},87:e=>{"use strict";e.exports=require("os")},622:e=>{"use strict";e.exports=require("path")},304:e=>{"use strict";e.exports=require("string_decoder")},213:e=>{"use strict";e.exports=require("timers")},16:e=>{"use strict";e.exports=require("tls")},669:e=>{"use strict";e.exports=require("util")}};var t={};function __webpack_require__(n){if(t[n]){return t[n].exports}var r=t[n]={exports:{}};var i=true;try{e[n].call(r.exports,r,r.exports,__webpack_require__);i=false}finally{if(i)delete t[n]}return r.exports}(()=>{__webpack_require__.n=(e=>{var t=e&&e.__esModule?()=>e["default"]:()=>e;__webpack_require__.d(t,{a:t});return t})})();(()=>{__webpack_require__.d=((e,t)=>{for(var n in t){if(__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)){Object.defineProperty(e,n,{enumerable:true,get:t[n]})}}})})();(()=>{__webpack_require__.o=((e,t)=>Object.prototype.hasOwnProperty.call(e,t))})();(()=>{__webpack_require__.r=(e=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})})})();__webpack_require__.ab=__dirname+"/";return __webpack_require__(144)})();
//# sourceMappingURL=index.js.map