mirror of
https://github.com/redhat-actions/buildah-build.git
synced 2025-04-20 09:01:23 +00:00
2 lines
No EOL
67 KiB
JavaScript
2 lines
No EOL
67 KiB
JavaScript
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 o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=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);o(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.issue=t.issueCommand=void 0;const i=s(n(87));const u=n(278);function issueCommand(e,t,n){const r=new Command(e,t,n);process.stdout.write(r.toString()+i.EOL)}t.issueCommand=issueCommand;function issue(e,t=""){issueCommand(e,{},t)}t.issue=issue;const c="::";class Command{constructor(e,t,n){if(!e){e="missing.command"}this.command=e;this.properties=t;this.message=n}toString(){let e=c+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+=`${c}${escapeData(this.message)}`;return e}}function escapeData(e){return u.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(e){return u.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 o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=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);o(t,e);return t};var i=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,o){function fulfilled(e){try{step(r.next(e))}catch(e){o(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){o(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 u=n(351);const c=n(717);const a=n(278);const l=s(n(87));const d=s(n(622));const f=n(521);const p=n(41);var h;(function(e){e[e["Success"]=0]="Success";e[e["Failure"]=1]="Failure"})(h=t.ExitCode||(t.ExitCode={}));function exportVariable(e,t){const n=a.toCommandValue(t);process.env[e]=n;const r=process.env["GITHUB_ENV"]||"";if(r){const t=`ghadelimiter_${f.v4()}`;if(e.includes(t)){throw new Error(`Unexpected input: name should not contain the delimiter "${t}"`)}if(n.includes(t)){throw new Error(`Unexpected input: value should not contain the delimiter "${t}"`)}const r=`${e}<<${t}${l.EOL}${n}${l.EOL}${t}`;c.issueCommand("ENV",r)}else{u.issueCommand("set-env",{name:e},n)}}t.exportVariable=exportVariable;function setSecret(e){u.issueCommand("add-mask",{},e)}t.setSecret=setSecret;function addPath(e){const t=process.env["GITHUB_PATH"]||"";if(t){c.issueCommand("PATH",e)}else{u.issueCommand("add-path",{},e)}process.env["PATH"]=`${e}${d.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!=="");return n}t.getMultilineInput=getMultilineInput;function getBooleanInput(e,t){const n=["true","True","TRUE"];const r=["false","False","FALSE"];const o=getInput(e,t);if(n.includes(o))return true;if(r.includes(o))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){process.stdout.write(l.EOL);u.issueCommand("set-output",{name:e},t)}t.setOutput=setOutput;function setCommandEcho(e){u.issue("echo",e?"on":"off")}t.setCommandEcho=setCommandEcho;function setFailed(e){process.exitCode=h.Failure;error(e)}t.setFailed=setFailed;function isDebug(){return process.env["RUNNER_DEBUG"]==="1"}t.isDebug=isDebug;function debug(e){u.issueCommand("debug",{},e)}t.debug=debug;function error(e,t={}){u.issueCommand("error",a.toCommandProperties(t),e instanceof Error?e.toString():e)}t.error=error;function warning(e,t={}){u.issueCommand("warning",a.toCommandProperties(t),e instanceof Error?e.toString():e)}t.warning=warning;function notice(e,t={}){u.issueCommand("notice",a.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){u.issue("group",e)}t.startGroup=startGroup;function endGroup(){u.issue("endgroup")}t.endGroup=endGroup;function group(e,t){return i(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){u.issueCommand("save-state",{name:e},t)}t.saveState=saveState;function getState(e){return process.env[`STATE_${e}`]||""}t.getState=getState;function getIDToken(e){return i(this,void 0,void 0,function*(){return yield p.OidcClient.getIDToken(e)})}t.getIDToken=getIDToken;var g=n(327);Object.defineProperty(t,"summary",{enumerable:true,get:function(){return g.summary}});var m=n(327);Object.defineProperty(t,"markdownSummary",{enumerable:true,get:function(){return m.markdownSummary}});var v=n(981);Object.defineProperty(t,"toPosixPath",{enumerable:true,get:function(){return v.toPosixPath}});Object.defineProperty(t,"toWin32Path",{enumerable:true,get:function(){return v.toWin32Path}});Object.defineProperty(t,"toPlatformPath",{enumerable:true,get:function(){return v.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 o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=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);o(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.issueCommand=void 0;const i=s(n(747));const u=s(n(87));const c=n(278);function issueCommand(e,t){const n=process.env[`GITHUB_${e}`];if(!n){throw new Error(`Unable to find environment variable for file command ${e}`)}if(!i.existsSync(n)){throw new Error(`Missing file at path: ${n}`)}i.appendFileSync(n,`${c.toCommandValue(t)}${u.EOL}`,{encoding:"utf8"})}t.issueCommand=issueCommand},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,o){function fulfilled(e){try{step(r.next(e))}catch(e){o(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){o(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 o=n(255);const s=n(526);const i=n(186);class OidcClient{static createHttpClient(e=true,t=10){const n={allowRetries:e,maxRetries:t};return new o.HttpClient("actions/oidc-client",[new s.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 o=(t=r.result)===null||t===void 0?void 0:t.value;if(!o){throw new Error("Response json body do not have ID Token field")}return o})}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}`}i.debug(`ID token url is ${t}`);const n=yield OidcClient.getCall(t);i.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 o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=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);o(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.toPlatformPath=t.toWin32Path=t.toPosixPath=void 0;const i=s(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,i.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,o){function fulfilled(e){try{step(r.next(e))}catch(e){o(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){o(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 o=n(87);const s=n(747);const{access:i,appendFile:u,writeFile:c}=s.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 i(e,s.constants.R_OK|s.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?c:u;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(o.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 o=this.wrap(n,r);return this.addRaw(o).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:o}=e;const s=t?"th":"td";const i=Object.assign(Object.assign({},r&&{colspan:r}),o&&{rowspan:o});return this.wrap(s,n,i)}).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:o}=n||{};const s=Object.assign(Object.assign({},r&&{width:r}),o&&{height:o});const i=this.wrap("img",null,Object.assign({src:e,alt:t},s));return this.addRaw(i).addEOL()}addHeading(e,t){const n=`h${t}`;const r=["h1","h2","h3","h4","h5","h6"].includes(n)?n:"h1";const o=this.wrap(r,e);return this.addRaw(o).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 a=new Summary;t.markdownSummary=a;t.summary=a},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.__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,o){function fulfilled(e){try{step(r.next(e))}catch(e){o(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){o(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)if(Object.hasOwnProperty.call(e,n))t[n]=e[n];t["default"]=e;return t};Object.defineProperty(t,"__esModule",{value:true});const s=o(n(159));function exec(e,t,n){return r(this,void 0,void 0,function*(){const r=s.argStringToArray(e);if(r.length===0){throw new Error(`Parameter 'commandLine' cannot be null or empty.`)}const o=r[0];t=r.slice(1).concat(t||[]);const i=new s.ToolRunner(o,t,n);return i.exec()})}t.exec=exec},159: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,o){function fulfilled(e){try{step(r.next(e))}catch(e){o(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){o(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)if(Object.hasOwnProperty.call(e,n))t[n]=e[n];t["default"]=e;return t};Object.defineProperty(t,"__esModule",{value:true});const s=o(n(87));const i=o(n(614));const u=o(n(129));const c=o(n(622));const a=o(n(436));const l=o(n(962));const d=process.platform==="win32";class ToolRunner extends i.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 o=t?"":"[command]";if(d){if(this._isCmdFile()){o+=n;for(const e of r){o+=` ${e}`}}else if(e.windowsVerbatimArguments){o+=`"${n}"`;for(const e of r){o+=` ${e}`}}else{o+=this._windowsQuoteCmdArg(n);for(const e of r){o+=` ${this._windowsQuoteCmdArg(e)}`}}}else{o+=n;for(const e of r){o+=` ${e}`}}return o}_processLineBuffer(e,t,n){try{let r=t+e.toString();let o=r.indexOf(s.EOL);while(o>-1){const e=r.substring(0,o);n(e);r=r.substring(o+s.EOL.length);o=r.indexOf(s.EOL)}t=r}catch(e){this._debug(`error processing line. Failed with error ${e}`)}}_getSpawnFileName(){if(d){if(this._isCmdFile()){return process.env["COMSPEC"]||"cmd.exe"}}return this.toolPath}_getSpawnArgs(e){if(d){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 o=true;for(let t=e.length;t>0;t--){r+=e[t-1];if(o&&e[t-1]==="\\"){r+="\\"}else if(e[t-1]==='"'){o=true;r+='"'}else{o=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 r(this,void 0,void 0,function*(){if(!l.isRooted(this.toolPath)&&(this.toolPath.includes("/")||d&&this.toolPath.includes("\\"))){this.toolPath=c.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)}this.toolPath=yield a.which(this.toolPath,true);return new Promise((e,t)=>{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)+s.EOL)}const r=new ExecState(n,this.toolPath);r.on("debug",e=>{this._debug(e)});const o=this._getSpawnFileName();const i=u.spawn(o,this._getSpawnArgs(n),this._getSpawnOptions(this.options,o));const c="";if(i.stdout){i.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)}this._processLineBuffer(e,c,e=>{if(this.options.listeners&&this.options.listeners.stdline){this.options.listeners.stdline(e)}})})}const a="";if(i.stderr){i.stderr.on("data",e=>{r.processStderr=true;if(this.options.listeners&&this.options.listeners.stderr){this.options.listeners.stderr(e)}if(!n.silent&&n.errStream&&n.outStream){const t=n.failOnStdErr?n.errStream:n.outStream;t.write(e)}this._processLineBuffer(e,a,e=>{if(this.options.listeners&&this.options.listeners.errline){this.options.listeners.errline(e)}})})}i.on("error",e=>{r.processError=e.message;r.processExited=true;r.processClosed=true;r.CheckComplete()});i.on("exit",e=>{r.processExitCode=e;r.processExited=true;this._debug(`Exit code ${e} received from tool '${this.toolPath}'`);r.CheckComplete()});i.on("close",e=>{r.processExitCode=e;r.processExited=true;r.processClosed=true;this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);r.CheckComplete()});r.on("done",(n,r)=>{if(c.length>0){this.emit("stdline",c)}if(a.length>0){this.emit("errline",a)}i.removeAllListeners();if(n){t(n)}else{e(r)}});if(this.options.input){if(!i.stdin){throw new Error("child process missing stdin")}i.stdin.end(this.options.input)}})})}}t.ToolRunner=ToolRunner;function argStringToArray(e){const t=[];let n=false;let r=false;let o="";function append(e){if(r&&e!=='"'){o+="\\"}o+=e;r=false}for(let s=0;s<e.length;s++){const i=e.charAt(s);if(i==='"'){if(!r){n=!n}else{append(i)}continue}if(i==="\\"&&r){append(i);continue}if(i==="\\"&&n){r=true;continue}if(i===" "&&!n){if(o.length>0){t.push(o);o=""}continue}append(i)}if(o.length>0){t.push(o.trim())}return t}t.argStringToArray=argStringToArray;class ExecState extends i.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=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,o){function fulfilled(e){try{step(r.next(e))}catch(e){o(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){o(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 o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=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);o(t,e);return t};var i=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,o){function fulfilled(e){try{step(r.next(e))}catch(e){o(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){o(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 u=s(n(605));const c=s(n(211));const a=s(n(835));const l=s(n(294));var d;(function(e){e[e["OK"]=200]="OK";e[e["MultipleChoices"]=300]="MultipleChoices";e[e["MovedPermanently"]=301]="MovedPermanently";e[e["ResourceMoved"]=302]="ResourceMoved";e[e["SeeOther"]=303]="SeeOther";e[e["NotModified"]=304]="NotModified";e[e["UseProxy"]=305]="UseProxy";e[e["SwitchProxy"]=306]="SwitchProxy";e[e["TemporaryRedirect"]=307]="TemporaryRedirect";e[e["PermanentRedirect"]=308]="PermanentRedirect";e[e["BadRequest"]=400]="BadRequest";e[e["Unauthorized"]=401]="Unauthorized";e[e["PaymentRequired"]=402]="PaymentRequired";e[e["Forbidden"]=403]="Forbidden";e[e["NotFound"]=404]="NotFound";e[e["MethodNotAllowed"]=405]="MethodNotAllowed";e[e["NotAcceptable"]=406]="NotAcceptable";e[e["ProxyAuthenticationRequired"]=407]="ProxyAuthenticationRequired";e[e["RequestTimeout"]=408]="RequestTimeout";e[e["Conflict"]=409]="Conflict";e[e["Gone"]=410]="Gone";e[e["TooManyRequests"]=429]="TooManyRequests";e[e["InternalServerError"]=500]="InternalServerError";e[e["NotImplemented"]=501]="NotImplemented";e[e["BadGateway"]=502]="BadGateway";e[e["ServiceUnavailable"]=503]="ServiceUnavailable";e[e["GatewayTimeout"]=504]="GatewayTimeout"})(d=t.HttpCodes||(t.HttpCodes={}));var f;(function(e){e["Accept"]="accept";e["ContentType"]="content-type"})(f=t.Headers||(t.Headers={}));var p;(function(e){e["ApplicationJson"]="application/json"})(p=t.MediaTypes||(t.MediaTypes={}));function getProxyUrl(e){const t=a.getProxyUrl(new URL(e));return t?t.href:""}t.getProxyUrl=getProxyUrl;const h=[d.MovedPermanently,d.ResourceMoved,d.SeeOther,d.TemporaryRedirect,d.PermanentRedirect];const g=[d.BadGateway,d.ServiceUnavailable,d.GatewayTimeout];const m=["OPTIONS","GET","DELETE","HEAD"];const v=10;const y=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 i(this,void 0,void 0,function*(){return new Promise(e=>i(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 i(this,void 0,void 0,function*(){return this.request("OPTIONS",e,null,t||{})})}get(e,t){return i(this,void 0,void 0,function*(){return this.request("GET",e,null,t||{})})}del(e,t){return i(this,void 0,void 0,function*(){return this.request("DELETE",e,null,t||{})})}post(e,t,n){return i(this,void 0,void 0,function*(){return this.request("POST",e,t,n||{})})}patch(e,t,n){return i(this,void 0,void 0,function*(){return this.request("PATCH",e,t,n||{})})}put(e,t,n){return i(this,void 0,void 0,function*(){return this.request("PUT",e,t,n||{})})}head(e,t){return i(this,void 0,void 0,function*(){return this.request("HEAD",e,null,t||{})})}sendStream(e,t,n,r){return i(this,void 0,void 0,function*(){return this.request(e,t,n,r)})}getJson(e,t={}){return i(this,void 0,void 0,function*(){t[f.Accept]=this._getExistingOrDefaultHeader(t,f.Accept,p.ApplicationJson);const n=yield this.get(e,t);return this._processResponse(n,this.requestOptions)})}postJson(e,t,n={}){return i(this,void 0,void 0,function*(){const r=JSON.stringify(t,null,2);n[f.Accept]=this._getExistingOrDefaultHeader(n,f.Accept,p.ApplicationJson);n[f.ContentType]=this._getExistingOrDefaultHeader(n,f.ContentType,p.ApplicationJson);const o=yield this.post(e,r,n);return this._processResponse(o,this.requestOptions)})}putJson(e,t,n={}){return i(this,void 0,void 0,function*(){const r=JSON.stringify(t,null,2);n[f.Accept]=this._getExistingOrDefaultHeader(n,f.Accept,p.ApplicationJson);n[f.ContentType]=this._getExistingOrDefaultHeader(n,f.ContentType,p.ApplicationJson);const o=yield this.put(e,r,n);return this._processResponse(o,this.requestOptions)})}patchJson(e,t,n={}){return i(this,void 0,void 0,function*(){const r=JSON.stringify(t,null,2);n[f.Accept]=this._getExistingOrDefaultHeader(n,f.Accept,p.ApplicationJson);n[f.ContentType]=this._getExistingOrDefaultHeader(n,f.ContentType,p.ApplicationJson);const o=yield this.patch(e,r,n);return this._processResponse(o,this.requestOptions)})}request(e,t,n,r){return i(this,void 0,void 0,function*(){if(this._disposed){throw new Error("Client has already been disposed.")}const o=new URL(t);let s=this._prepareRequest(e,o,r);const i=this._allowRetries&&m.includes(e)?this._maxRetries+1:1;let u=0;let c;do{c=yield this.requestRaw(s,n);if(c&&c.message&&c.message.statusCode===d.Unauthorized){let e;for(const t of this.handlers){if(t.canHandleAuthentication(c)){e=t;break}}if(e){return e.handleAuthentication(this,s,n)}else{return c}}let t=this._maxRedirects;while(c.message.statusCode&&h.includes(c.message.statusCode)&&this._allowRedirects&&t>0){const i=c.message.headers["location"];if(!i){break}const u=new URL(i);if(o.protocol==="https:"&&o.protocol!==u.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 c.readBody();if(u.hostname!==o.hostname){for(const e in r){if(e.toLowerCase()==="authorization"){delete r[e]}}}s=this._prepareRequest(e,u,r);c=yield this.requestRaw(s,n);t--}if(!c.message.statusCode||!g.includes(c.message.statusCode)){return c}u+=1;if(u<i){yield c.readBody();yield this._performExponentialBackoff(u)}}while(u<i);return c})}dispose(){if(this._agent){this._agent.destroy()}this._disposed=true}requestRaw(e,t){return i(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 o=e.httpModule.request(e.options,e=>{const t=new HttpClientResponse(e);handleResult(undefined,t)});let s;o.on("socket",e=>{s=e});o.setTimeout(this._socketTimeout||3*6e4,()=>{if(s){s.end()}handleResult(new Error(`Request timeout: ${e.options.path}`))});o.on("error",function(e){handleResult(e)});if(t&&typeof t==="string"){o.write(t,"utf8")}if(t&&typeof t!=="string"){t.on("close",function(){o.end()});t.pipe(o)}else{o.end()}}getAgent(e){const t=new URL(e);return this._getAgent(t)}_prepareRequest(e,t,n){const r={};r.parsedUrl=t;const o=r.parsedUrl.protocol==="https:";r.httpModule=o?c:u;const s=o?443:80;r.options={};r.options.host=r.parsedUrl.hostname;r.options.port=r.parsedUrl.port?parseInt(r.parsedUrl.port):s;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({},w(this.requestOptions.headers),w(e||{}))}return w(e||{})}_getExistingOrDefaultHeader(e,t,n){let r;if(this.requestOptions&&this.requestOptions.headers){r=w(this.requestOptions.headers)[t]}return e[t]||r||n}_getAgent(e){let t;const n=a.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 o=e.protocol==="https:";let s=100;if(this.requestOptions){s=this.requestOptions.maxSockets||u.globalAgent.maxSockets}if(n&&n.hostname){const e={maxSockets:s,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 i=n.protocol==="https:";if(o){r=i?l.httpsOverHttps:l.httpsOverHttp}else{r=i?l.httpOverHttps:l.httpOverHttp}t=r(e);this._proxyAgent=t}if(this._keepAlive&&!t){const e={keepAlive:this._keepAlive,maxSockets:s};t=o?new c.Agent(e):new u.Agent(e);this._agent=t}if(!t){t=o?c.globalAgent:u.globalAgent}if(o&&this._ignoreSslError){t.options=Object.assign(t.options||{},{rejectUnauthorized:false})}return t}_performExponentialBackoff(e){return i(this,void 0,void 0,function*(){e=Math.min(v,e);const t=y*Math.pow(2,e);return new Promise(e=>setTimeout(()=>e(),t))})}_processResponse(e,t){return i(this,void 0,void 0,function*(){return new Promise((n,r)=>i(this,void 0,void 0,function*(){const o=e.message.statusCode||0;const s={statusCode:o,result:null,headers:{}};if(o===d.NotFound){n(s)}function dateTimeDeserializer(e,t){if(typeof t==="string"){const e=new Date(t);if(!isNaN(e.valueOf())){return e}}return t}let i;let u;try{u=yield e.readBody();if(u&&u.length>0){if(t&&t.deserializeDates){i=JSON.parse(u,dateTimeDeserializer)}else{i=JSON.parse(u)}s.result=i}s.headers=e.message.headers}catch(e){}if(o>299){let e;if(i&&i.message){e=i.message}else if(u&&u.length>0){e=u}else{e=`Failed request: (${o})`}const t=new HttpClientError(e,o);t.result=s.result;r(t)}else{n(s)}}))})}}t.HttpClient=HttpClient;const w=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.__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,o){function fulfilled(e){try{step(r.next(e))}catch(e){o(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){o(e)}}function step(e){e.done?n(e.value):adopt(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};var o;Object.defineProperty(t,"__esModule",{value:true});const s=n(357);const i=n(747);const u=n(622);o=i.promises,t.chmod=o.chmod,t.copyFile=o.copyFile,t.lstat=o.lstat,t.mkdir=o.mkdir,t.readdir=o.readdir,t.readlink=o.readlink,t.rename=o.rename,t.rmdir=o.rmdir,t.stat=o.stat,t.symlink=o.symlink,t.unlink=o.unlink;t.IS_WINDOWS=process.platform==="win32";function exists(e){return r(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 r(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 mkdirP(e,n=1e3,o=1){return r(this,void 0,void 0,function*(){s.ok(e,"a path argument must be provided");e=u.resolve(e);if(o>=n)return t.mkdir(e);try{yield t.mkdir(e);return}catch(r){switch(r.code){case"ENOENT":{yield mkdirP(u.dirname(e),n,o+1);yield t.mkdir(e);return}default:{let n;try{n=yield t.stat(e)}catch(e){throw r}if(!n.isDirectory())throw r}}}})}t.mkdirP=mkdirP;function tryGetExecutablePath(e,n){return r(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=u.extname(e).toUpperCase();if(n.some(e=>e.toUpperCase()===t)){return e}}else{if(isUnixExecutable(r)){return e}}}const o=e;for(const s of n){e=o+s;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=u.dirname(e);const r=u.basename(e).toUpperCase();for(const o of yield t.readdir(n)){if(r===o.toUpperCase()){e=u.join(n,o);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()}},436: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,o){function fulfilled(e){try{step(r.next(e))}catch(e){o(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){o(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});const o=n(129);const s=n(622);const i=n(669);const u=n(962);const c=i.promisify(o.exec);function cp(e,t,n={}){return r(this,void 0,void 0,function*(){const{force:r,recursive:o}=readCopyOptions(n);const i=(yield u.exists(t))?yield u.stat(t):null;if(i&&i.isFile()&&!r){return}const c=i&&i.isDirectory()?s.join(t,s.basename(e)):t;if(!(yield u.exists(e))){throw new Error(`no such file or directory: ${e}`)}const a=yield u.stat(e);if(a.isDirectory()){if(!o){throw new Error(`Failed to copy. ${e} is a directory, but tried to copy without recursive flag.`)}else{yield cpDirRecursive(e,c,0,r)}}else{if(s.relative(e,c)===""){throw new Error(`'${c}' and '${e}' are the same file`)}yield copyFile(e,c,r)}})}t.cp=cp;function mv(e,t,n={}){return r(this,void 0,void 0,function*(){if(yield u.exists(t)){let r=true;if(yield u.isDirectory(t)){t=s.join(t,s.basename(e));r=yield u.exists(t)}if(r){if(n.force==null||n.force){yield rmRF(t)}else{throw new Error("Destination already exists")}}}yield mkdirP(s.dirname(t));yield u.rename(e,t)})}t.mv=mv;function rmRF(e){return r(this,void 0,void 0,function*(){if(u.IS_WINDOWS){try{if(yield u.isDirectory(e,true)){yield c(`rd /s /q "${e}"`)}else{yield c(`del /f /a "${e}"`)}}catch(e){if(e.code!=="ENOENT")throw e}try{yield u.unlink(e)}catch(e){if(e.code!=="ENOENT")throw e}}else{let t=false;try{t=yield u.isDirectory(e)}catch(e){if(e.code!=="ENOENT")throw e;return}if(t){yield c(`rm -rf "${e}"`)}else{yield u.unlink(e)}}})}t.rmRF=rmRF;function mkdirP(e){return r(this,void 0,void 0,function*(){yield u.mkdirP(e)})}t.mkdirP=mkdirP;function which(e,t){return r(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(u.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.`)}}}try{const t=[];if(u.IS_WINDOWS&&process.env.PATHEXT){for(const e of process.env.PATHEXT.split(s.delimiter)){if(e){t.push(e)}}}if(u.isRooted(e)){const n=yield u.tryGetExecutablePath(e,t);if(n){return n}return""}if(e.includes("/")||u.IS_WINDOWS&&e.includes("\\")){return""}const n=[];if(process.env.PATH){for(const e of process.env.PATH.split(s.delimiter)){if(e){n.push(e)}}}for(const r of n){const n=yield u.tryGetExecutablePath(r+s.sep+e,t);if(n){return n}}return""}catch(e){throw new Error(`which failed with message ${e.message}`)}})}t.which=which;function readCopyOptions(e){const t=e.force==null?true:e.force;const n=Boolean(e.recursive);return{force:t,recursive:n}}function cpDirRecursive(e,t,n,o){return r(this,void 0,void 0,function*(){if(n>=255)return;n++;yield mkdirP(t);const r=yield u.readdir(e);for(const s of r){const r=`${e}/${s}`;const i=`${t}/${s}`;const c=yield u.lstat(r);if(c.isDirectory()){yield cpDirRecursive(r,i,n,o)}else{yield copyFile(r,i,o)}}yield u.chmod(t,(yield u.stat(e)).mode)})}function copyFile(e,t,n){return r(this,void 0,void 0,function*(){if((yield u.lstat(e)).isSymbolicLink()){try{yield u.lstat(t);yield u.unlink(t)}catch(e){if(e.code==="EPERM"){yield u.chmod(t,"0666");yield u.unlink(t)}}const n=yield u.readlink(e);yield u.symlink(n,t,u.IS_WINDOWS?"junction":null)}else if(!(yield u.exists(t))||n){yield u.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 s=[];let i="";if(typeof t==="string"){t={section:t,whitespace:false}}else{t=t||Object.create(null);t.whitespace=t.whitespace===true}const c=t.whitespace?" = ":"=";for(const t of Object.keys(e)){const r=e[t];if(r&&Array.isArray(r)){for(const e of r)i+=u(t+"[]")+c+u(e)+"\n"}else if(r&&typeof r==="object")s.push(t);else i+=u(t)+c+u(r)+n}if(t.section&&i.length)i="["+u(t.section)+"]"+n+i;for(const u of s){const s=o(u).join("\\.");const c=(t.section?t.section+".":"")+s;const{whitespace:a}=t;const l=r(e[u],{section:c,whitespace:a});if(i.length&&l.length)i+=n;i+=l}return i};const o=e=>e.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(e=>e.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,""));const s=e=>{const n=Object.create(null);let r=n;let s=null;const i=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i;const u=e.split(/[\r\n]+/g);for(const e of u){if(!e||e.match(/^\s*[;#]/))continue;const o=e.match(i);if(!o)continue;if(o[1]!==undefined){s=c(o[1]);if(s==="__proto__"){r=Object.create(null);continue}r=n[s]=n[s]||Object.create(null);continue}const u=c(o[2]);const a=u.length>2&&u.slice(-2)==="[]";const l=a?u.slice(0,-2):u;if(l==="__proto__")continue;const d=o[3]?c(o[4]):true;const f=d==="true"||d==="false"||d==="null"?JSON.parse(d):d;if(a){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(f);else r[l]=f}const a=[];for(const e of Object.keys(n)){if(!t.call(n,e)||typeof n[e]!=="object"||Array.isArray(n[e]))continue;const r=o(e);let s=n;const i=r.pop();const u=i.replace(/\\\./g,".");for(const e of r){if(e==="__proto__")continue;if(!t.call(s,e)||typeof s[e]!=="object")s[e]=Object.create(null);s=s[e]}if(s===n&&u===i)continue;s[u]=n[e];a.push(e)}for(const e of a)delete n[e];return n};const i=e=>e.charAt(0)==='"'&&e.slice(-1)==='"'||e.charAt(0)==="'"&&e.slice(-1)==="'";const u=e=>typeof e!=="string"||e.match(/[=\r\n]/)||e.match(/^\[/)||e.length>1&&i(e)||e!==e.trim()?JSON.stringify(e):e.replace(/;/g,"\\;").replace(/#/g,"\\#");const c=(e,t)=>{e=(e||"").trim();if(i(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,o=e.length;r<o;r++){const o=e.charAt(r);if(t){if("\\;#".indexOf(o)!==-1)n+=o;else n+="\\"+o;t=false}else if(";#".indexOf(o)!==-1)break;else if(o==="\\")t=true;else n+=o}if(t)n+="\\";return n.trim()}return e};e.exports={parse:s,decode:s,stringify:r,encode:r,safe:u,unsafe:c}},294:(e,t,n)=>{e.exports=n(219)},219:(e,t,n)=>{"use strict";var r=n(631);var o=n(16);var s=n(605);var i=n(211);var u=n(614);var c=n(357);var a=n(669);t.httpOverHttp=httpOverHttp;t.httpsOverHttp=httpsOverHttp;t.httpOverHttps=httpOverHttps;t.httpsOverHttps=httpsOverHttps;function httpOverHttp(e){var t=new TunnelingAgent(e);t.request=s.request;return t}function httpsOverHttp(e){var t=new TunnelingAgent(e);t.request=s.request;t.createSocket=createSecureSocket;t.defaultPort=443;return t}function httpOverHttps(e){var t=new TunnelingAgent(e);t.request=i.request;return t}function httpsOverHttps(e){var t=new TunnelingAgent(e);t.request=i.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||s.Agent.defaultMaxSockets;t.requests=[];t.sockets=[];t.on("free",function onFree(e,n,r,o){var s=toOptions(n,r,o);for(var i=0,u=t.requests.length;i<u;++i){var c=t.requests[i];if(c.host===s.host&&c.port===s.port){t.requests.splice(i,1);c.request.onSocket(e);return}}e.destroy();t.removeSocket(e)})}a.inherits(TunnelingAgent,u.EventEmitter);TunnelingAgent.prototype.addRequest=function addRequest(e,t,n,r){var o=this;var s=mergeOptions({request:e},o.options,toOptions(t,n,r));if(o.sockets.length>=this.maxSockets){o.requests.push(s);return}o.createSocket(s,function(t){t.on("free",onFree);t.on("close",onCloseOrRemove);t.on("agentRemove",onCloseOrRemove);e.onSocket(t);function onFree(){o.emit("free",t,s)}function onCloseOrRemove(e){o.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 o=mergeOptions({},n.proxyOptions,{method:"CONNECT",path:e.host+":"+e.port,agent:false,headers:{host:e.host+":"+e.port}});if(e.localAddress){o.localAddress=e.localAddress}if(o.proxyAuth){o.headers=o.headers||{};o.headers["Proxy-Authorization"]="Basic "+new Buffer(o.proxyAuth).toString("base64")}l("making CONNECT request");var s=n.request(o);s.useChunkedEncodingByDefault=false;s.once("response",onResponse);s.once("upgrade",onUpgrade);s.once("connect",onConnect);s.once("error",onError);s.end();function onResponse(e){e.upgrade=true}function onUpgrade(e,t,n){process.nextTick(function(){onConnect(e,t,n)})}function onConnect(o,i,u){s.removeAllListeners();i.removeAllListeners();if(o.statusCode!==200){l("tunneling socket could not be established, statusCode=%d",o.statusCode);i.destroy();var c=new Error("tunneling socket could not be established, "+"statusCode="+o.statusCode);c.code="ECONNRESET";e.request.emit("error",c);n.removeSocket(r);return}if(u.length>0){l("got illegal response body from proxy");i.destroy();var c=new Error("got illegal response body from proxy");c.code="ECONNRESET";e.request.emit("error",c);n.removeSocket(r);return}l("tunneling connection has established");n.sockets[n.sockets.indexOf(r)]=i;return t(i)}function onError(t){s.removeAllListeners();l("tunneling socket could not be established, cause=%s\n",t.message,t.stack);var o=new Error("tunneling socket could not be established, "+"cause="+t.message);o.code="ECONNRESET";e.request.emit("error",o);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 s=e.request.getHeader("host");var i=mergeOptions({},n.options,{socket:r,servername:s?s.replace(/:.*$/,""):e.host});var u=o.connect(0,i);n.sockets[n.sockets.indexOf(r)]=u;t(u)})}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 o=Object.keys(r);for(var s=0,i=o.length;s<i;++s){var u=o[s];if(r[u]!==undefined){e[u]=r[u]}}}}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:()=>R,parse:()=>m,stringify:()=>l,v1:()=>g,v3:()=>O,v4:()=>E,v5:()=>S,validate:()=>c,version:()=>A});const r=require("crypto");var o=n.n(r);const s=new Uint8Array(256);let i=s.length;function rng(){if(i>s.length-16){o().randomFillSync(s);i=0}return s.slice(i,i+=16)}const u=/^(?:[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"&&u.test(e)}const c=validate;const a=[];for(let e=0;e<256;++e){a.push((e+256).toString(16).substr(1))}function stringify(e,t=0){const n=(a[e[t+0]]+a[e[t+1]]+a[e[t+2]]+a[e[t+3]]+"-"+a[e[t+4]]+a[e[t+5]]+"-"+a[e[t+6]]+a[e[t+7]]+"-"+a[e[t+8]]+a[e[t+9]]+"-"+a[e[t+10]]+a[e[t+11]]+a[e[t+12]]+a[e[t+13]]+a[e[t+14]]+a[e[t+15]]).toLowerCase();if(!c(n)){throw TypeError("Stringified UUID is invalid")}return n}const l=stringify;let d;let f;let p=0;let h=0;function v1(e,t,n){let r=t&&n||0;const o=t||new Array(16);e=e||{};let s=e.node||d;let i=e.clockseq!==undefined?e.clockseq:f;if(s==null||i==null){const t=e.random||(e.rng||rng)();if(s==null){s=d=[t[0]|1,t[1],t[2],t[3],t[4],t[5]]}if(i==null){i=f=(t[6]<<8|t[7])&16383}}let u=e.msecs!==undefined?e.msecs:Date.now();let c=e.nsecs!==undefined?e.nsecs:h+1;const a=u-p+(c-h)/1e4;if(a<0&&e.clockseq===undefined){i=i+1&16383}if((a<0||u>p)&&e.nsecs===undefined){c=0}if(c>=1e4){throw new Error("uuid.v1(): Can't create more than 10M uuids/sec")}p=u;h=c;f=i;u+=122192928e5;const g=((u&268435455)*1e4+c)%4294967296;o[r++]=g>>>24&255;o[r++]=g>>>16&255;o[r++]=g>>>8&255;o[r++]=g&255;const m=u/4294967296*1e4&268435455;o[r++]=m>>>8&255;o[r++]=m&255;o[r++]=m>>>24&15|16;o[r++]=m>>>16&255;o[r++]=i>>>8|128;o[r++]=i&255;for(let e=0;e<6;++e){o[r+e]=s[e]}return t||l(o)}const g=v1;function parse(e){if(!c(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 m=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 y="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function v35(e,t,n){function generateUUID(e,r,o,s){if(typeof e==="string"){e=stringToBytes(e)}if(typeof r==="string"){r=m(r)}if(r.length!==16){throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)")}let i=new Uint8Array(16+e.length);i.set(r);i.set(e,r.length);i=n(i);i[6]=i[6]&15|t;i[8]=i[8]&63|128;if(o){s=s||0;for(let e=0;e<16;++e){o[s+e]=i[e]}return o}return l(i)}try{generateUUID.name=e}catch(e){}generateUUID.DNS=v;generateUUID.URL=y;return generateUUID}function md5(e){if(Array.isArray(e)){e=Buffer.from(e)}else if(typeof e==="string"){e=Buffer.from(e,"utf8")}return o().createHash("md5").update(e).digest()}const w=md5;const _=v35("v3",48,w);const O=_;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 E=v4;function sha1(e){if(Array.isArray(e)){e=Buffer.from(e)}else if(typeof e==="string"){e=Buffer.from(e,"utf8")}return o().createHash("sha1").update(e).digest()}const C=sha1;const b=v35("v5",80,C);const S=b;const R="00000000-0000-0000-0000-000000000000";function version(e){if(!c(e)){throw TypeError("Invalid UUID")}return parseInt(e.substr(14,1),16)}const A=version},987:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.BuildahCli=void 0;const r=n(186);const o=n(514);const s=n(622);const i=n(314);class BuildahCli{constructor(e){this.storageOptsEnv="";this.executable=e}async setStorageOptsEnv(){if(await i.isStorageDriverOverlay()){const e=await i.findFuseOverlayfsPath();if(e){r.info(`Overriding storage mount_program with "fuse-overlayfs" in environment`);this.storageOptsEnv=`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")}}static getImageFormatOption(e){return["--format",e?"oci":"docker"]}async buildUsingDocker(e,t,n,r,o,s,i,u,c,a,l){const d=["bud"];if(a){d.push("--arch");d.push(a)}if(l){d.push("--platform");d.push(l)}n.forEach(e=>{d.push("-f");d.push(e)});s.forEach(e=>{d.push("--label");d.push(e)});r.forEach(e=>{d.push("--build-arg");d.push(e)});d.push(...BuildahCli.getImageFormatOption(o));d.push(`--tls-verify=${c}`);if(i){d.push(`--layers=${i}`)}if(u.length>0){d.push(...u)}d.push("-t");d.push(e);d.push(t);return this.execute(d)}async from(e,t,n){const r=["from"];r.push(`--tls-verify=${t}`);if(n.length>0){r.push(...n)}r.push(e);return this.execute(r)}async copy(e,t,n){if(t.length===0){return undefined}r.debug("copy");r.debug(e);for(const r of t){const t=["copy",e,r];if(n){t.push(n)}return this.execute(t)}return undefined}async config(e,t){r.debug("config");r.debug(e);const n=["config"];if(t.entrypoint){n.push("--entrypoint");n.push(BuildahCli.convertArrayToStringArg(t.entrypoint))}if(t.port){n.push("--port");n.push(t.port)}if(t.envs){t.envs.forEach(e=>{n.push("--env");n.push(e)})}if(t.arch){n.push("--arch");n.push(t.arch)}if(t.workingdir){n.push("--workingdir");n.push(t.workingdir)}if(t.labels){t.labels.forEach(e=>{n.push("--label");n.push(e)})}n.push(e);return this.execute(n)}async commit(e,t,n){r.debug("commit");r.debug(e);r.debug(t);const o=["commit",...BuildahCli.getImageFormatOption(n),"--squash",e,t];return this.execute(o)}async tag(e,t){const n=["tag"];const o=[];for(const r of t){n.push(i.getFullImageName(e,r));o.push(i.getFullImageName(e,r))}r.info(`Tagging the built image with tags ${t.toString()}`);await this.execute(n);r.info(`✅ Successfully built image${o.length!==1?"s":""} "${o.join(", ")}"`)}async manifestCreate(e){const t=["manifest","create"];t.push(e);r.info(`Creating manifest ${e}`);await this.execute(t)}async manifestAdd(e,t){const n=["manifest","add"];n.push(e);n.push(t);r.info(`Adding image "${t}" to the manifest.`);await this.execute(n)}static convertArrayToStringArg(e){let t="[";e.forEach(e=>{t+=`"${e}",`});return`${t.slice(0,-1)}]`}async execute(e,t={}){let n="";let i="";const u={...t};u.ignoreReturnCode=true;u.listeners={stdline:e=>{n+=e+"\n"},errline:e=>{i+=e+"\n"}};if(t.group){const t=[this.executable,...e].join(" ");r.startGroup(t)}const c={};Object.entries(process.env).forEach(([e,t])=>{if(t!=null){c[e]=t}});if(this.storageOptsEnv){c.STORAGE_OPTS=this.storageOptsEnv}u.env=c;try{const c=await o.exec(this.executable,e,u);if(t.ignoreReturnCode!==true&&c!==0){let e=`${s.basename(this.executable)} exited with code ${c}`;if(i){e+=`\n${i}`}throw new Error(e)}return{exitCode:c,output:n,error:i}}finally{if(t.group){r.endGroup()}}}}t.BuildahCli=BuildahCli},69:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Outputs=t.Inputs=void 0;var n;(function(e){e["ARCH"]="arch";e["ARCHS"]="archs";e["BASE_IMAGE"]="base-image";e["BUILD_ARGS"]="build-args";e["CONTAINERFILES"]="containerfiles";e["CONTENT"]="content";e["CONTEXT"]="context";e["DOCKERFILES"]="dockerfiles";e["ENTRYPOINT"]="entrypoint";e["ENVS"]="envs";e["EXTRA_ARGS"]="extra-args";e["IMAGE"]="image";e["LABELS"]="labels";e["LAYERS"]="layers";e["OCI"]="oci";e["PLATFORM"]="platform";e["PLATFORMS"]="platforms";e["PORT"]="port";e["TAGS"]="tags";e["TLS_VERIFY"]="tls-verify";e["WORKDIR"]="workdir"})(n=t.Inputs||(t.Inputs={}));var r;(function(e){e["IMAGE"]="image";e["IMAGE_WITH_TAG"]="image-with-tag";e["TAGS"]="tags"})(r=t.Outputs||(t.Outputs={}))},144:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.run=void 0;const r=n(186);const o=n(436);const s=n(622);const i=n(69);const u=n(987);const c=n(314);async function run(){if(process.env.RUNNER_OS!=="Linux"){throw new Error("buildah, and therefore this action, only works on Linux. Please use a Linux runner.")}const e=await o.which("buildah",true);const t=new u.BuildahCli(e);await t.execute(["version"],{group:true});await t.setStorageOptsEnv();const n="latest";const s=process.env.GITHUB_WORKSPACE||process.cwd();const a=c.getContainerfiles();const l=r.getInput(i.Inputs.IMAGE);const d=r.getInput(i.Inputs.TAGS);const f=d.trim().split(/\s+/);const p=r.getInput(i.Inputs.LABELS);const h=p?c.splitByNewline(p):[];const g=[];let m=false;for(const e of f){g.push(e.toLowerCase());if(e.toLowerCase()!==e){m=true}}const v=l.toLowerCase();if(m||l!==v){r.warning(`Reference to image and/or tag must be lowercase.`+` Reference has been converted to be compliant with standard.`)}if(f.length===0){r.info(`Input "${i.Inputs.TAGS}" is not provided, using default tag "${n}"`);f.push(n)}const y=r.getInput(i.Inputs.EXTRA_ARGS);let w=[];if(y){const e=c.splitByNewline(y);w=e.flatMap(e=>e.split(" ")).map(e=>e.trim())}const _=c.isFullImageName(g[0]);if(g.some(e=>c.isFullImageName(e)!==_)){throw new Error(`Input "${i.Inputs.TAGS}" cannot have a mix of full name and non full name tags. Refer to https://github.com/redhat-actions/buildah-build#image-tag-inputs`)}if(!_&&!v){throw new Error(`Input "${i.Inputs.IMAGE}" must be provided when not using full image name tags. Refer to https://github.com/redhat-actions/buildah-build#image-tag-inputs`)}const O=c.getFullImageName(v,g[0]);const E=r.getInput(i.Inputs.OCI)==="true";const C=c.getArch();const b=c.getPlatform();if(C.length>0&&b.length>0){throw new Error("The --platform option may not be used in combination with the --arch option.")}const S=[];if(a.length!==0){S.push(...await doBuildUsingContainerFiles(t,O,s,a,E,C,b,h,w))}else{if(b.length>0){throw new Error("The --platform option is not supported for builds without containerfiles.")}S.push(...await doBuildFromScratch(t,O,E,C,h,w))}if(C.length>1||b.length>1){r.info(`Creating manifest with tag${g.length!==1?"s":""} `+`"${g.join(", ")}"`);const e=[];for(const n of g){const r=c.getFullImageName(v,n);await t.manifestCreate(r);e.push(r);for(const e of C){const n=c.removeIllegalCharacters(e);await t.manifestAdd(r,`${O}-${n}`)}for(const e of b){const n=c.removeIllegalCharacters(e);await t.manifestAdd(r,`${O}-${n}`)}}r.info(`✅ Successfully built image${S.length!==1?"s":""} "${S.join(", ")}" `+`and manifest${e.length!==1?"s":""} "${e.join(", ")}"`)}else if(g.length>1){await t.tag(v,g)}else if(g.length===1){r.info(`✅ Successfully built image "${c.getFullImageName(v,g[0])}"`)}r.setOutput(i.Outputs.IMAGE,v);r.setOutput(i.Outputs.TAGS,d);r.setOutput(i.Outputs.IMAGE_WITH_TAG,O)}t.run=run;async function doBuildUsingContainerFiles(e,t,n,o,u,a,l,d,f){if(o.length===1){r.info(`Performing build from Containerfile`)}else{r.info(`Performing build from ${o.length} Containerfiles`)}const p=s.join(n,r.getInput(i.Inputs.CONTEXT));const h=c.getInputList(i.Inputs.BUILD_ARGS);const g=o.map(e=>s.join(n,e));const m=r.getInput(i.Inputs.LAYERS);const v=r.getInput(i.Inputs.TLS_VERIFY)==="true";const y=[];if(a.length>0||l.length>0){for(const n of a){let r="";if(a.length>1){r=`-${c.removeIllegalCharacters(n)}`}await e.buildUsingDocker(`${t}${r}`,p,g,h,u,d,m,f,v,n,undefined);y.push(`${t}${r}`)}for(const n of l){let r="";if(l.length>1){r=`-${c.removeIllegalCharacters(n)}`}await e.buildUsingDocker(`${t}${r}`,p,g,h,u,d,m,f,v,undefined,n);y.push(`${t}${r}`)}}else if(a.length===1||l.length===1){await e.buildUsingDocker(t,p,g,h,u,d,m,f,v,a[0],l[0]);y.push(t)}else{await e.buildUsingDocker(t,p,g,h,u,d,m,f,v);y.push(t)}return y}async function doBuildFromScratch(e,t,n,o,s,u){r.info(`Performing build from scratch`);const a=r.getInput(i.Inputs.BASE_IMAGE,{required:true});const l=c.getInputList(i.Inputs.CONTENT);const d=c.getInputList(i.Inputs.ENTRYPOINT);const f=r.getInput(i.Inputs.PORT);const p=r.getInput(i.Inputs.WORKDIR);const h=c.getInputList(i.Inputs.ENVS);const g=r.getInput(i.Inputs.TLS_VERIFY)==="true";const m=await e.from(a,g,u);const v=m.output.replace("\n","");const y=[];if(o.length>0){for(const r of o){let i="";if(o.length>1){i=`-${c.removeIllegalCharacters(r)}`}const u={entrypoint:d,port:f,workingdir:p,envs:h,arch:r,labels:s};await e.config(v,u);await e.copy(v,l);await e.commit(v,`${t}${i}`,n);y.push(`${t}${i}`)}}else{const r={entrypoint:d,port:f,workingdir:p,envs:h,labels:s};await e.config(v,r);await e.copy(v,l);await e.commit(v,t,n);y.push(t)}return y}run().catch(r.setFailed)},314:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.removeIllegalCharacters=t.getFullImageName=t.isFullImageName=t.getCommaSeperatedInput=t.getInputList=t.getContainerfiles=t.getPlatform=t.getArch=t.splitByNewline=t.findFuseOverlayfsPath=t.isStorageDriverOverlay=void 0;const r=n(885);const o=n(747);const s=n(186);const i=n(622);const u=n(436);const c=n(87);const a=n(69);async function findStorageDriver(e){let t="";for(const n of e){s.debug(`Checking if the storage file exists at ${n}`);if(await fileExists(n)){s.debug(`Storage file exists at ${n}`);const e=r.parse(await o.promises.readFile(n,"utf-8"));if(e.storage.driver){t=e.storage.driver}}}return t}async function isStorageDriverOverlay(){let e=i.join(c.homedir(),".config");if(process.env.XDG_CONFIG_HOME){e=process.env.XDG_CONFIG_HOME}const t=["/etc/containers/storage.conf",i.join(e,"containers/storage.conf")];const n=await findStorageDriver(t);return n==="overlay"}t.isStorageDriverOverlay=isStorageDriverOverlay;async function fileExists(e){try{await o.promises.access(e);return true}catch(e){return false}}async function findFuseOverlayfsPath(){let e;try{e=await u.which("fuse-overlayfs")}catch(e){s.debug(e)}return e}t.findFuseOverlayfsPath=findFuseOverlayfsPath;function splitByNewline(e){return e.split(/\r?\n/)}t.splitByNewline=splitByNewline;function getArch(){const e=getCommaSeperatedInput(a.Inputs.ARCHS);const t=s.getInput(a.Inputs.ARCH);if(t&&e.length>0){s.warning(`Both "${a.Inputs.ARCH}" and "${a.Inputs.ARCHS}" inputs are set. `+`Please use "${a.Inputs.ARCH}" if you want to provide multiple `+`ARCH else use ${a.Inputs.ARCH}". "${a.Inputs.ARCHS}" takes preference.`)}if(e.length>0){return e}else if(t){return[t]}return[]}t.getArch=getArch;function getPlatform(){const e=s.getInput(a.Inputs.PLATFORM);const t=getCommaSeperatedInput(a.Inputs.PLATFORMS);if(e&&t.length>0){s.warning(`Both "${a.Inputs.PLATFORM}" and "${a.Inputs.PLATFORMS}" inputs are set. `+`Please use "${a.Inputs.PLATFORMS}" if you want to provide multiple `+`PLATFORM else use ${a.Inputs.PLATFORM}". "${a.Inputs.PLATFORMS}" takes preference.`)}if(t.length>0){s.debug("return platforms");return t}else if(e){s.debug("return platform");return[e]}s.debug("return empty");return[]}t.getPlatform=getPlatform;function getContainerfiles(){const e=getInputList(a.Inputs.CONTAINERFILES);const t=getInputList(a.Inputs.DOCKERFILES);if(e.length!==0&&t.length!==0){s.warning(`Both "${a.Inputs.CONTAINERFILES}" and "${a.Inputs.DOCKERFILES}" inputs are set. `+`Please use only one of these two inputs, as they are aliases of one another. `+`"${a.Inputs.CONTAINERFILES}" takes precedence.`)}return e.length!==0?e:t}t.getContainerfiles=getContainerfiles;function getInputList(e){const t=s.getInput(e);if(!t){return[]}const n=splitByNewline(t);return n.reduce((e,t)=>e.concat(t).map(e=>e.trim()),[])}t.getInputList=getInputList;function getCommaSeperatedInput(e){const t=s.getInput(e);if(t.length===0){s.debug("empty");return[]}const n=t.split(",");return n.reduce((e,t)=>e.concat(t).map(e=>e.trim()),[])}t.getCommaSeperatedInput=getCommaSeperatedInput;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;function removeIllegalCharacters(e){return e.replace(/[^a-zA-Z0-9 ]/g,"")}t.removeIllegalCharacters=removeIllegalCharacters},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")},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 o=true;try{e[n].call(r.exports,r,r.exports,__webpack_require__);o=false}finally{if(o)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
|