From 9018bf4ee1b7e4e2b6d5ba1c44b85be3d7861f44 Mon Sep 17 00:00:00 2001 From: tarunwadhwa-paypay <97156231+tarunwadhwa-paypay@users.noreply.github.com> Date: Mon, 28 Feb 2022 21:18:49 +0530 Subject: [PATCH] Fixes for #147 #139 (#148) * Fixes for #147 #139 * Lint fixes --- dist/index.js | 2 +- src/git.js | 2 +- src/utils.js | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index f36e341..1f95c09 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1 +1 @@ -module.exports=function(e,t){"use strict";var r={};function __webpack_require__(t){if(r[t]){return r[t].exports}var n=r[t]={i:t,l:false,exports:{}};var i=true;try{e[t].call(n.exports,n,n.exports,__webpack_require__);i=false}finally{if(i)delete r[t]}n.l=true;return n.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(104)}return startup()}({11:function(e){e.exports=wrappy;function wrappy(e,t){if(e&&t)return wrappy(e)(t);if(typeof e!=="function")throw new TypeError("need wrapper function");Object.keys(e).forEach(function(t){wrapper[t]=e[t]});return wrapper;function wrapper(){var t=new Array(arguments.length);for(var r=0;r1024*64){throw new TypeError("pattern is too long")}var r=this.options;if(!r.noglobstar&&e==="**")return i;if(e==="")return"";var n="";var o=!!r.nocase;var u=false;var l=[];var h=[];var d;var m=false;var v=-1;var g=-1;var y=e.charAt(0)==="."?"":r.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)";var E=this;function clearStateChar(){if(d){switch(d){case"*":n+=c;o=true;break;case"?":n+=a;o=true;break;default:n+="\\"+d;break}E.debug("clearStateChar %j %j",d,n);d=false}}for(var _=0,b=e.length,O;_-1;k--){var I=h[k];var P=n.slice(0,I.reStart);var x=n.slice(I.reStart,I.reEnd-8);var M=n.slice(I.reEnd-8,I.reEnd);var N=n.slice(I.reEnd);M+=N;var G=P.split("(").length-1;var D=N;for(_=0;_=0;s--){o=e[s];if(o)break}for(s=0;s>> no match, partial?",e,f,t,h);if(f===a)return true}return false}var d;if(typeof u==="string"){if(n.nocase){d=l.toLowerCase()===u.toLowerCase()}else{d=l===u}this.debug("string match",u,l,d)}else{d=l.match(u);this.debug("pattern match",u,l,d)}if(!d)return false}if(o===a&&s===c){return true}else if(o===a){return r}else if(s===c){var m=o===a-1&&e[o]==="";return m}throw new Error("wtf?")};function globUnescape(e){return e.replace(/\\(.)/g,"$1")}function regExpEscape(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}},102:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});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 r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.issueCommand=void 0;const s=o(r(747));const a=o(r(87));const c=r(82);function issueCommand(e,t){const r=process.env[`GITHUB_${e}`];if(!r){throw new Error(`Unable to find environment variable for file command ${e}`)}if(!s.existsSync(r)){throw new Error(`Missing file at path: ${r}`)}s.appendFileSync(r,`${c.toCommandValue(t)}${a.EOL}`,{encoding:"utf8"})}t.issueCommand=issueCommand},104:function(e,t,r){const n=r(470);try{r(676)()}catch(e){n.setFailed(`Action failed with error ${e}`)}},117:function(e,t,r){var n=r(622);var i=process.platform==="win32";var o=r(747);var s=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function rethrow(){var e;if(s){var t=new Error;e=debugCallback}else e=missingCallback;return e;function debugCallback(e){if(e){t.message=e.message;e=t;missingCallback(e)}}function missingCallback(e){if(e){if(process.throwDeprecation)throw e;else if(!process.noDeprecation){var t="fs: missing callback "+(e.stack||e.message);if(process.traceDeprecation)console.trace(t);else console.error(t)}}}}function maybeCallback(e){return typeof e==="function"?e:rethrow()}var a=n.normalize;if(i){var c=/(.*?)(?:[\/\\]+|$)/g}else{var c=/(.*?)(?:[\/]+|$)/g}if(i){var u=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/}else{var u=/^[\/]*/}t.realpathSync=function realpathSync(e,t){e=n.resolve(e);if(t&&Object.prototype.hasOwnProperty.call(t,e)){return t[e]}var r=e,s={},a={};var l;var f;var h;var p;start();function start(){var t=u.exec(e);l=t[0].length;f=t[0];h=t[0];p="";if(i&&!a[h]){o.lstatSync(h);a[h]=true}}while(l=e.length){if(t)t[s]=e;return r(null,e)}c.lastIndex=f;var n=c.exec(e);d=h;h+=n[0];p=d+n[1];f=c.lastIndex;if(l[p]||t&&t[p]===p){return process.nextTick(LOOP)}if(t&&Object.prototype.hasOwnProperty.call(t,p)){return gotResolvedLink(t[p])}return o.lstat(p,gotStat)}function gotStat(e,n){if(e)return r(e);if(!n.isSymbolicLink()){l[p]=true;if(t)t[p]=p;return process.nextTick(LOOP)}if(!i){var s=n.dev.toString(32)+":"+n.ino.toString(32);if(a.hasOwnProperty(s)){return gotTarget(null,a[s],p)}}o.stat(p,function(e){if(e)return r(e);o.readlink(p,function(e,t){if(!i)a[s]=t;gotTarget(e,t)})})}function gotTarget(e,i,o){if(e)return r(e);var s=n.resolve(d,i);if(t)t[o]=s;gotResolvedLink(s)}function gotResolvedLink(t){e=n.resolve(t,e.slice(f));start()}}},129:function(e){e.exports=require("child_process")},141:function(e,t,r){"use strict";var n=r(631);var i=r(16);var o=r(605);var s=r(211);var a=r(614);var c=r(357);var u=r(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,r,n,i){var o=toOptions(r,n,i);for(var s=0,a=t.requests.length;s=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 r=this;var n={};r.sockets.push(n);var i=mergeOptions({},r.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=r.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,r){process.nextTick(function(){onConnect(e,t,r)})}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 c=new Error("tunneling socket could not be established, "+"statusCode="+i.statusCode);c.code="ECONNRESET";e.request.emit("error",c);r.removeSocket(n);return}if(a.length>0){l("got illegal response body from proxy");s.destroy();var c=new Error("got illegal response body from proxy");c.code="ECONNRESET";e.request.emit("error",c);r.removeSocket(n);return}l("tunneling connection has established");r.sockets[r.sockets.indexOf(n)]=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);r.removeSocket(n)}};TunnelingAgent.prototype.removeSocket=function removeSocket(e){var t=this.sockets.indexOf(e);if(t===-1){return}this.sockets.splice(t,1);var r=this.requests.shift();if(r){this.createSocket(r,function(e){r.request.onSocket(e)})}};function createSecureSocket(e,t){var r=this;TunnelingAgent.prototype.createSocket.call(r,e,function(n){var o=e.request.getHeader("host");var s=mergeOptions({},r.options,{socket:n,servername:o?o.replace(/:.*$/,""):e.host});var a=i.connect(0,s);r.sockets[r.sockets.indexOf(n)]=a;t(a)})}function toOptions(e,t,r){if(typeof e==="string"){return{host:e,port:t,localAddress:r}}return e}function mergeOptions(e){for(var t=1,r=arguments.length;ttypeof e==="string";e.exports=((e,t={})=>{if(!i(e)){t=e||{};e=run()}const{added:r,modified:n,untracked:o,deleted:s,renamed:a}=t;const c=parse(e);const u=pick(c,{added:r,modified:n,untracked:o,deleted:s,renamed:a});const l=getNames(u);return l});const o=({name:e})=>e;e.exports.getNames=getNames;function getNames(e){return e.map(o)}e.exports.run=run;function run(){const e=n("git",["status","--porcelain"]);return e.stdout.toString()}e.exports.parse=parse;function parse(e){const t=[];const r=e.split("\n").filter(Boolean);for(const e of r){const{name:r,mode:n}=parseLine(e);t.push({name:r,mode:n})}return t}const s="?";const a="R";const c="-> ";const u=e=>{const t=e.indexOf(c);const r=t+c.length;return e.slice(r)};function parseLine(e){const[t]=e;if(t===s)return{name:e.replace("?? ",""),mode:s};if(t===a)return{name:u(e),mode:a};const[r]=e.match(/^[\sA-Z]{1,}\s/,"");const n=e.replace(r,"");return{name:n,mode:r}}const l=({mode:e})=>/M/.test(e);const f=({mode:e})=>/A/.test(e);const h=({mode:e})=>/R/.test(e);const p=({mode:e})=>/D/.test(e);const d=({mode:e})=>/\?/.test(e);const m=({added:e,modified:t,untracked:r,deleted:n,renamed:i})=>o=>{let s=false;if(e)s=s||f(o);if(t)s=s||l(o);if(r)s=s||d(o);if(n)s=s||p(o);if(i)s=s||h(o);return s};e.exports.pick=pick;function pick(e,{added:t,modified:r,deleted:n,untracked:i,renamed:o}){return e.filter(m({added:t,modified:r,untracked:i,deleted:n,renamed:o}))}},211:function(e){e.exports=require("https")},226:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});class BasicCredentialHandler{constructor(e,t){this.username=e;this.password=t}prepareRequest(e){e.headers["Authorization"]="Basic "+Buffer.from(this.username+":"+this.password).toString("base64")}canHandleAuthentication(e){return false}handleAuthentication(e,t,r){return null}}t.BasicCredentialHandler=BasicCredentialHandler;class BearerCredentialHandler{constructor(e){this.token=e}prepareRequest(e){e.headers["Authorization"]="Bearer "+this.token}canHandleAuthentication(e){return false}handleAuthentication(e,t,r){return null}}t.BearerCredentialHandler=BearerCredentialHandler;class PersonalAccessTokenCredentialHandler{constructor(e){this.token=e}prepareRequest(e){e.headers["Authorization"]="Basic "+Buffer.from("PAT:"+this.token).toString("base64")}canHandleAuthentication(e){return false}handleAuthentication(e,t,r){return null}}t.PersonalAccessTokenCredentialHandler=PersonalAccessTokenCredentialHandler},245:function(e,t,r){e.exports=globSync;globSync.GlobSync=GlobSync;var n=r(747);var i=r(302);var o=r(93);var s=o.Minimatch;var a=r(402).Glob;var c=r(669);var u=r(622);var l=r(357);var f=r(681);var h=r(856);var p=h.alphasort;var d=h.alphasorti;var m=h.setopts;var v=h.ownProp;var g=h.childrenIgnored;var y=h.isIgnored;function globSync(e,t){if(typeof t==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob\n"+"See: https://github.com/isaacs/node-glob/issues/167");return new GlobSync(e,t).found}function GlobSync(e,t){if(!e)throw new Error("must provide pattern");if(typeof t==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob\n"+"See: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof GlobSync))return new GlobSync(e,t);m(this,e,t);if(this.noprocess)return this;var r=this.minimatch.set.length;this.matches=new Array(r);for(var n=0;nthis.maxLength)return false;if(!this.stat&&v(this.cache,t)){var i=this.cache[t];if(Array.isArray(i))i="DIR";if(!r||i==="DIR")return i;if(r&&i==="FILE")return false}var o;var s=this.statCache[t];if(!s){var a;try{a=n.lstatSync(t)}catch(e){if(e&&(e.code==="ENOENT"||e.code==="ENOTDIR")){this.statCache[t]=false;return false}}if(a&&a.isSymbolicLink()){try{s=n.statSync(t)}catch(e){s=a}}else{s=a}}this.statCache[t]=s;var i=true;if(s)i=s.isDirectory()?"DIR":"FILE";this.cache[t]=this.cache[t]||i;if(r&&i==="FILE")return false;return i};GlobSync.prototype._mark=function(e){return h.mark(this,e)};GlobSync.prototype._makeAbs=function(e){return h.makeAbs(this,e)}},302:function(e,t,r){e.exports=realpath;realpath.realpath=realpath;realpath.sync=realpathSync;realpath.realpathSync=realpathSync;realpath.monkeypatch=monkeypatch;realpath.unmonkeypatch=unmonkeypatch;var n=r(747);var i=n.realpath;var o=n.realpathSync;var s=process.version;var a=/^v[0-5]\./.test(s);var c=r(117);function newError(e){return e&&e.syscall==="realpath"&&(e.code==="ELOOP"||e.code==="ENOMEM"||e.code==="ENAMETOOLONG")}function realpath(e,t,r){if(a){return i(e,t,r)}if(typeof t==="function"){r=t;t=null}i(e,t,function(n,i){if(newError(n)){c.realpath(e,t,r)}else{r(n,i)}})}function realpathSync(e,t){if(a){return o(e,t)}try{return o(e,t)}catch(r){if(newError(r)){return c.realpathSync(e,t)}else{throw r}}}function monkeypatch(){n.realpath=realpath;n.realpathSync=realpathSync}function unmonkeypatch(){n.realpath=i;n.realpathSync=o}},306:function(e,t,r){var n=r(896);var i=r(621);e.exports=expandTop;var o="\0SLASH"+Math.random()+"\0";var s="\0OPEN"+Math.random()+"\0";var a="\0CLOSE"+Math.random()+"\0";var c="\0COMMA"+Math.random()+"\0";var u="\0PERIOD"+Math.random()+"\0";function numeric(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function escapeBraces(e){return e.split("\\\\").join(o).split("\\{").join(s).split("\\}").join(a).split("\\,").join(c).split("\\.").join(u)}function unescapeBraces(e){return e.split(o).join("\\").split(s).join("{").split(a).join("}").split(c).join(",").split(u).join(".")}function parseCommaParts(e){if(!e)return[""];var t=[];var r=i("{","}",e);if(!r)return e.split(",");var n=r.pre;var o=r.body;var s=r.post;var a=n.split(",");a[a.length-1]+="{"+o+"}";var c=parseCommaParts(s);if(s.length){a[a.length-1]+=c.shift();a.push.apply(a,c)}t.push.apply(t,a);return t}function expandTop(e){if(!e)return[];if(e.substr(0,2)==="{}"){e="\\{\\}"+e.substr(2)}return expand(escapeBraces(e),true).map(unescapeBraces)}function identity(e){return e}function embrace(e){return"{"+e+"}"}function isPadded(e){return/^-?0\d/.test(e)}function lte(e,t){return e<=t}function gte(e,t){return e>=t}function expand(e,t){var r=[];var o=i("{","}",e);if(!o||/\$$/.test(o.pre))return[e];var s=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body);var c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body);var u=s||c;var l=o.body.indexOf(",")>=0;if(!u&&!l){if(o.post.match(/,.*\}/)){e=o.pre+"{"+o.body+a+o.post;return expand(e)}return[e]}var f;if(u){f=o.body.split(/\.\./)}else{f=parseCommaParts(o.body);if(f.length===1){f=expand(f[0],false).map(embrace);if(f.length===1){var h=o.post.length?expand(o.post,false):[""];return h.map(function(e){return o.pre+f[0]+e})}}}var p=o.pre;var h=o.post.length?expand(o.post,false):[""];var d;if(u){var m=numeric(f[0]);var v=numeric(f[1]);var g=Math.max(f[0].length,f[1].length);var y=f.length==3?Math.abs(numeric(f[2])):1;var E=lte;var _=v0){var R=new Array(S+1).join("0");if(O<0)w="-"+R+w.slice(1);else w=R+w}}}d.push(w)}}else{d=n(f,function(e){return expand(e,false)})}for(var T=0;T1)return true;for(var o=0;othis.maxLength)return t();if(!this.stat&&g(this.cache,r)){var o=this.cache[r];if(Array.isArray(o))o="DIR";if(!i||o==="DIR")return t(null,o);if(i&&o==="FILE")return t()}var s;var a=this.statCache[r];if(a!==undefined){if(a===false)return t(null,a);else{var c=a.isDirectory()?"DIR":"FILE";if(i&&c==="FILE")return t();else return t(null,c,a)}}var u=this;var l=y("stat\0"+r,lstatcb_);if(l)n.lstat(r,l);function lstatcb_(i,o){if(o&&o.isSymbolicLink()){return n.stat(r,function(n,i){if(n)u._stat2(e,r,null,o,t);else u._stat2(e,r,n,i,t)})}else{u._stat2(e,r,i,o,t)}}};Glob.prototype._stat2=function(e,t,r,n,i){if(r&&(r.code==="ENOENT"||r.code==="ENOTDIR")){this.statCache[t]=false;return i()}var o=e.slice(-1)==="/";this.statCache[t]=n;if(t.slice(-1)==="/"&&n&&!n.isDirectory())return i(null,false,n);var s=true;if(n)s=n.isDirectory()?"DIR":"FILE";this.cache[t]=this.cache[t]||s;if(o&&s==="FILE")return i();return i(null,s,n)}},413:function(e,t,r){e.exports=r(141)},431:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});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 r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.issue=t.issueCommand=void 0;const s=o(r(87));const a=r(82);function issueCommand(e,t,r){const n=new Command(e,t,r);process.stdout.write(n.toString()+s.EOL)}t.issueCommand=issueCommand;function issue(e,t=""){issueCommand(e,{},t)}t.issue=issue;const c="::";class Command{constructor(e,t,r){if(!e){e="missing.command"}this.command=e;this.properties=t;this.message=r}toString(){let e=c+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";let t=true;for(const r in this.properties){if(this.properties.hasOwnProperty(r)){const n=this.properties[r];if(n){if(t){t=false}else{e+=","}e+=`${r}=${escapeProperty(n)}`}}}}e+=`${c}${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")}},450:function(e,t,r){const n=r(747);const i=r(470);const o=r(852)();const s=e=>{return e.split("\n").map(e=>e.trim())};const a={get COMMIT_MESSAGE(){return i.getInput("COMMIT_MESSAGE",{required:false})||`Update file(s) from "%SRC_REPO%"`},DRY_RUN:["1","true"].includes(i.getInput("DRY_RUN",{required:false}).toLowerCase()),FILE_PATTERNS:s(i.getInput("FILE_PATTERNS")).map(e=>new RegExp(e)),GITHUB_SERVER:i.getInput("GITHUB_SERVER",{required:false})||"github.com",GITHUB_TOKEN:i.getInput("GITHUB_TOKEN",{required:true}),GIT_EMAIL:i.getInput("GIT_EMAIL")||`${process.env.GITHUB_ACTOR}@users.noreply.github.com`,GIT_USERNAME:i.getInput("GIT_USERNAME",{required:false})||process.env.GITHUB_ACTOR,SKIP_CLEANUP:["1","true"].includes(i.getInput("SKIP_CLEANUP",{required:false}).toLowerCase()),SKIP_DELETE:["1","true"].includes(i.getInput("SKIP_DELETE",{required:false}).toLowerCase()),SKIP_REPLACE:["1","true"].includes(i.getInput("SKIP_REPLACE",{required:false}).toLowerCase()),SRC_REPO:i.getInput("SRC_REPO",{required:false})||process.env.GITHUB_REPOSITORY,SRC_ROOT:i.getInput("SRC_ROOT",{required:false})||"/",TARGET_REPOS:s(i.getInput("TARGET_REPOS",{required:true})),TARGET_ROOT:i.getInput("TARGET_ROOT",{required:false})||"/",TMPDIR:i.getInput("TEMP_DIR",{required:false})||`tmp-${Date.now().toString()}`};while(n.existsSync(a.TMPDIR)){a.TMPDIR=`tmp-${Date.now().toString()}`;o.info(`TEMP_DIR already exists. Using "${a.TMPDIR}" now.`)}o.info("Context:",{...a,GITHUB_TOKEN:""});e.exports=a},470:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});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 r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};var s=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.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=r(431);const c=r(102);const u=r(82);const l=o(r(87));const f=o(r(622));const h=r(742);var p;(function(e){e[e["Success"]=0]="Success";e[e["Failure"]=1]="Failure"})(p=t.ExitCode||(t.ExitCode={}));function exportVariable(e,t){const r=u.toCommandValue(t);process.env[e]=r;const n=process.env["GITHUB_ENV"]||"";if(n){const t="_GitHubActionsFileCommandDelimeter_";const n=`${e}<<${t}${l.EOL}${r}${l.EOL}${t}`;c.issueCommand("ENV",n)}else{a.issueCommand("set-env",{name:e},r)}}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){c.issueCommand("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 r=process.env[`INPUT_${e.replace(/ /g,"_").toUpperCase()}`]||"";if(t&&t.required&&!r){throw new Error(`Input required and not supplied: ${e}`)}if(t&&t.trimWhitespace===false){return r}return r.trim()}t.getInput=getInput;function getMultilineInput(e,t){const r=getInput(e,t).split("\n").filter(e=>e!=="");return r}t.getMultilineInput=getMultilineInput;function getBooleanInput(e,t){const r=["true","True","TRUE"];const n=["false","False","FALSE"];const i=getInput(e,t);if(r.includes(i))return true;if(n.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){process.stdout.write(l.EOL);a.issueCommand("set-output",{name:e},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",u.toCommandProperties(t),e instanceof Error?e.toString():e)}t.error=error;function warning(e,t={}){a.issueCommand("warning",u.toCommandProperties(t),e instanceof Error?e.toString():e)}t.warning=warning;function notice(e,t={}){a.issueCommand("notice",u.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 r;try{r=yield t()}finally{endGroup()}return r})}t.group=group;function saveState(e,t){a.issueCommand("save-state",{name:e},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 h.OidcClient.getIDToken(e)})}t.getIDToken=getIDToken},539:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});const n=r(605);const i=r(211);const o=r(950);let s;var a;(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"})(a=t.HttpCodes||(t.HttpCodes={}));var c;(function(e){e["Accept"]="accept";e["ContentType"]="content-type"})(c=t.Headers||(t.Headers={}));var u;(function(e){e["ApplicationJson"]="application/json"})(u=t.MediaTypes||(t.MediaTypes={}));function getProxyUrl(e){let t=o.getProxyUrl(new URL(e));return t?t.href:""}t.getProxyUrl=getProxyUrl;const l=[a.MovedPermanently,a.ResourceMoved,a.SeeOther,a.TemporaryRedirect,a.PermanentRedirect];const f=[a.BadGateway,a.ServiceUnavailable,a.GatewayTimeout];const h=["OPTIONS","GET","DELETE","HEAD"];const p=10;const d=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 new Promise(async(e,t)=>{let r=Buffer.alloc(0);this.message.on("data",e=>{r=Buffer.concat([r,e])});this.message.on("end",()=>{e(r.toString())})})}}t.HttpClientResponse=HttpClientResponse;function isHttps(e){let t=new URL(e);return t.protocol==="https:"}t.isHttps=isHttps;class HttpClient{constructor(e,t,r){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=r;if(r){if(r.ignoreSslError!=null){this._ignoreSslError=r.ignoreSslError}this._socketTimeout=r.socketTimeout;if(r.allowRedirects!=null){this._allowRedirects=r.allowRedirects}if(r.allowRedirectDowngrade!=null){this._allowRedirectDowngrade=r.allowRedirectDowngrade}if(r.maxRedirects!=null){this._maxRedirects=Math.max(r.maxRedirects,0)}if(r.keepAlive!=null){this._keepAlive=r.keepAlive}if(r.allowRetries!=null){this._allowRetries=r.allowRetries}if(r.maxRetries!=null){this._maxRetries=r.maxRetries}}}options(e,t){return this.request("OPTIONS",e,null,t||{})}get(e,t){return this.request("GET",e,null,t||{})}del(e,t){return this.request("DELETE",e,null,t||{})}post(e,t,r){return this.request("POST",e,t,r||{})}patch(e,t,r){return this.request("PATCH",e,t,r||{})}put(e,t,r){return this.request("PUT",e,t,r||{})}head(e,t){return this.request("HEAD",e,null,t||{})}sendStream(e,t,r,n){return this.request(e,t,r,n)}async getJson(e,t={}){t[c.Accept]=this._getExistingOrDefaultHeader(t,c.Accept,u.ApplicationJson);let r=await this.get(e,t);return this._processResponse(r,this.requestOptions)}async postJson(e,t,r={}){let n=JSON.stringify(t,null,2);r[c.Accept]=this._getExistingOrDefaultHeader(r,c.Accept,u.ApplicationJson);r[c.ContentType]=this._getExistingOrDefaultHeader(r,c.ContentType,u.ApplicationJson);let i=await this.post(e,n,r);return this._processResponse(i,this.requestOptions)}async putJson(e,t,r={}){let n=JSON.stringify(t,null,2);r[c.Accept]=this._getExistingOrDefaultHeader(r,c.Accept,u.ApplicationJson);r[c.ContentType]=this._getExistingOrDefaultHeader(r,c.ContentType,u.ApplicationJson);let i=await this.put(e,n,r);return this._processResponse(i,this.requestOptions)}async patchJson(e,t,r={}){let n=JSON.stringify(t,null,2);r[c.Accept]=this._getExistingOrDefaultHeader(r,c.Accept,u.ApplicationJson);r[c.ContentType]=this._getExistingOrDefaultHeader(r,c.ContentType,u.ApplicationJson);let i=await this.patch(e,n,r);return this._processResponse(i,this.requestOptions)}async request(e,t,r,n){if(this._disposed){throw new Error("Client has already been disposed.")}let i=new URL(t);let o=this._prepareRequest(e,i,n);let s=this._allowRetries&&h.indexOf(e)!=-1?this._maxRetries+1:1;let c=0;let u;while(c0){const s=u.message.headers["location"];if(!s){break}let 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.")}await u.readBody();if(a.hostname!==i.hostname){for(let e in n){if(e.toLowerCase()==="authorization"){delete n[e]}}}o=this._prepareRequest(e,a,n);u=await this.requestRaw(o,r);t--}if(f.indexOf(u.message.statusCode)==-1){return u}c+=1;if(c{let i=function(e,t){if(e){n(e)}r(t)};this.requestRawWithCallback(e,t,i)})}requestRawWithCallback(e,t,r){let n;if(typeof t==="string"){e.options.headers["Content-Length"]=Buffer.byteLength(t,"utf8")}let i=false;let o=(e,t)=>{if(!i){i=true;r(e,t)}};let s=e.httpModule.request(e.options,e=>{let t=new HttpClientResponse(e);o(null,t)});s.on("socket",e=>{n=e});s.setTimeout(this._socketTimeout||3*6e4,()=>{if(n){n.end()}o(new Error("Request timeout: "+e.options.path),null)});s.on("error",function(e){o(e,null)});if(t&&typeof t==="string"){s.write(t,"utf8")}if(t&&typeof t!=="string"){t.on("close",function(){s.end()});t.pipe(s)}else{s.end()}}getAgent(e){let t=new URL(e);return this._getAgent(t)}_prepareRequest(e,t,r){const o={};o.parsedUrl=t;const s=o.parsedUrl.protocol==="https:";o.httpModule=s?i:n;const a=s?443:80;o.options={};o.options.host=o.parsedUrl.hostname;o.options.port=o.parsedUrl.port?parseInt(o.parsedUrl.port):a;o.options.path=(o.parsedUrl.pathname||"")+(o.parsedUrl.search||"");o.options.method=e;o.options.headers=this._mergeHeaders(r);if(this.userAgent!=null){o.options.headers["user-agent"]=this.userAgent}o.options.agent=this._getAgent(o.parsedUrl);if(this.handlers){this.handlers.forEach(e=>{e.prepareRequest(o.options)})}return o}_mergeHeaders(e){const t=e=>Object.keys(e).reduce((t,r)=>(t[r.toLowerCase()]=e[r],t),{});if(this.requestOptions&&this.requestOptions.headers){return Object.assign({},t(this.requestOptions.headers),t(e))}return t(e||{})}_getExistingOrDefaultHeader(e,t,r){const n=e=>Object.keys(e).reduce((t,r)=>(t[r.toLowerCase()]=e[r],t),{});let i;if(this.requestOptions&&this.requestOptions.headers){i=n(this.requestOptions.headers)[t]}return e[t]||i||r}_getAgent(e){let t;let a=o.getProxyUrl(e);let c=a&&a.hostname;if(this._keepAlive&&c){t=this._proxyAgent}if(this._keepAlive&&!c){t=this._agent}if(!!t){return t}const u=e.protocol==="https:";let l=100;if(!!this.requestOptions){l=this.requestOptions.maxSockets||n.globalAgent.maxSockets}if(c){if(!s){s=r(413)}const e={maxSockets:l,keepAlive:this._keepAlive,proxy:{...(a.username||a.password)&&{proxyAuth:`${a.username}:${a.password}`},host:a.hostname,port:a.port}};let n;const i=a.protocol==="https:";if(u){n=i?s.httpsOverHttps:s.httpsOverHttp}else{n=i?s.httpOverHttps:s.httpOverHttp}t=n(e);this._proxyAgent=t}if(this._keepAlive&&!t){const e={keepAlive:this._keepAlive,maxSockets:l};t=u?new i.Agent(e):new n.Agent(e);this._agent=t}if(!t){t=u?i.globalAgent:n.globalAgent}if(u&&this._ignoreSslError){t.options=Object.assign(t.options||{},{rejectUnauthorized:false})}return t}_performExponentialBackoff(e){e=Math.min(p,e);const t=d*Math.pow(2,e);return new Promise(e=>setTimeout(()=>e(),t))}static dateTimeDeserializer(e,t){if(typeof t==="string"){let e=new Date(t);if(!isNaN(e.valueOf())){return e}}return t}async _processResponse(e,t){return new Promise(async(r,n)=>{const i=e.message.statusCode;const o={statusCode:i,result:null,headers:{}};if(i==a.NotFound){r(o)}let s;let c;try{c=await e.readBody();if(c&&c.length>0){if(t&&t.deserializeDates){s=JSON.parse(c,HttpClient.dateTimeDeserializer)}else{s=JSON.parse(c)}o.result=s}o.headers=e.message.headers}catch(e){}if(i>299){let e;if(s&&s.message){e=s.message}else if(c&&c.length>0){e=c}else{e="Failed request: ("+i+")"}let t=new HttpClientError(e,i);t.result=o.result;n(t)}else{r(o)}})}}t.HttpClient=HttpClient},543:function(e,t,r){const n=r(747).promises;const i=r(622);const o=r(50);const s=r(569);const{TMPDIR:a,FILE_PATTERNS:c,DRY_RUN:u,SKIP_DELETE:l,SKIP_REPLACE:f,SRC_REPO:h,SRC_ROOT:p,TARGET_ROOT:d}=r(450);const m=r(852);const v=e=>{const t=m(e);const r=()=>{return e.split(":")[0]};const s=()=>{return e.split(":")[1]||undefined};const v=()=>{return i.join(a,`${r()}${s()===undefined?"":`-${s()}`}`)};const g=()=>e===h?p:d;const y=()=>i.join(v(),g());const E=e=>{return i.relative(y(),e)};const _=t=>t.replace(/\\/g,"/").replace(/^\//,"").replace(new RegExp(`^${a}/${e}${g()}`),"");const b=e=>{t.info("FILE_PATTERNS",c.map(e=>e.toString()));return e.filter(e=>{cleanFile=_(e);const t=c.some(e=>e.test(cleanFile));return t})};const O=async()=>{const e=await o(v(),[".git"]);t.debug("FILES:",JSON.stringify(e.map(_),undefined,2));const r=b(e);t.info("MATCHING FILES:",JSON.stringify(r.map(_),undefined,2));return r};const w=async(e,r)=>{const o=await n.access(r).then(()=>true).catch(()=>false);if(f&&o){t.info("skip copying",e.replace(/\\/g,"/").replace(/^\//,""),"to",r.replace(/\\/g,"/").replace(/^\//,""),"because SKIP_REPLACE = true");return}t.info("copy",e.replace(/\\/g,"/").replace(/^\//,""),"to",r.replace(/\\/g,"/").replace(/^\//,""));if(u){return}await n.mkdir(i.dirname(r),{recursive:true});await n.copyFile(e,r)};const S=async e=>{if(l){t.info("SKIP REMOVING FILES because `SKIP_DELETE` is set to `true`",e.map(e=>`"${e}"`).join(", "))}t.info("REMOVE FILES",e);if(u){return}return Promise.all(e.map(e=>n.unlink(e)))};return{copyFile:w,getFiles:O,getRepoBranch:s,getRepoFilePath:y,getRepoPath:v,getRepoRelativeFilePath:E,getRepoSlug:r,removeFiles:S}};const g=async e=>{new Promise((t,r)=>{s(e,{disableGlob:true},e=>{if(e){return r(e)}t()})})};e.exports={init:v,removeDir:g}},569:function(e,t,r){const n=r(357);const i=r(622);const o=r(747);let s=undefined;try{s=r(402)}catch(e){}const a={nosort:true,silent:true};let c=0;const u=process.platform==="win32";const l=e=>{const t=["unlink","chmod","stat","lstat","rmdir","readdir"];t.forEach(t=>{e[t]=e[t]||o[t];t=t+"Sync";e[t]=e[t]||o[t]});e.maxBusyTries=e.maxBusyTries||3;e.emfileWait=e.emfileWait||1e3;if(e.glob===false){e.disableGlob=true}if(e.disableGlob!==true&&s===undefined){throw Error("glob dependency not found, set `options.disableGlob = true` if intentional")}e.disableGlob=e.disableGlob||false;e.glob=e.glob||a};const f=(e,t,r)=>{if(typeof t==="function"){r=t;t={}}n(e,"rimraf: missing path");n.equal(typeof e,"string","rimraf: path should be a string");n.equal(typeof r,"function","rimraf: callback function required");n(t,"rimraf: invalid options argument provided");n.equal(typeof t,"object","rimraf: options should be object");l(t);let i=0;let o=null;let a=0;const u=e=>{o=o||e;if(--a===0)r(o)};const f=(e,n)=>{if(e)return r(e);a=n.length;if(a===0)return r();n.forEach(e=>{const r=n=>{if(n){if((n.code==="EBUSY"||n.code==="ENOTEMPTY"||n.code==="EPERM")&&ih(e,t,r),i*100)}if(n.code==="EMFILE"&&ch(e,t,r),c++)}if(n.code==="ENOENT")n=null}c=0;u(n)};h(e,t,r)})};if(t.disableGlob||!s.hasMagic(e))return f(null,[e]);t.lstat(e,(r,n)=>{if(!r)return f(null,[e]);s(e,t.glob,f)})};const h=(e,t,r)=>{n(e);n(t);n(typeof r==="function");t.lstat(e,(n,i)=>{if(n&&n.code==="ENOENT")return r(null);if(n&&n.code==="EPERM"&&u)p(e,t,n,r);if(i&&i.isDirectory())return m(e,t,n,r);t.unlink(e,n=>{if(n){if(n.code==="ENOENT")return r(null);if(n.code==="EPERM")return u?p(e,t,n,r):m(e,t,n,r);if(n.code==="EISDIR")return m(e,t,n,r)}return r(n)})})};const p=(e,t,r,i)=>{n(e);n(t);n(typeof i==="function");t.chmod(e,438,n=>{if(n)i(n.code==="ENOENT"?null:r);else t.stat(e,(n,o)=>{if(n)i(n.code==="ENOENT"?null:r);else if(o.isDirectory())m(e,t,r,i);else t.unlink(e,i)})})};const d=(e,t,r)=>{n(e);n(t);try{t.chmodSync(e,438)}catch(e){if(e.code==="ENOENT")return;else throw r}let i;try{i=t.statSync(e)}catch(e){if(e.code==="ENOENT")return;else throw r}if(i.isDirectory())y(e,t,r);else t.unlinkSync(e)};const m=(e,t,r,i)=>{n(e);n(t);n(typeof i==="function");t.rmdir(e,n=>{if(n&&(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM"))v(e,t,i);else if(n&&n.code==="ENOTDIR")i(r);else i(n)})};const v=(e,t,r)=>{n(e);n(t);n(typeof r==="function");t.readdir(e,(n,o)=>{if(n)return r(n);let s=o.length;if(s===0)return t.rmdir(e,r);let a;o.forEach(n=>{f(i.join(e,n),t,n=>{if(a)return;if(n)return r(a=n);if(--s===0)t.rmdir(e,r)})})})};const g=(e,t)=>{t=t||{};l(t);n(e,"rimraf: missing path");n.equal(typeof e,"string","rimraf: path should be a string");n(t,"rimraf: missing options");n.equal(typeof t,"object","rimraf: options should be object");let r;if(t.disableGlob||!s.hasMagic(e)){r=[e]}else{try{t.lstatSync(e);r=[e]}catch(n){r=s.sync(e,t.glob)}}if(!r.length)return;for(let e=0;e{n(e);n(t);try{t.rmdirSync(e)}catch(n){if(n.code==="ENOENT")return;if(n.code==="ENOTDIR")throw r;if(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")E(e,t)}};const E=(e,t)=>{n(e);n(t);t.readdirSync(e).forEach(r=>g(i.join(e,r),t));const r=u?100:1;let o=0;do{let n=true;try{const i=t.rmdirSync(e,t);n=false;return i}finally{if(++o=0&&u>0){n=[];o=r.length;while(l>=0&&!a){if(l==c){n.push(l);c=r.indexOf(e,l+1)}else if(n.length==1){a=[n.pop(),u]}else{i=n.pop();if(i=0?c:u}if(n.length){a=[o,s]}}return a}},622:function(e){e.exports=require("path")},631:function(e){e.exports=require("net")},669:function(e){e.exports=require("util")},674:function(e,t,r){var n=r(11);var i=Object.create(null);var o=r(49);e.exports=n(inflight);function inflight(e,t){if(i[e]){i[e].push(t);return null}else{i[e]=[t];return makeres(e)}}function makeres(e){return o(function RES(){var t=i[e];var r=t.length;var n=slice(arguments);try{for(var o=0;or){t.splice(0,r);process.nextTick(function(){RES.apply(null,n)})}else{delete i[e]}}})}function slice(e){var t=e.length;var r=[];for(var n=0;n{let e;try{const t=c.init(i);const r=h.init(i);await t.clone();const s=await r.getFiles();const a=s.map(e=>r.getRepoRelativeFilePath(e));f(i);await new Promise(e=>setTimeout(e,5e3));await Promise.all(o.map(async e=>{const t=h.init(e);const i=c.init(e);await i.clone();const o=await t.getFiles();const u=o.filter(e=>!a.includes(t.getRepoRelativeFilePath(e)));await Promise.all([t.removeFiles(u),s.map(async e=>t.copyFile(e,n.join(t.getRepoFilePath(),r.getRepoRelativeFilePath(e))))]);await i.commitAll();f(e)}))}catch(t){e=t}f();if(!a){await u(s)}if(e){throw e}};e.exports=p},681:function(e){"use strict";function posix(e){return e.charAt(0)==="/"}function win32(e){var t=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;var r=t.exec(e);var n=r[1]||"";var i=Boolean(n&&n.charAt(1)!==":");return Boolean(r[2]||i)}e.exports=process.platform==="win32"?win32:posix;e.exports.posix=posix;e.exports.win32=win32},689:function(e,t,r){try{var n=r(669);if(typeof n.inherits!=="function")throw"";e.exports=n.inherits}catch(t){e.exports=r(315)}},718:function(e,t,r){const{exec:n}=r(129);const{parse:i}=r(142);const{GITHUB_TOKEN:o,GITHUB_SERVER:s,SRC_REPO:a,COMMIT_MESSAGE:c,GIT_USERNAME:u,GIT_EMAIL:l,DRY_RUN:f}=r(450);const h=r(543);const p=r(852);const d=(e,t)=>{let r=e;Object.keys(t).forEach(e=>{if(e==="COMMIT_MESSAGE"){return}r=r.replace(new RegExp(`%${e}%`,"g"),t[e])});return r};e.exports={init:e=>{const{getRepoPath:t,getRepoSlug:r,getRepoBranch:m}=h.init(e);const v=p(e);function execCmd(e,t){v.info(`EXEC: "${e}" IN "${t||"./"}"`);return new Promise((r,i)=>{n(e,{cwd:t},function(e,t){v.info(`OUTPUT: "${e}${t}"`);e?i(e):r(t.trim())})})}const g=async()=>{const e=["GIT_LFS_SKIP_SMUDGE=1","git clone","--depth 1",m()===undefined?false:` -b ${m()}`,`https://${o}@${s}/${r()}.git`,t()];return execCmd(e.filter(Boolean).join(" "))};const y=async()=>{const e=await execCmd(`git status --porcelain`,t());return i(e).length!==0};const E=async()=>{if(!await y()){v.info("NO CHANGES DETECTED");return}v.info("CHANGES DETECTED");v.info("COMMIT CHANGES...");const r=d(c,{SRC_REPO:a,TARGET_REPO:e});if(!f){let e="";const n=[`git config --local user.name "${u}"`,`git config --local user.email "${l}"`,`git add -A`,`git status`,`git commit --message "${r}"`,`git push`];try{for(cmd of n){e+=await execCmd(cmd,t())}}catch(e){}finally{if(!e.includes("Update file(s) from")){v.error(error);v.error(e);throw new Error("failed to commit changes")}}}v.info("CHANGES COMMITED")};return{clone:g,commitAll:E}}}},742:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:true});t.OidcClient=void 0;const i=r(539);const o=r(226);const s=r(470);class OidcClient{static createHttpClient(e=true,t=10){const r={allowRetries:e,maxRetries:t};return new i.HttpClient("actions/oidc-client",[new o.BearerCredentialHandler(OidcClient.getRequestToken())],r)}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 n(this,void 0,void 0,function*(){const r=OidcClient.createHttpClient();const n=yield r.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=n.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 n(this,void 0,void 0,function*(){try{let t=OidcClient.getIDTokenUrl();if(e){const r=encodeURIComponent(e);t=`${t}&audience=${r}`}s.debug(`ID token url is ${t}`);const r=yield OidcClient.getCall(t);s.setSecret(r);return r}catch(e){throw new Error(`Error message: ${e.message}`)}})}}t.OidcClient=OidcClient},747:function(e){e.exports=require("fs")},852:function(e,t,r){const n=r(470);const i=(...e)=>e.map(e=>Array.isArray(e)||Object.prototype.toString.call(e)==="[object Object]"?JSON.stringify(e,undefined,2):e).join(" ");const o={};e.exports=(e=>{o[e]=[];const t=(...t)=>{o[e].push(["debug",i(...t)]);if(!e){u()}};const r=(...t)=>{o[e].push(["error",i(...t)]);n.setFailed(`Action failed with error ${i(...t)}`);if(!e){u()}};const s=(...t)=>{o[e].push(["info",i(...t)]);if(!e){u()}};const a=(...t)=>{o[e].push(["warning",i(...t)]);if(!e){u()}};const c=e=>{o[e].forEach(([t,r])=>{n[t](e!=="undefined"?`${e}: ${r}`:r)});o[e]=[]};const u=(t=e)=>{if(!t){Object.keys(o).forEach(e=>{c(e)})}else{c(t)}};return{debug:t,error:r,info:s,print:u,warn:a}})},856:function(e,t,r){t.alphasort=alphasort;t.alphasorti=alphasorti;t.setopts=setopts;t.ownProp=ownProp;t.makeAbs=makeAbs;t.finish=finish;t.mark=mark;t.isIgnored=isIgnored;t.childrenIgnored=childrenIgnored;function ownProp(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var n=r(622);var i=r(93);var o=r(681);var s=i.Minimatch;function alphasorti(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())}function alphasort(e,t){return e.localeCompare(t)}function setupIgnores(e,t){e.ignore=t.ignore||[];if(!Array.isArray(e.ignore))e.ignore=[e.ignore];if(e.ignore.length){e.ignore=e.ignore.map(ignoreMap)}}function ignoreMap(e){var t=null;if(e.slice(-3)==="/**"){var r=e.replace(/(\/\*\*)+$/,"");t=new s(r,{dot:true})}return{matcher:new s(e,{dot:true}),gmatcher:t}}function setopts(e,t,r){if(!r)r={};if(r.matchBase&&-1===t.indexOf("/")){if(r.noglobstar){throw new Error("base matching requires globstar")}t="**/"+t}e.silent=!!r.silent;e.pattern=t;e.strict=r.strict!==false;e.realpath=!!r.realpath;e.realpathCache=r.realpathCache||Object.create(null);e.follow=!!r.follow;e.dot=!!r.dot;e.mark=!!r.mark;e.nodir=!!r.nodir;if(e.nodir)e.mark=true;e.sync=!!r.sync;e.nounique=!!r.nounique;e.nonull=!!r.nonull;e.nosort=!!r.nosort;e.nocase=!!r.nocase;e.stat=!!r.stat;e.noprocess=!!r.noprocess;e.absolute=!!r.absolute;e.maxLength=r.maxLength||Infinity;e.cache=r.cache||Object.create(null);e.statCache=r.statCache||Object.create(null);e.symlinks=r.symlinks||Object.create(null);setupIgnores(e,r);e.changedCwd=false;var i=process.cwd();if(!ownProp(r,"cwd"))e.cwd=i;else{e.cwd=n.resolve(r.cwd);e.changedCwd=e.cwd!==i}e.root=r.root||n.resolve(e.cwd,"/");e.root=n.resolve(e.root);if(process.platform==="win32")e.root=e.root.replace(/\\/g,"/");e.cwdAbs=o(e.cwd)?e.cwd:makeAbs(e,e.cwd);if(process.platform==="win32")e.cwdAbs=e.cwdAbs.replace(/\\/g,"/");e.nomount=!!r.nomount;r.nonegate=true;r.nocomment=true;e.minimatch=new s(t,r);e.options=e.minimatch.options}function finish(e){var t=e.nounique;var r=t?[]:Object.create(null);for(var n=0,i=e.matches.length;ne.trim().toUpperCase()).filter(e=>e)){if(n.some(t=>t===e)){return true}}return false}t.checkBypass=checkBypass}}); \ No newline at end of file +module.exports=function(e,t){"use strict";var r={};function __webpack_require__(t){if(r[t]){return r[t].exports}var n=r[t]={i:t,l:false,exports:{}};var i=true;try{e[t].call(n.exports,n,n.exports,__webpack_require__);i=false}finally{if(i)delete r[t]}n.l=true;return n.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(104)}return startup()}({11:function(e){e.exports=wrappy;function wrappy(e,t){if(e&&t)return wrappy(e)(t);if(typeof e!=="function")throw new TypeError("need wrapper function");Object.keys(e).forEach(function(t){wrapper[t]=e[t]});return wrapper;function wrapper(){var t=new Array(arguments.length);for(var r=0;r1024*64){throw new TypeError("pattern is too long")}var r=this.options;if(!r.noglobstar&&e==="**")return i;if(e==="")return"";var n="";var o=!!r.nocase;var u=false;var l=[];var h=[];var d;var m=false;var v=-1;var g=-1;var y=e.charAt(0)==="."?"":r.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)";var E=this;function clearStateChar(){if(d){switch(d){case"*":n+=c;o=true;break;case"?":n+=a;o=true;break;default:n+="\\"+d;break}E.debug("clearStateChar %j %j",d,n);d=false}}for(var _=0,b=e.length,O;_-1;k--){var I=h[k];var P=n.slice(0,I.reStart);var x=n.slice(I.reStart,I.reEnd-8);var M=n.slice(I.reEnd-8,I.reEnd);var N=n.slice(I.reEnd);M+=N;var G=P.split("(").length-1;var D=N;for(_=0;_=0;s--){o=e[s];if(o)break}for(s=0;s>> no match, partial?",e,f,t,h);if(f===a)return true}return false}var d;if(typeof u==="string"){if(n.nocase){d=l.toLowerCase()===u.toLowerCase()}else{d=l===u}this.debug("string match",u,l,d)}else{d=l.match(u);this.debug("pattern match",u,l,d)}if(!d)return false}if(o===a&&s===c){return true}else if(o===a){return r}else if(s===c){var m=o===a-1&&e[o]==="";return m}throw new Error("wtf?")};function globUnescape(e){return e.replace(/\\(.)/g,"$1")}function regExpEscape(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}},102:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});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 r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.issueCommand=void 0;const s=o(r(747));const a=o(r(87));const c=r(82);function issueCommand(e,t){const r=process.env[`GITHUB_${e}`];if(!r){throw new Error(`Unable to find environment variable for file command ${e}`)}if(!s.existsSync(r)){throw new Error(`Missing file at path: ${r}`)}s.appendFileSync(r,`${c.toCommandValue(t)}${a.EOL}`,{encoding:"utf8"})}t.issueCommand=issueCommand},104:function(e,t,r){const n=r(470);try{r(676)()}catch(e){n.setFailed(`Action failed with error ${e}`)}},117:function(e,t,r){var n=r(622);var i=process.platform==="win32";var o=r(747);var s=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function rethrow(){var e;if(s){var t=new Error;e=debugCallback}else e=missingCallback;return e;function debugCallback(e){if(e){t.message=e.message;e=t;missingCallback(e)}}function missingCallback(e){if(e){if(process.throwDeprecation)throw e;else if(!process.noDeprecation){var t="fs: missing callback "+(e.stack||e.message);if(process.traceDeprecation)console.trace(t);else console.error(t)}}}}function maybeCallback(e){return typeof e==="function"?e:rethrow()}var a=n.normalize;if(i){var c=/(.*?)(?:[\/\\]+|$)/g}else{var c=/(.*?)(?:[\/]+|$)/g}if(i){var u=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/}else{var u=/^[\/]*/}t.realpathSync=function realpathSync(e,t){e=n.resolve(e);if(t&&Object.prototype.hasOwnProperty.call(t,e)){return t[e]}var r=e,s={},a={};var l;var f;var h;var p;start();function start(){var t=u.exec(e);l=t[0].length;f=t[0];h=t[0];p="";if(i&&!a[h]){o.lstatSync(h);a[h]=true}}while(l=e.length){if(t)t[s]=e;return r(null,e)}c.lastIndex=f;var n=c.exec(e);d=h;h+=n[0];p=d+n[1];f=c.lastIndex;if(l[p]||t&&t[p]===p){return process.nextTick(LOOP)}if(t&&Object.prototype.hasOwnProperty.call(t,p)){return gotResolvedLink(t[p])}return o.lstat(p,gotStat)}function gotStat(e,n){if(e)return r(e);if(!n.isSymbolicLink()){l[p]=true;if(t)t[p]=p;return process.nextTick(LOOP)}if(!i){var s=n.dev.toString(32)+":"+n.ino.toString(32);if(a.hasOwnProperty(s)){return gotTarget(null,a[s],p)}}o.stat(p,function(e){if(e)return r(e);o.readlink(p,function(e,t){if(!i)a[s]=t;gotTarget(e,t)})})}function gotTarget(e,i,o){if(e)return r(e);var s=n.resolve(d,i);if(t)t[o]=s;gotResolvedLink(s)}function gotResolvedLink(t){e=n.resolve(t,e.slice(f));start()}}},129:function(e){e.exports=require("child_process")},141:function(e,t,r){"use strict";var n=r(631);var i=r(16);var o=r(605);var s=r(211);var a=r(614);var c=r(357);var u=r(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,r,n,i){var o=toOptions(r,n,i);for(var s=0,a=t.requests.length;s=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 r=this;var n={};r.sockets.push(n);var i=mergeOptions({},r.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=r.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,r){process.nextTick(function(){onConnect(e,t,r)})}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 c=new Error("tunneling socket could not be established, "+"statusCode="+i.statusCode);c.code="ECONNRESET";e.request.emit("error",c);r.removeSocket(n);return}if(a.length>0){l("got illegal response body from proxy");s.destroy();var c=new Error("got illegal response body from proxy");c.code="ECONNRESET";e.request.emit("error",c);r.removeSocket(n);return}l("tunneling connection has established");r.sockets[r.sockets.indexOf(n)]=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);r.removeSocket(n)}};TunnelingAgent.prototype.removeSocket=function removeSocket(e){var t=this.sockets.indexOf(e);if(t===-1){return}this.sockets.splice(t,1);var r=this.requests.shift();if(r){this.createSocket(r,function(e){r.request.onSocket(e)})}};function createSecureSocket(e,t){var r=this;TunnelingAgent.prototype.createSocket.call(r,e,function(n){var o=e.request.getHeader("host");var s=mergeOptions({},r.options,{socket:n,servername:o?o.replace(/:.*$/,""):e.host});var a=i.connect(0,s);r.sockets[r.sockets.indexOf(n)]=a;t(a)})}function toOptions(e,t,r){if(typeof e==="string"){return{host:e,port:t,localAddress:r}}return e}function mergeOptions(e){for(var t=1,r=arguments.length;ttypeof e==="string";e.exports=((e,t={})=>{if(!i(e)){t=e||{};e=run()}const{added:r,modified:n,untracked:o,deleted:s,renamed:a}=t;const c=parse(e);const u=pick(c,{added:r,modified:n,untracked:o,deleted:s,renamed:a});const l=getNames(u);return l});const o=({name:e})=>e;e.exports.getNames=getNames;function getNames(e){return e.map(o)}e.exports.run=run;function run(){const e=n("git",["status","--porcelain"]);return e.stdout.toString()}e.exports.parse=parse;function parse(e){const t=[];const r=e.split("\n").filter(Boolean);for(const e of r){const{name:r,mode:n}=parseLine(e);t.push({name:r,mode:n})}return t}const s="?";const a="R";const c="-> ";const u=e=>{const t=e.indexOf(c);const r=t+c.length;return e.slice(r)};function parseLine(e){const[t]=e;if(t===s)return{name:e.replace("?? ",""),mode:s};if(t===a)return{name:u(e),mode:a};const[r]=e.match(/^[\sA-Z]{1,}\s/,"");const n=e.replace(r,"");return{name:n,mode:r}}const l=({mode:e})=>/M/.test(e);const f=({mode:e})=>/A/.test(e);const h=({mode:e})=>/R/.test(e);const p=({mode:e})=>/D/.test(e);const d=({mode:e})=>/\?/.test(e);const m=({added:e,modified:t,untracked:r,deleted:n,renamed:i})=>o=>{let s=false;if(e)s=s||f(o);if(t)s=s||l(o);if(r)s=s||d(o);if(n)s=s||p(o);if(i)s=s||h(o);return s};e.exports.pick=pick;function pick(e,{added:t,modified:r,deleted:n,untracked:i,renamed:o}){return e.filter(m({added:t,modified:r,untracked:i,deleted:n,renamed:o}))}},211:function(e){e.exports=require("https")},226:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});class BasicCredentialHandler{constructor(e,t){this.username=e;this.password=t}prepareRequest(e){e.headers["Authorization"]="Basic "+Buffer.from(this.username+":"+this.password).toString("base64")}canHandleAuthentication(e){return false}handleAuthentication(e,t,r){return null}}t.BasicCredentialHandler=BasicCredentialHandler;class BearerCredentialHandler{constructor(e){this.token=e}prepareRequest(e){e.headers["Authorization"]="Bearer "+this.token}canHandleAuthentication(e){return false}handleAuthentication(e,t,r){return null}}t.BearerCredentialHandler=BearerCredentialHandler;class PersonalAccessTokenCredentialHandler{constructor(e){this.token=e}prepareRequest(e){e.headers["Authorization"]="Basic "+Buffer.from("PAT:"+this.token).toString("base64")}canHandleAuthentication(e){return false}handleAuthentication(e,t,r){return null}}t.PersonalAccessTokenCredentialHandler=PersonalAccessTokenCredentialHandler},245:function(e,t,r){e.exports=globSync;globSync.GlobSync=GlobSync;var n=r(747);var i=r(302);var o=r(93);var s=o.Minimatch;var a=r(402).Glob;var c=r(669);var u=r(622);var l=r(357);var f=r(681);var h=r(856);var p=h.alphasort;var d=h.alphasorti;var m=h.setopts;var v=h.ownProp;var g=h.childrenIgnored;var y=h.isIgnored;function globSync(e,t){if(typeof t==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob\n"+"See: https://github.com/isaacs/node-glob/issues/167");return new GlobSync(e,t).found}function GlobSync(e,t){if(!e)throw new Error("must provide pattern");if(typeof t==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob\n"+"See: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof GlobSync))return new GlobSync(e,t);m(this,e,t);if(this.noprocess)return this;var r=this.minimatch.set.length;this.matches=new Array(r);for(var n=0;nthis.maxLength)return false;if(!this.stat&&v(this.cache,t)){var i=this.cache[t];if(Array.isArray(i))i="DIR";if(!r||i==="DIR")return i;if(r&&i==="FILE")return false}var o;var s=this.statCache[t];if(!s){var a;try{a=n.lstatSync(t)}catch(e){if(e&&(e.code==="ENOENT"||e.code==="ENOTDIR")){this.statCache[t]=false;return false}}if(a&&a.isSymbolicLink()){try{s=n.statSync(t)}catch(e){s=a}}else{s=a}}this.statCache[t]=s;var i=true;if(s)i=s.isDirectory()?"DIR":"FILE";this.cache[t]=this.cache[t]||i;if(r&&i==="FILE")return false;return i};GlobSync.prototype._mark=function(e){return h.mark(this,e)};GlobSync.prototype._makeAbs=function(e){return h.makeAbs(this,e)}},302:function(e,t,r){e.exports=realpath;realpath.realpath=realpath;realpath.sync=realpathSync;realpath.realpathSync=realpathSync;realpath.monkeypatch=monkeypatch;realpath.unmonkeypatch=unmonkeypatch;var n=r(747);var i=n.realpath;var o=n.realpathSync;var s=process.version;var a=/^v[0-5]\./.test(s);var c=r(117);function newError(e){return e&&e.syscall==="realpath"&&(e.code==="ELOOP"||e.code==="ENOMEM"||e.code==="ENAMETOOLONG")}function realpath(e,t,r){if(a){return i(e,t,r)}if(typeof t==="function"){r=t;t=null}i(e,t,function(n,i){if(newError(n)){c.realpath(e,t,r)}else{r(n,i)}})}function realpathSync(e,t){if(a){return o(e,t)}try{return o(e,t)}catch(r){if(newError(r)){return c.realpathSync(e,t)}else{throw r}}}function monkeypatch(){n.realpath=realpath;n.realpathSync=realpathSync}function unmonkeypatch(){n.realpath=i;n.realpathSync=o}},306:function(e,t,r){var n=r(896);var i=r(621);e.exports=expandTop;var o="\0SLASH"+Math.random()+"\0";var s="\0OPEN"+Math.random()+"\0";var a="\0CLOSE"+Math.random()+"\0";var c="\0COMMA"+Math.random()+"\0";var u="\0PERIOD"+Math.random()+"\0";function numeric(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function escapeBraces(e){return e.split("\\\\").join(o).split("\\{").join(s).split("\\}").join(a).split("\\,").join(c).split("\\.").join(u)}function unescapeBraces(e){return e.split(o).join("\\").split(s).join("{").split(a).join("}").split(c).join(",").split(u).join(".")}function parseCommaParts(e){if(!e)return[""];var t=[];var r=i("{","}",e);if(!r)return e.split(",");var n=r.pre;var o=r.body;var s=r.post;var a=n.split(",");a[a.length-1]+="{"+o+"}";var c=parseCommaParts(s);if(s.length){a[a.length-1]+=c.shift();a.push.apply(a,c)}t.push.apply(t,a);return t}function expandTop(e){if(!e)return[];if(e.substr(0,2)==="{}"){e="\\{\\}"+e.substr(2)}return expand(escapeBraces(e),true).map(unescapeBraces)}function identity(e){return e}function embrace(e){return"{"+e+"}"}function isPadded(e){return/^-?0\d/.test(e)}function lte(e,t){return e<=t}function gte(e,t){return e>=t}function expand(e,t){var r=[];var o=i("{","}",e);if(!o||/\$$/.test(o.pre))return[e];var s=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body);var c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body);var u=s||c;var l=o.body.indexOf(",")>=0;if(!u&&!l){if(o.post.match(/,.*\}/)){e=o.pre+"{"+o.body+a+o.post;return expand(e)}return[e]}var f;if(u){f=o.body.split(/\.\./)}else{f=parseCommaParts(o.body);if(f.length===1){f=expand(f[0],false).map(embrace);if(f.length===1){var h=o.post.length?expand(o.post,false):[""];return h.map(function(e){return o.pre+f[0]+e})}}}var p=o.pre;var h=o.post.length?expand(o.post,false):[""];var d;if(u){var m=numeric(f[0]);var v=numeric(f[1]);var g=Math.max(f[0].length,f[1].length);var y=f.length==3?Math.abs(numeric(f[2])):1;var E=lte;var _=v0){var R=new Array(S+1).join("0");if(O<0)w="-"+R+w.slice(1);else w=R+w}}}d.push(w)}}else{d=n(f,function(e){return expand(e,false)})}for(var T=0;T1)return true;for(var o=0;othis.maxLength)return t();if(!this.stat&&g(this.cache,r)){var o=this.cache[r];if(Array.isArray(o))o="DIR";if(!i||o==="DIR")return t(null,o);if(i&&o==="FILE")return t()}var s;var a=this.statCache[r];if(a!==undefined){if(a===false)return t(null,a);else{var c=a.isDirectory()?"DIR":"FILE";if(i&&c==="FILE")return t();else return t(null,c,a)}}var u=this;var l=y("stat\0"+r,lstatcb_);if(l)n.lstat(r,l);function lstatcb_(i,o){if(o&&o.isSymbolicLink()){return n.stat(r,function(n,i){if(n)u._stat2(e,r,null,o,t);else u._stat2(e,r,n,i,t)})}else{u._stat2(e,r,i,o,t)}}};Glob.prototype._stat2=function(e,t,r,n,i){if(r&&(r.code==="ENOENT"||r.code==="ENOTDIR")){this.statCache[t]=false;return i()}var o=e.slice(-1)==="/";this.statCache[t]=n;if(t.slice(-1)==="/"&&n&&!n.isDirectory())return i(null,false,n);var s=true;if(n)s=n.isDirectory()?"DIR":"FILE";this.cache[t]=this.cache[t]||s;if(o&&s==="FILE")return i();return i(null,s,n)}},413:function(e,t,r){e.exports=r(141)},431:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});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 r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.issue=t.issueCommand=void 0;const s=o(r(87));const a=r(82);function issueCommand(e,t,r){const n=new Command(e,t,r);process.stdout.write(n.toString()+s.EOL)}t.issueCommand=issueCommand;function issue(e,t=""){issueCommand(e,{},t)}t.issue=issue;const c="::";class Command{constructor(e,t,r){if(!e){e="missing.command"}this.command=e;this.properties=t;this.message=r}toString(){let e=c+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";let t=true;for(const r in this.properties){if(this.properties.hasOwnProperty(r)){const n=this.properties[r];if(n){if(t){t=false}else{e+=","}e+=`${r}=${escapeProperty(n)}`}}}}e+=`${c}${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")}},450:function(e,t,r){const n=r(747);const i=r(470);const o=r(852)();const s=e=>{return e.split("\n").map(e=>e.trim())};const a={get COMMIT_MESSAGE(){return i.getInput("COMMIT_MESSAGE",{required:false})||`Update file(s) from "%SRC_REPO%"`},DRY_RUN:["1","true"].includes(i.getInput("DRY_RUN",{required:false}).toLowerCase()),FILE_PATTERNS:s(i.getInput("FILE_PATTERNS")).map(e=>new RegExp(e)),GITHUB_SERVER:i.getInput("GITHUB_SERVER",{required:false})||"github.com",GITHUB_TOKEN:i.getInput("GITHUB_TOKEN",{required:true}),GIT_EMAIL:i.getInput("GIT_EMAIL")||`${process.env.GITHUB_ACTOR}@users.noreply.github.com`,GIT_USERNAME:i.getInput("GIT_USERNAME",{required:false})||process.env.GITHUB_ACTOR,SKIP_CLEANUP:["1","true"].includes(i.getInput("SKIP_CLEANUP",{required:false}).toLowerCase()),SKIP_DELETE:["1","true"].includes(i.getInput("SKIP_DELETE",{required:false}).toLowerCase()),SKIP_REPLACE:["1","true"].includes(i.getInput("SKIP_REPLACE",{required:false}).toLowerCase()),SRC_REPO:i.getInput("SRC_REPO",{required:false})||process.env.GITHUB_REPOSITORY,SRC_ROOT:i.getInput("SRC_ROOT",{required:false})||"/",TARGET_REPOS:s(i.getInput("TARGET_REPOS",{required:true})),TARGET_ROOT:i.getInput("TARGET_ROOT",{required:false})||"/",TMPDIR:i.getInput("TEMP_DIR",{required:false})||`tmp-${Date.now().toString()}`};while(n.existsSync(a.TMPDIR)){a.TMPDIR=`tmp-${Date.now().toString()}`;o.info(`TEMP_DIR already exists. Using "${a.TMPDIR}" now.`)}o.info("Context:",{...a,GITHUB_TOKEN:""});e.exports=a},470:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});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 r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};var s=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.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=r(431);const c=r(102);const u=r(82);const l=o(r(87));const f=o(r(622));const h=r(742);var p;(function(e){e[e["Success"]=0]="Success";e[e["Failure"]=1]="Failure"})(p=t.ExitCode||(t.ExitCode={}));function exportVariable(e,t){const r=u.toCommandValue(t);process.env[e]=r;const n=process.env["GITHUB_ENV"]||"";if(n){const t="_GitHubActionsFileCommandDelimeter_";const n=`${e}<<${t}${l.EOL}${r}${l.EOL}${t}`;c.issueCommand("ENV",n)}else{a.issueCommand("set-env",{name:e},r)}}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){c.issueCommand("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 r=process.env[`INPUT_${e.replace(/ /g,"_").toUpperCase()}`]||"";if(t&&t.required&&!r){throw new Error(`Input required and not supplied: ${e}`)}if(t&&t.trimWhitespace===false){return r}return r.trim()}t.getInput=getInput;function getMultilineInput(e,t){const r=getInput(e,t).split("\n").filter(e=>e!=="");return r}t.getMultilineInput=getMultilineInput;function getBooleanInput(e,t){const r=["true","True","TRUE"];const n=["false","False","FALSE"];const i=getInput(e,t);if(r.includes(i))return true;if(n.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){process.stdout.write(l.EOL);a.issueCommand("set-output",{name:e},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",u.toCommandProperties(t),e instanceof Error?e.toString():e)}t.error=error;function warning(e,t={}){a.issueCommand("warning",u.toCommandProperties(t),e instanceof Error?e.toString():e)}t.warning=warning;function notice(e,t={}){a.issueCommand("notice",u.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 r;try{r=yield t()}finally{endGroup()}return r})}t.group=group;function saveState(e,t){a.issueCommand("save-state",{name:e},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 h.OidcClient.getIDToken(e)})}t.getIDToken=getIDToken},539:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});const n=r(605);const i=r(211);const o=r(950);let s;var a;(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"})(a=t.HttpCodes||(t.HttpCodes={}));var c;(function(e){e["Accept"]="accept";e["ContentType"]="content-type"})(c=t.Headers||(t.Headers={}));var u;(function(e){e["ApplicationJson"]="application/json"})(u=t.MediaTypes||(t.MediaTypes={}));function getProxyUrl(e){let t=o.getProxyUrl(new URL(e));return t?t.href:""}t.getProxyUrl=getProxyUrl;const l=[a.MovedPermanently,a.ResourceMoved,a.SeeOther,a.TemporaryRedirect,a.PermanentRedirect];const f=[a.BadGateway,a.ServiceUnavailable,a.GatewayTimeout];const h=["OPTIONS","GET","DELETE","HEAD"];const p=10;const d=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 new Promise(async(e,t)=>{let r=Buffer.alloc(0);this.message.on("data",e=>{r=Buffer.concat([r,e])});this.message.on("end",()=>{e(r.toString())})})}}t.HttpClientResponse=HttpClientResponse;function isHttps(e){let t=new URL(e);return t.protocol==="https:"}t.isHttps=isHttps;class HttpClient{constructor(e,t,r){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=r;if(r){if(r.ignoreSslError!=null){this._ignoreSslError=r.ignoreSslError}this._socketTimeout=r.socketTimeout;if(r.allowRedirects!=null){this._allowRedirects=r.allowRedirects}if(r.allowRedirectDowngrade!=null){this._allowRedirectDowngrade=r.allowRedirectDowngrade}if(r.maxRedirects!=null){this._maxRedirects=Math.max(r.maxRedirects,0)}if(r.keepAlive!=null){this._keepAlive=r.keepAlive}if(r.allowRetries!=null){this._allowRetries=r.allowRetries}if(r.maxRetries!=null){this._maxRetries=r.maxRetries}}}options(e,t){return this.request("OPTIONS",e,null,t||{})}get(e,t){return this.request("GET",e,null,t||{})}del(e,t){return this.request("DELETE",e,null,t||{})}post(e,t,r){return this.request("POST",e,t,r||{})}patch(e,t,r){return this.request("PATCH",e,t,r||{})}put(e,t,r){return this.request("PUT",e,t,r||{})}head(e,t){return this.request("HEAD",e,null,t||{})}sendStream(e,t,r,n){return this.request(e,t,r,n)}async getJson(e,t={}){t[c.Accept]=this._getExistingOrDefaultHeader(t,c.Accept,u.ApplicationJson);let r=await this.get(e,t);return this._processResponse(r,this.requestOptions)}async postJson(e,t,r={}){let n=JSON.stringify(t,null,2);r[c.Accept]=this._getExistingOrDefaultHeader(r,c.Accept,u.ApplicationJson);r[c.ContentType]=this._getExistingOrDefaultHeader(r,c.ContentType,u.ApplicationJson);let i=await this.post(e,n,r);return this._processResponse(i,this.requestOptions)}async putJson(e,t,r={}){let n=JSON.stringify(t,null,2);r[c.Accept]=this._getExistingOrDefaultHeader(r,c.Accept,u.ApplicationJson);r[c.ContentType]=this._getExistingOrDefaultHeader(r,c.ContentType,u.ApplicationJson);let i=await this.put(e,n,r);return this._processResponse(i,this.requestOptions)}async patchJson(e,t,r={}){let n=JSON.stringify(t,null,2);r[c.Accept]=this._getExistingOrDefaultHeader(r,c.Accept,u.ApplicationJson);r[c.ContentType]=this._getExistingOrDefaultHeader(r,c.ContentType,u.ApplicationJson);let i=await this.patch(e,n,r);return this._processResponse(i,this.requestOptions)}async request(e,t,r,n){if(this._disposed){throw new Error("Client has already been disposed.")}let i=new URL(t);let o=this._prepareRequest(e,i,n);let s=this._allowRetries&&h.indexOf(e)!=-1?this._maxRetries+1:1;let c=0;let u;while(c0){const s=u.message.headers["location"];if(!s){break}let 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.")}await u.readBody();if(a.hostname!==i.hostname){for(let e in n){if(e.toLowerCase()==="authorization"){delete n[e]}}}o=this._prepareRequest(e,a,n);u=await this.requestRaw(o,r);t--}if(f.indexOf(u.message.statusCode)==-1){return u}c+=1;if(c{let i=function(e,t){if(e){n(e)}r(t)};this.requestRawWithCallback(e,t,i)})}requestRawWithCallback(e,t,r){let n;if(typeof t==="string"){e.options.headers["Content-Length"]=Buffer.byteLength(t,"utf8")}let i=false;let o=(e,t)=>{if(!i){i=true;r(e,t)}};let s=e.httpModule.request(e.options,e=>{let t=new HttpClientResponse(e);o(null,t)});s.on("socket",e=>{n=e});s.setTimeout(this._socketTimeout||3*6e4,()=>{if(n){n.end()}o(new Error("Request timeout: "+e.options.path),null)});s.on("error",function(e){o(e,null)});if(t&&typeof t==="string"){s.write(t,"utf8")}if(t&&typeof t!=="string"){t.on("close",function(){s.end()});t.pipe(s)}else{s.end()}}getAgent(e){let t=new URL(e);return this._getAgent(t)}_prepareRequest(e,t,r){const o={};o.parsedUrl=t;const s=o.parsedUrl.protocol==="https:";o.httpModule=s?i:n;const a=s?443:80;o.options={};o.options.host=o.parsedUrl.hostname;o.options.port=o.parsedUrl.port?parseInt(o.parsedUrl.port):a;o.options.path=(o.parsedUrl.pathname||"")+(o.parsedUrl.search||"");o.options.method=e;o.options.headers=this._mergeHeaders(r);if(this.userAgent!=null){o.options.headers["user-agent"]=this.userAgent}o.options.agent=this._getAgent(o.parsedUrl);if(this.handlers){this.handlers.forEach(e=>{e.prepareRequest(o.options)})}return o}_mergeHeaders(e){const t=e=>Object.keys(e).reduce((t,r)=>(t[r.toLowerCase()]=e[r],t),{});if(this.requestOptions&&this.requestOptions.headers){return Object.assign({},t(this.requestOptions.headers),t(e))}return t(e||{})}_getExistingOrDefaultHeader(e,t,r){const n=e=>Object.keys(e).reduce((t,r)=>(t[r.toLowerCase()]=e[r],t),{});let i;if(this.requestOptions&&this.requestOptions.headers){i=n(this.requestOptions.headers)[t]}return e[t]||i||r}_getAgent(e){let t;let a=o.getProxyUrl(e);let c=a&&a.hostname;if(this._keepAlive&&c){t=this._proxyAgent}if(this._keepAlive&&!c){t=this._agent}if(!!t){return t}const u=e.protocol==="https:";let l=100;if(!!this.requestOptions){l=this.requestOptions.maxSockets||n.globalAgent.maxSockets}if(c){if(!s){s=r(413)}const e={maxSockets:l,keepAlive:this._keepAlive,proxy:{...(a.username||a.password)&&{proxyAuth:`${a.username}:${a.password}`},host:a.hostname,port:a.port}};let n;const i=a.protocol==="https:";if(u){n=i?s.httpsOverHttps:s.httpsOverHttp}else{n=i?s.httpOverHttps:s.httpOverHttp}t=n(e);this._proxyAgent=t}if(this._keepAlive&&!t){const e={keepAlive:this._keepAlive,maxSockets:l};t=u?new i.Agent(e):new n.Agent(e);this._agent=t}if(!t){t=u?i.globalAgent:n.globalAgent}if(u&&this._ignoreSslError){t.options=Object.assign(t.options||{},{rejectUnauthorized:false})}return t}_performExponentialBackoff(e){e=Math.min(p,e);const t=d*Math.pow(2,e);return new Promise(e=>setTimeout(()=>e(),t))}static dateTimeDeserializer(e,t){if(typeof t==="string"){let e=new Date(t);if(!isNaN(e.valueOf())){return e}}return t}async _processResponse(e,t){return new Promise(async(r,n)=>{const i=e.message.statusCode;const o={statusCode:i,result:null,headers:{}};if(i==a.NotFound){r(o)}let s;let c;try{c=await e.readBody();if(c&&c.length>0){if(t&&t.deserializeDates){s=JSON.parse(c,HttpClient.dateTimeDeserializer)}else{s=JSON.parse(c)}o.result=s}o.headers=e.message.headers}catch(e){}if(i>299){let e;if(s&&s.message){e=s.message}else if(c&&c.length>0){e=c}else{e="Failed request: ("+i+")"}let t=new HttpClientError(e,i);t.result=o.result;n(t)}else{r(o)}})}}t.HttpClient=HttpClient},543:function(e,t,r){const n=r(747).promises;const i=r(622);const o=r(50);const s=r(569);const{TMPDIR:a,FILE_PATTERNS:c,DRY_RUN:u,SKIP_DELETE:l,SKIP_REPLACE:f,SRC_REPO:h,SRC_ROOT:p,TARGET_ROOT:d}=r(450);const m=r(852);const v=e=>{const t=m(e);const r=()=>{return e.split(":")[0]};const s=()=>{return e.split(":")[1]||undefined};const v=()=>{return i.join(a,`${r()}${s()===undefined?"":`-${s()}`}`)};const g=()=>e===h?p:d;const y=()=>i.join(v(),g());const E=e=>{return i.relative(y(),e)};const _=t=>t.replace(/\\/g,"/").replace(/^\//,"").replace(new RegExp(`^${a}/${e}${g()}`),"");const b=e=>{t.info("FILE_PATTERNS",c.map(e=>e.toString()));return e.filter(e=>{cleanFile=_(e);const t=c.some(e=>e.test(cleanFile));return t})};const O=async()=>{const e=await o(v(),[".git"]);t.debug("FILES:",JSON.stringify(e.map(_),undefined,2));const r=b(e);t.info("MATCHING FILES:",JSON.stringify(r.map(_),undefined,2));return r};const w=async(e,r)=>{const o=await n.access(r).then(()=>true).catch(()=>false);if(f&&o){t.info("skip copying",e.replace(/\\/g,"/").replace(/^\//,""),"to",r.replace(/\\/g,"/").replace(/^\//,""),"because SKIP_REPLACE = true");return}t.info("copy",e.replace(/\\/g,"/").replace(/^\//,""),"to",r.replace(/\\/g,"/").replace(/^\//,""));if(u){return}await n.mkdir(i.dirname(r),{recursive:true});await n.copyFile(e,r)};const S=async e=>{if(l){t.info("SKIP REMOVING FILES because `SKIP_DELETE` is set to `true`",e.map(e=>`"${e}"`).join(", "));return}t.info("REMOVE FILES",e);if(u){return}return Promise.all(e.map(e=>n.unlink(e)))};return{copyFile:w,getFiles:O,getRepoBranch:s,getRepoFilePath:y,getRepoPath:v,getRepoRelativeFilePath:E,getRepoSlug:r,removeFiles:S}};const g=async e=>{new Promise((t,r)=>{s(e,{disableGlob:true},e=>{if(e){return r(e)}t()})})};e.exports={init:v,removeDir:g}},569:function(e,t,r){const n=r(357);const i=r(622);const o=r(747);let s=undefined;try{s=r(402)}catch(e){}const a={nosort:true,silent:true};let c=0;const u=process.platform==="win32";const l=e=>{const t=["unlink","chmod","stat","lstat","rmdir","readdir"];t.forEach(t=>{e[t]=e[t]||o[t];t=t+"Sync";e[t]=e[t]||o[t]});e.maxBusyTries=e.maxBusyTries||3;e.emfileWait=e.emfileWait||1e3;if(e.glob===false){e.disableGlob=true}if(e.disableGlob!==true&&s===undefined){throw Error("glob dependency not found, set `options.disableGlob = true` if intentional")}e.disableGlob=e.disableGlob||false;e.glob=e.glob||a};const f=(e,t,r)=>{if(typeof t==="function"){r=t;t={}}n(e,"rimraf: missing path");n.equal(typeof e,"string","rimraf: path should be a string");n.equal(typeof r,"function","rimraf: callback function required");n(t,"rimraf: invalid options argument provided");n.equal(typeof t,"object","rimraf: options should be object");l(t);let i=0;let o=null;let a=0;const u=e=>{o=o||e;if(--a===0)r(o)};const f=(e,n)=>{if(e)return r(e);a=n.length;if(a===0)return r();n.forEach(e=>{const r=n=>{if(n){if((n.code==="EBUSY"||n.code==="ENOTEMPTY"||n.code==="EPERM")&&ih(e,t,r),i*100)}if(n.code==="EMFILE"&&ch(e,t,r),c++)}if(n.code==="ENOENT")n=null}c=0;u(n)};h(e,t,r)})};if(t.disableGlob||!s.hasMagic(e))return f(null,[e]);t.lstat(e,(r,n)=>{if(!r)return f(null,[e]);s(e,t.glob,f)})};const h=(e,t,r)=>{n(e);n(t);n(typeof r==="function");t.lstat(e,(n,i)=>{if(n&&n.code==="ENOENT")return r(null);if(n&&n.code==="EPERM"&&u)p(e,t,n,r);if(i&&i.isDirectory())return m(e,t,n,r);t.unlink(e,n=>{if(n){if(n.code==="ENOENT")return r(null);if(n.code==="EPERM")return u?p(e,t,n,r):m(e,t,n,r);if(n.code==="EISDIR")return m(e,t,n,r)}return r(n)})})};const p=(e,t,r,i)=>{n(e);n(t);n(typeof i==="function");t.chmod(e,438,n=>{if(n)i(n.code==="ENOENT"?null:r);else t.stat(e,(n,o)=>{if(n)i(n.code==="ENOENT"?null:r);else if(o.isDirectory())m(e,t,r,i);else t.unlink(e,i)})})};const d=(e,t,r)=>{n(e);n(t);try{t.chmodSync(e,438)}catch(e){if(e.code==="ENOENT")return;else throw r}let i;try{i=t.statSync(e)}catch(e){if(e.code==="ENOENT")return;else throw r}if(i.isDirectory())y(e,t,r);else t.unlinkSync(e)};const m=(e,t,r,i)=>{n(e);n(t);n(typeof i==="function");t.rmdir(e,n=>{if(n&&(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM"))v(e,t,i);else if(n&&n.code==="ENOTDIR")i(r);else i(n)})};const v=(e,t,r)=>{n(e);n(t);n(typeof r==="function");t.readdir(e,(n,o)=>{if(n)return r(n);let s=o.length;if(s===0)return t.rmdir(e,r);let a;o.forEach(n=>{f(i.join(e,n),t,n=>{if(a)return;if(n)return r(a=n);if(--s===0)t.rmdir(e,r)})})})};const g=(e,t)=>{t=t||{};l(t);n(e,"rimraf: missing path");n.equal(typeof e,"string","rimraf: path should be a string");n(t,"rimraf: missing options");n.equal(typeof t,"object","rimraf: options should be object");let r;if(t.disableGlob||!s.hasMagic(e)){r=[e]}else{try{t.lstatSync(e);r=[e]}catch(n){r=s.sync(e,t.glob)}}if(!r.length)return;for(let e=0;e{n(e);n(t);try{t.rmdirSync(e)}catch(n){if(n.code==="ENOENT")return;if(n.code==="ENOTDIR")throw r;if(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")E(e,t)}};const E=(e,t)=>{n(e);n(t);t.readdirSync(e).forEach(r=>g(i.join(e,r),t));const r=u?100:1;let o=0;do{let n=true;try{const i=t.rmdirSync(e,t);n=false;return i}finally{if(++o=0&&u>0){n=[];o=r.length;while(l>=0&&!a){if(l==c){n.push(l);c=r.indexOf(e,l+1)}else if(n.length==1){a=[n.pop(),u]}else{i=n.pop();if(i=0?c:u}if(n.length){a=[o,s]}}return a}},622:function(e){e.exports=require("path")},631:function(e){e.exports=require("net")},669:function(e){e.exports=require("util")},674:function(e,t,r){var n=r(11);var i=Object.create(null);var o=r(49);e.exports=n(inflight);function inflight(e,t){if(i[e]){i[e].push(t);return null}else{i[e]=[t];return makeres(e)}}function makeres(e){return o(function RES(){var t=i[e];var r=t.length;var n=slice(arguments);try{for(var o=0;or){t.splice(0,r);process.nextTick(function(){RES.apply(null,n)})}else{delete i[e]}}})}function slice(e){var t=e.length;var r=[];for(var n=0;n{let e;try{const t=c.init(i);const r=h.init(i);await t.clone();const s=await r.getFiles();const a=s.map(e=>r.getRepoRelativeFilePath(e));f(i);await new Promise(e=>setTimeout(e,5e3));await Promise.all(o.map(async e=>{const t=h.init(e);const i=c.init(e);await i.clone();const o=await t.getFiles();const u=o.filter(e=>!a.includes(t.getRepoRelativeFilePath(e)));await Promise.all([t.removeFiles(u),s.map(async e=>t.copyFile(e,n.join(t.getRepoFilePath(),r.getRepoRelativeFilePath(e))))]);await i.commitAll();f(e)}))}catch(t){e=t}f();if(!a){await u(s)}if(e){throw e}};e.exports=p},681:function(e){"use strict";function posix(e){return e.charAt(0)==="/"}function win32(e){var t=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;var r=t.exec(e);var n=r[1]||"";var i=Boolean(n&&n.charAt(1)!==":");return Boolean(r[2]||i)}e.exports=process.platform==="win32"?win32:posix;e.exports.posix=posix;e.exports.win32=win32},689:function(e,t,r){try{var n=r(669);if(typeof n.inherits!=="function")throw"";e.exports=n.inherits}catch(t){e.exports=r(315)}},718:function(e,t,r){const{exec:n}=r(129);const{parse:i}=r(142);const{GITHUB_TOKEN:o,GITHUB_SERVER:s,SRC_REPO:a,COMMIT_MESSAGE:c,GIT_USERNAME:u,GIT_EMAIL:l,DRY_RUN:f}=r(450);const h=r(543);const p=r(852);const d=(e,t)=>{let r=e;Object.keys(t).forEach(e=>{if(e==="COMMIT_MESSAGE"){return}r=r.replace(new RegExp(`%${e}%`,"g"),t[e])});return r};e.exports={init:e=>{const{getRepoPath:t,getRepoSlug:r,getRepoBranch:m}=h.init(e);const v=p(e);function execCmd(e,t){v.info(`EXEC: "${e}" IN "${t||"./"}"`);return new Promise((r,i)=>{n(e,{cwd:t},function(e,t){v.info(`OUTPUT: "${e}${t}"`);e?i(e):r(t.trim())})})}const g=async()=>{const e=["GIT_LFS_SKIP_SMUDGE=1","git clone","--depth 1",m()===undefined?false:` -b ${m()}`,`https://${o}@${s}/${r()}.git`,t()];return execCmd(e.filter(Boolean).join(" "))};const y=async()=>{const e=await execCmd(`git status --porcelain`,t());return i(e).length!==0};const E=async()=>{if(!await y()){v.info("NO CHANGES DETECTED");return}v.info("CHANGES DETECTED");v.info("COMMIT CHANGES...");const r=d(c,{SRC_REPO:a,TARGET_REPO:e});if(!f){let e="";const n=[`git config --local user.name "${u}"`,`git config --local user.email "${l}"`,`git add -A`,`git status`,`git commit --message "${r}"`,`git push`];try{for(cmd of n){e+=await execCmd(cmd,t())}}catch(e){v.error(e)}finally{if(!e.includes("Update file(s) from")){v.error(e);throw new Error("failed to commit changes")}}}v.info("CHANGES COMMITED")};return{clone:g,commitAll:E}}}},742:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:true});t.OidcClient=void 0;const i=r(539);const o=r(226);const s=r(470);class OidcClient{static createHttpClient(e=true,t=10){const r={allowRetries:e,maxRetries:t};return new i.HttpClient("actions/oidc-client",[new o.BearerCredentialHandler(OidcClient.getRequestToken())],r)}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 n(this,void 0,void 0,function*(){const r=OidcClient.createHttpClient();const n=yield r.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=n.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 n(this,void 0,void 0,function*(){try{let t=OidcClient.getIDTokenUrl();if(e){const r=encodeURIComponent(e);t=`${t}&audience=${r}`}s.debug(`ID token url is ${t}`);const r=yield OidcClient.getCall(t);s.setSecret(r);return r}catch(e){throw new Error(`Error message: ${e.message}`)}})}}t.OidcClient=OidcClient},747:function(e){e.exports=require("fs")},852:function(e,t,r){const n=r(470);const i=(...e)=>e.map(e=>Array.isArray(e)||Object.prototype.toString.call(e)==="[object Object]"?JSON.stringify(e,undefined,2):e).join(" ");const o={};e.exports=(e=>{o[e]=[];const t=(...t)=>{o[e].push(["debug",i(...t)]);if(!e){u()}};const r=(...t)=>{o[e].push(["error",i(...t)]);n.setFailed(`Action failed with error ${i(...t)}`);if(!e){u()}};const s=(...t)=>{o[e].push(["info",i(...t)]);if(!e){u()}};const a=(...t)=>{o[e].push(["warning",i(...t)]);if(!e){u()}};const c=e=>{o[e].forEach(([t,r])=>{n[t](e!=="undefined"?`${e}: ${r}`:r)});o[e]=[]};const u=(t=e)=>{if(!t){Object.keys(o).forEach(e=>{c(e)})}else{c(t)}};return{debug:t,error:r,info:s,print:u,warn:a}})},856:function(e,t,r){t.alphasort=alphasort;t.alphasorti=alphasorti;t.setopts=setopts;t.ownProp=ownProp;t.makeAbs=makeAbs;t.finish=finish;t.mark=mark;t.isIgnored=isIgnored;t.childrenIgnored=childrenIgnored;function ownProp(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var n=r(622);var i=r(93);var o=r(681);var s=i.Minimatch;function alphasorti(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())}function alphasort(e,t){return e.localeCompare(t)}function setupIgnores(e,t){e.ignore=t.ignore||[];if(!Array.isArray(e.ignore))e.ignore=[e.ignore];if(e.ignore.length){e.ignore=e.ignore.map(ignoreMap)}}function ignoreMap(e){var t=null;if(e.slice(-3)==="/**"){var r=e.replace(/(\/\*\*)+$/,"");t=new s(r,{dot:true})}return{matcher:new s(e,{dot:true}),gmatcher:t}}function setopts(e,t,r){if(!r)r={};if(r.matchBase&&-1===t.indexOf("/")){if(r.noglobstar){throw new Error("base matching requires globstar")}t="**/"+t}e.silent=!!r.silent;e.pattern=t;e.strict=r.strict!==false;e.realpath=!!r.realpath;e.realpathCache=r.realpathCache||Object.create(null);e.follow=!!r.follow;e.dot=!!r.dot;e.mark=!!r.mark;e.nodir=!!r.nodir;if(e.nodir)e.mark=true;e.sync=!!r.sync;e.nounique=!!r.nounique;e.nonull=!!r.nonull;e.nosort=!!r.nosort;e.nocase=!!r.nocase;e.stat=!!r.stat;e.noprocess=!!r.noprocess;e.absolute=!!r.absolute;e.maxLength=r.maxLength||Infinity;e.cache=r.cache||Object.create(null);e.statCache=r.statCache||Object.create(null);e.symlinks=r.symlinks||Object.create(null);setupIgnores(e,r);e.changedCwd=false;var i=process.cwd();if(!ownProp(r,"cwd"))e.cwd=i;else{e.cwd=n.resolve(r.cwd);e.changedCwd=e.cwd!==i}e.root=r.root||n.resolve(e.cwd,"/");e.root=n.resolve(e.root);if(process.platform==="win32")e.root=e.root.replace(/\\/g,"/");e.cwdAbs=o(e.cwd)?e.cwd:makeAbs(e,e.cwd);if(process.platform==="win32")e.cwdAbs=e.cwdAbs.replace(/\\/g,"/");e.nomount=!!r.nomount;r.nonegate=true;r.nocomment=true;e.minimatch=new s(t,r);e.options=e.minimatch.options}function finish(e){var t=e.nounique;var r=t?[]:Object.create(null);for(var n=0,i=e.matches.length;ne.trim().toUpperCase()).filter(e=>e)){if(n.some(t=>t===e)){return true}}return false}t.checkBypass=checkBypass}}); \ No newline at end of file diff --git a/src/git.js b/src/git.js index 147e8ec..9b269d5 100644 --- a/src/git.js +++ b/src/git.js @@ -94,9 +94,9 @@ module.exports = { output += await execCmd(cmd, getRepoPath()); } } catch (error) { + logger.error(error); } finally { if (!output.includes("Update file(s) from")) { - logger.error(error); logger.error(output); throw new Error("failed to commit changes"); } diff --git a/src/utils.js b/src/utils.js index bdea1c8..787ae3d 100644 --- a/src/utils.js +++ b/src/utils.js @@ -110,6 +110,7 @@ const init = (repoFullname) => { "SKIP REMOVING FILES because `SKIP_DELETE` is set to `true`", filePaths.map((f) => `"${f}"`).join(", ") ); + return; } logger.info("REMOVE FILES", filePaths); if (DRY_RUN) {