diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d10b3c..109ad94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. --- +## 0.0.5 - 2021-05-10 + +- Fix broken imports in v0.0.4 + ## 0.0.4 - 2021-05-07 - Update dependencies diff --git a/README.md b/README.md index ebc9bdb..6ab22ee 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ jobs: steps: - name: Approve pull request if: github.actor == 'dependabot[bot]' - uses: andrewmusgrave/automatic-pull-request-review@0.0.4 + uses: andrewmusgrave/automatic-pull-request-review@0.0.5 with: repo-token: ${{ secrets.GITHUB_TOKEN }} event: APPROVE diff --git a/dist/index.js b/dist/index.js index f47c8f6..ef6815d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4,4 +4,4 @@ * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. - */function isObject(e){return Object.prototype.toString.call(e)==="[object Object]"}function isPlainObject(e){var r,t;if(isObject(e)===false)return false;r=e.constructor;if(r===undefined)return true;t=r.prototype;if(isObject(t)===false)return false;if(t.hasOwnProperty("isPrototypeOf")===false){return false}return true}r.isPlainObject=isPlainObject},467:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var s=_interopDefault(t(413));var o=_interopDefault(t(605));var n=_interopDefault(t(835));var i=_interopDefault(t(211));var a=_interopDefault(t(761));const c=s.Readable;const u=Symbol("buffer");const p=Symbol("type");class Blob{constructor(){this[p]="";const e=arguments[0];const r=arguments[1];const t=[];let s=0;if(e){const r=e;const o=Number(r.length);for(let e=0;e1&&arguments[1]!==undefined?arguments[1]:{},o=t.size;let n=o===undefined?0:o;var i=t.timeout;let a=i===undefined?0:i;if(e==null){e=null}else if(isURLSearchParams(e)){e=Buffer.from(e.toString())}else if(isBlob(e));else if(Buffer.isBuffer(e));else if(Object.prototype.toString.call(e)==="[object ArrayBuffer]"){e=Buffer.from(e)}else if(ArrayBuffer.isView(e)){e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)}else if(e instanceof s);else{e=Buffer.from(String(e))}this[d]={body:e,disturbed:false,error:null};this.size=n;this.timeout=a;if(e instanceof s){e.on("error",(function(e){const t=e.name==="AbortError"?e:new FetchError(`Invalid response body while trying to fetch ${r.url}: ${e.message}`,"system",e);r[d].error=t}))}}Body.prototype={get body(){return this[d].body},get bodyUsed(){return this[d].disturbed},arrayBuffer(){return consumeBody.call(this).then((function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}))},blob(){let e=this.headers&&this.headers.get("content-type")||"";return consumeBody.call(this).then((function(r){return Object.assign(new Blob([],{type:e.toLowerCase()}),{[u]:r})}))},json(){var e=this;return consumeBody.call(this).then((function(r){try{return JSON.parse(r.toString())}catch(r){return Body.Promise.reject(new FetchError(`invalid json response body at ${e.url} reason: ${r.message}`,"invalid-json"))}}))},text(){return consumeBody.call(this).then((function(e){return e.toString()}))},buffer(){return consumeBody.call(this)},textConverted(){var e=this;return consumeBody.call(this).then((function(r){return convertBody(r,e.headers)}))}};Object.defineProperties(Body.prototype,{body:{enumerable:true},bodyUsed:{enumerable:true},arrayBuffer:{enumerable:true},blob:{enumerable:true},json:{enumerable:true},text:{enumerable:true}});Body.mixIn=function(e){for(const r of Object.getOwnPropertyNames(Body.prototype)){if(!(r in e)){const t=Object.getOwnPropertyDescriptor(Body.prototype,r);Object.defineProperty(e,r,t)}}};function consumeBody(){var e=this;if(this[d].disturbed){return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`))}this[d].disturbed=true;if(this[d].error){return Body.Promise.reject(this[d].error)}let r=this.body;if(r===null){return Body.Promise.resolve(Buffer.alloc(0))}if(isBlob(r)){r=r.stream()}if(Buffer.isBuffer(r)){return Body.Promise.resolve(r)}if(!(r instanceof s)){return Body.Promise.resolve(Buffer.alloc(0))}let t=[];let o=0;let n=false;return new Body.Promise((function(s,i){let a;if(e.timeout){a=setTimeout((function(){n=true;i(new FetchError(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`,"body-timeout"))}),e.timeout)}r.on("error",(function(r){if(r.name==="AbortError"){n=true;i(r)}else{i(new FetchError(`Invalid response body while trying to fetch ${e.url}: ${r.message}`,"system",r))}}));r.on("data",(function(r){if(n||r===null){return}if(e.size&&o+r.length>e.size){n=true;i(new FetchError(`content size at ${e.url} over limit: ${e.size}`,"max-size"));return}o+=r.length;t.push(r)}));r.on("end",(function(){if(n){return}clearTimeout(a);try{s(Buffer.concat(t,o))}catch(r){i(new FetchError(`Could not create Buffer from response body for ${e.url}: ${r.message}`,"system",r))}}))}))}function convertBody(e,r){if(typeof l!=="function"){throw new Error("The package `encoding` must be installed to use the textConverted() function")}const t=r.get("content-type");let s="utf-8";let o,n;if(t){o=/charset=([^;]*)/i.exec(t)}n=e.slice(0,1024).toString();if(!o&&n){o=/0&&arguments[0]!==undefined?arguments[0]:undefined;this[T]=Object.create(null);if(e instanceof Headers){const r=e.raw();const t=Object.keys(r);for(const e of t){for(const t of r[e]){this.append(e,t)}}return}if(e==null);else if(typeof e==="object"){const r=e[Symbol.iterator];if(r!=null){if(typeof r!=="function"){throw new TypeError("Header pairs must be iterable")}const t=[];for(const r of e){if(typeof r!=="object"||typeof r[Symbol.iterator]!=="function"){throw new TypeError("Each header pair must be iterable")}t.push(Array.from(r))}for(const e of t){if(e.length!==2){throw new TypeError("Each header pair must be a name/value tuple")}this.append(e[0],e[1])}}else{for(const r of Object.keys(e)){const t=e[r];this.append(r,t)}}}else{throw new TypeError("Provided initializer must be an object")}}get(e){e=`${e}`;validateName(e);const r=find(this[T],e);if(r===undefined){return null}return this[T][r].join(", ")}forEach(e){let r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:undefined;let t=getHeaders(this);let s=0;while(s1&&arguments[1]!==undefined?arguments[1]:"key+value";const t=Object.keys(e[T]).sort();return t.map(r==="key"?function(e){return e.toLowerCase()}:r==="value"?function(r){return e[T][r].join(", ")}:function(r){return[r.toLowerCase(),e[T][r].join(", ")]})}const E=Symbol("internal");function createHeadersIterator(e,r){const t=Object.create(b);t[E]={target:e,kind:r,index:0};return t}const b=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==b){throw new TypeError("Value of `this` is not a HeadersIterator")}var e=this[E];const r=e.target,t=e.kind,s=e.index;const o=getHeaders(r,t);const n=o.length;if(s>=n){return{value:undefined,done:true}}this[E].index=s+1;return{value:o[s],done:false}}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));Object.defineProperty(b,Symbol.toStringTag,{value:"HeadersIterator",writable:false,enumerable:false,configurable:true});function exportNodeCompatibleHeaders(e){const r=Object.assign({__proto__:null},e[T]);const t=find(e[T],"Host");if(t!==undefined){r[t]=r[t][0]}return r}function createHeadersLenient(e){const r=new Headers;for(const t of Object.keys(e)){if(g.test(t)){continue}if(Array.isArray(e[t])){for(const s of e[t]){if(h.test(s)){continue}if(r[T][t]===undefined){r[T][t]=[s]}else{r[T][t].push(s)}}}else if(!h.test(e[t])){r[T][t]=[e[t]]}}return r}const w=Symbol("Response internals");const _=o.STATUS_CODES;class Response{constructor(){let e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;let r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};Body.call(this,e,r);const t=r.status||200;const s=new Headers(r.headers);if(e!=null&&!s.has("Content-Type")){const r=extractContentType(e);if(r){s.append("Content-Type",r)}}this[w]={url:r.url,status:t,statusText:r.statusText||_[t],headers:s,counter:r.counter}}get url(){return this[w].url||""}get status(){return this[w].status}get ok(){return this[w].status>=200&&this[w].status<300}get redirected(){return this[w].counter>0}get statusText(){return this[w].statusText}get headers(){return this[w].headers}clone(){return new Response(clone(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}Body.mixIn(Response.prototype);Object.defineProperties(Response.prototype,{url:{enumerable:true},status:{enumerable:true},ok:{enumerable:true},redirected:{enumerable:true},statusText:{enumerable:true},headers:{enumerable:true},clone:{enumerable:true}});Object.defineProperty(Response.prototype,Symbol.toStringTag,{value:"Response",writable:false,enumerable:false,configurable:true});const y=Symbol("Request internals");const v=n.parse;const G=n.format;const k="destroy"in s.Readable.prototype;function isRequest(e){return typeof e==="object"&&typeof e[y]==="object"}function isAbortSignal(e){const r=e&&typeof e==="object"&&Object.getPrototypeOf(e);return!!(r&&r.constructor.name==="AbortSignal")}class Request{constructor(e){let r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};let t;if(!isRequest(e)){if(e&&e.href){t=v(e.href)}else{t=v(`${e}`)}e={}}else{t=v(e.url)}let s=r.method||e.method||"GET";s=s.toUpperCase();if((r.body!=null||isRequest(e)&&e.body!==null)&&(s==="GET"||s==="HEAD")){throw new TypeError("Request with GET/HEAD method cannot have body")}let o=r.body!=null?r.body:isRequest(e)&&e.body!==null?clone(e):null;Body.call(this,o,{timeout:r.timeout||e.timeout||0,size:r.size||e.size||0});const n=new Headers(r.headers||e.headers||{});if(o!=null&&!n.has("Content-Type")){const e=extractContentType(o);if(e){n.append("Content-Type",e)}}let i=isRequest(e)?e.signal:null;if("signal"in r)i=r.signal;if(i!=null&&!isAbortSignal(i)){throw new TypeError("Expected signal to be an instanceof AbortSignal")}this[y]={method:s,redirect:r.redirect||e.redirect||"follow",headers:n,parsedURL:t,signal:i};this.follow=r.follow!==undefined?r.follow:e.follow!==undefined?e.follow:20;this.compress=r.compress!==undefined?r.compress:e.compress!==undefined?e.compress:true;this.counter=r.counter||e.counter||0;this.agent=r.agent||e.agent}get method(){return this[y].method}get url(){return G(this[y].parsedURL)}get headers(){return this[y].headers}get redirect(){return this[y].redirect}get signal(){return this[y].signal}clone(){return new Request(this)}}Body.mixIn(Request.prototype);Object.defineProperty(Request.prototype,Symbol.toStringTag,{value:"Request",writable:false,enumerable:false,configurable:true});Object.defineProperties(Request.prototype,{method:{enumerable:true},url:{enumerable:true},headers:{enumerable:true},redirect:{enumerable:true},clone:{enumerable:true},signal:{enumerable:true}});function getNodeRequestOptions(e){const r=e[y].parsedURL;const t=new Headers(e[y].headers);if(!t.has("Accept")){t.set("Accept","*/*")}if(!r.protocol||!r.hostname){throw new TypeError("Only absolute URLs are supported")}if(!/^https?:$/.test(r.protocol)){throw new TypeError("Only HTTP(S) protocols are supported")}if(e.signal&&e.body instanceof s.Readable&&!k){throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8")}let o=null;if(e.body==null&&/^(POST|PUT)$/i.test(e.method)){o="0"}if(e.body!=null){const r=getTotalBytes(e);if(typeof r==="number"){o=String(r)}}if(o){t.set("Content-Length",o)}if(!t.has("User-Agent")){t.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)")}if(e.compress&&!t.has("Accept-Encoding")){t.set("Accept-Encoding","gzip,deflate")}let n=e.agent;if(typeof n==="function"){n=n(r)}if(!t.has("Connection")&&!n){t.set("Connection","close")}return Object.assign({},r,{method:e.method,headers:exportNodeCompatibleHeaders(t),agent:n})}function AbortError(e){Error.call(this,e);this.type="aborted";this.message=e;Error.captureStackTrace(this,this.constructor)}AbortError.prototype=Object.create(Error.prototype);AbortError.prototype.constructor=AbortError;AbortError.prototype.name="AbortError";const O=s.PassThrough;const P=n.resolve;function fetch(e,r){if(!fetch.Promise){throw new Error("native promise missing, set fetch.Promise to your favorite alternative")}Body.Promise=fetch.Promise;return new fetch.Promise((function(t,n){const c=new Request(e,r);const u=getNodeRequestOptions(c);const p=(u.protocol==="https:"?i:o).request;const l=c.signal;let d=null;const m=function abort(){let e=new AbortError("The user aborted a request.");n(e);if(c.body&&c.body instanceof s.Readable){c.body.destroy(e)}if(!d||!d.body)return;d.body.emit("error",e)};if(l&&l.aborted){m();return}const g=function abortAndFinalize(){m();finalize()};const h=p(u);let T;if(l){l.addEventListener("abort",g)}function finalize(){h.abort();if(l)l.removeEventListener("abort",g);clearTimeout(T)}if(c.timeout){h.once("socket",(function(e){T=setTimeout((function(){n(new FetchError(`network timeout at: ${c.url}`,"request-timeout"));finalize()}),c.timeout)}))}h.on("error",(function(e){n(new FetchError(`request to ${c.url} failed, reason: ${e.message}`,"system",e));finalize()}));h.on("response",(function(e){clearTimeout(T);const r=createHeadersLenient(e.headers);if(fetch.isRedirect(e.statusCode)){const s=r.get("Location");const o=s===null?null:P(c.url,s);switch(c.redirect){case"error":n(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${c.url}`,"no-redirect"));finalize();return;case"manual":if(o!==null){try{r.set("Location",o)}catch(e){n(e)}}break;case"follow":if(o===null){break}if(c.counter>=c.follow){n(new FetchError(`maximum redirect reached at: ${c.url}`,"max-redirect"));finalize();return}const s={headers:new Headers(c.headers),follow:c.follow,counter:c.counter+1,agent:c.agent,compress:c.compress,method:c.method,body:c.body,signal:c.signal,timeout:c.timeout,size:c.size};if(e.statusCode!==303&&c.body&&getTotalBytes(c)===null){n(new FetchError("Cannot follow redirect with body being a readable stream","unsupported-redirect"));finalize();return}if(e.statusCode===303||(e.statusCode===301||e.statusCode===302)&&c.method==="POST"){s.method="GET";s.body=undefined;s.headers.delete("content-length")}t(fetch(new Request(o,s)));finalize();return}}e.once("end",(function(){if(l)l.removeEventListener("abort",g)}));let s=e.pipe(new O);const o={url:c.url,status:e.statusCode,statusText:e.statusMessage,headers:r,size:c.size,timeout:c.timeout,counter:c.counter};const i=r.get("Content-Encoding");if(!c.compress||c.method==="HEAD"||i===null||e.statusCode===204||e.statusCode===304){d=new Response(s,o);t(d);return}const u={flush:a.Z_SYNC_FLUSH,finishFlush:a.Z_SYNC_FLUSH};if(i=="gzip"||i=="x-gzip"){s=s.pipe(a.createGunzip(u));d=new Response(s,o);t(d);return}if(i=="deflate"||i=="x-deflate"){const r=e.pipe(new O);r.once("data",(function(e){if((e[0]&15)===8){s=s.pipe(a.createInflate())}else{s=s.pipe(a.createInflateRaw())}d=new Response(s,o);t(d)}));return}if(i=="br"&&typeof a.createBrotliDecompress==="function"){s=s.pipe(a.createBrotliDecompress());d=new Response(s,o);t(d);return}d=new Response(s,o);t(d)}));writeToStream(h,c)}))}fetch.isRedirect=function(e){return e===301||e===302||e===303||e===307||e===308};fetch.Promise=global.Promise;e.exports=r=fetch;Object.defineProperty(r,"__esModule",{value:true});r.default=r;r.Headers=Headers;r.Request=Request;r.Response=Response;r.FetchError=FetchError},223:(e,r,t)=>{var s=t(940);e.exports=s(once);e.exports.strict=s(onceStrict);once.proto=once((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return once(this)},configurable:true});Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return onceStrict(this)},configurable:true})}));function once(e){var f=function(){if(f.called)return f.value;f.called=true;return f.value=e.apply(this,arguments)};f.called=false;return f}function onceStrict(e){var f=function(){if(f.called)throw new Error(f.onceError);f.called=true;return f.value=e.apply(this,arguments)};var r=e.name||"Function wrapped with `once`";f.onceError=r+" shouldn't be called more than once";f.called=false;return f}},294:(e,r,t)=>{e.exports=t(219)},219:(e,r,t)=>{"use strict";var s=t(631);var o=t(16);var n=t(605);var i=t(211);var a=t(614);var c=t(357);var u=t(669);r.httpOverHttp=httpOverHttp;r.httpsOverHttp=httpsOverHttp;r.httpOverHttps=httpOverHttps;r.httpsOverHttps=httpsOverHttps;function httpOverHttp(e){var r=new TunnelingAgent(e);r.request=n.request;return r}function httpsOverHttp(e){var r=new TunnelingAgent(e);r.request=n.request;r.createSocket=createSecureSocket;r.defaultPort=443;return r}function httpOverHttps(e){var r=new TunnelingAgent(e);r.request=i.request;return r}function httpsOverHttps(e){var r=new TunnelingAgent(e);r.request=i.request;r.createSocket=createSecureSocket;r.defaultPort=443;return r}function TunnelingAgent(e){var r=this;r.options=e||{};r.proxyOptions=r.options.proxy||{};r.maxSockets=r.options.maxSockets||n.Agent.defaultMaxSockets;r.requests=[];r.sockets=[];r.on("free",(function onFree(e,t,s,o){var n=toOptions(t,s,o);for(var i=0,a=r.requests.length;i=this.maxSockets){o.requests.push(n);return}o.createSocket(n,(function(r){r.on("free",onFree);r.on("close",onCloseOrRemove);r.on("agentRemove",onCloseOrRemove);e.onSocket(r);function onFree(){o.emit("free",r,n)}function onCloseOrRemove(e){o.removeSocket(r);r.removeListener("free",onFree);r.removeListener("close",onCloseOrRemove);r.removeListener("agentRemove",onCloseOrRemove)}}))};TunnelingAgent.prototype.createSocket=function createSocket(e,r){var t=this;var s={};t.sockets.push(s);var o=mergeOptions({},t.proxyOptions,{method:"CONNECT",path:e.host+":"+e.port,agent:false,headers:{host:e.host+":"+e.port}});if(e.localAddress){o.localAddress=e.localAddress}if(o.proxyAuth){o.headers=o.headers||{};o.headers["Proxy-Authorization"]="Basic "+new Buffer(o.proxyAuth).toString("base64")}p("making CONNECT request");var n=t.request(o);n.useChunkedEncodingByDefault=false;n.once("response",onResponse);n.once("upgrade",onUpgrade);n.once("connect",onConnect);n.once("error",onError);n.end();function onResponse(e){e.upgrade=true}function onUpgrade(e,r,t){process.nextTick((function(){onConnect(e,r,t)}))}function onConnect(o,i,a){n.removeAllListeners();i.removeAllListeners();if(o.statusCode!==200){p("tunneling socket could not be established, statusCode=%d",o.statusCode);i.destroy();var c=new Error("tunneling socket could not be established, "+"statusCode="+o.statusCode);c.code="ECONNRESET";e.request.emit("error",c);t.removeSocket(s);return}if(a.length>0){p("got illegal response body from proxy");i.destroy();var c=new Error("got illegal response body from proxy");c.code="ECONNRESET";e.request.emit("error",c);t.removeSocket(s);return}p("tunneling connection has established");t.sockets[t.sockets.indexOf(s)]=i;return r(i)}function onError(r){n.removeAllListeners();p("tunneling socket could not be established, cause=%s\n",r.message,r.stack);var o=new Error("tunneling socket could not be established, "+"cause="+r.message);o.code="ECONNRESET";e.request.emit("error",o);t.removeSocket(s)}};TunnelingAgent.prototype.removeSocket=function removeSocket(e){var r=this.sockets.indexOf(e);if(r===-1){return}this.sockets.splice(r,1);var t=this.requests.shift();if(t){this.createSocket(t,(function(e){t.request.onSocket(e)}))}};function createSecureSocket(e,r){var t=this;TunnelingAgent.prototype.createSocket.call(t,e,(function(s){var n=e.request.getHeader("host");var i=mergeOptions({},t.options,{socket:s,servername:n?n.replace(/:.*$/,""):e.host});var a=o.connect(0,i);t.sockets[t.sockets.indexOf(s)]=a;r(a)}))}function toOptions(e,r,t){if(typeof e==="string"){return{host:e,port:r,localAddress:t}}return e}function mergeOptions(e){for(var r=1,t=arguments.length;r{"use strict";Object.defineProperty(r,"__esModule",{value:true});function getUserAgent(){if(typeof navigator==="object"&&"userAgent"in navigator){return navigator.userAgent}if(typeof process==="object"&&"version"in process){return`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`}return""}r.getUserAgent=getUserAgent},940:e=>{e.exports=wrappy;function wrappy(e,r){if(e&&r)return wrappy(e)(r);if(typeof e!=="function")throw new TypeError("need wrapper function");Object.keys(e).forEach((function(r){wrapper[r]=e[r]}));return wrapper;function wrapper(){var r=new Array(arguments.length);for(var t=0;t{module.exports=eval("require")("encoding")},357:e=>{"use strict";e.exports=require("assert")},614:e=>{"use strict";e.exports=require("events")},747:e=>{"use strict";e.exports=require("fs")},605:e=>{"use strict";e.exports=require("http")},211:e=>{"use strict";e.exports=require("https")},631:e=>{"use strict";e.exports=require("net")},87:e=>{"use strict";e.exports=require("os")},622:e=>{"use strict";e.exports=require("path")},413:e=>{"use strict";e.exports=require("stream")},16:e=>{"use strict";e.exports=require("tls")},835:e=>{"use strict";e.exports=require("url")},669:e=>{"use strict";e.exports=require("util")},761:e=>{"use strict";e.exports=require("zlib")}};var __webpack_module_cache__={};function __nccwpck_require__(e){var r=__webpack_module_cache__[e];if(r!==undefined){return r.exports}var t=__webpack_module_cache__[e]={exports:{}};var s=true;try{__webpack_modules__[e].call(t.exports,t,t.exports,__nccwpck_require__);s=false}finally{if(s)delete __webpack_module_cache__[e]}return t.exports}(()=>{__nccwpck_require__.n=e=>{var r=e&&e.__esModule?()=>e["default"]:()=>e;__nccwpck_require__.d(r,{a:r});return r}})();(()=>{__nccwpck_require__.d=(e,r)=>{for(var t in r){if(__nccwpck_require__.o(r,t)&&!__nccwpck_require__.o(e,t)){Object.defineProperty(e,t,{enumerable:true,get:r[t]})}}}})();(()=>{__nccwpck_require__.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r)})();(()=>{__nccwpck_require__.r=e=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var __webpack_exports__={};(()=>{"use strict";__nccwpck_require__.r(__webpack_exports__);var e=__nccwpck_require__(186);var r=__nccwpck_require__.n(e);var t=__nccwpck_require__(438);var s=__nccwpck_require__.n(t);const o=r().getInput("repo-token");const n=r().getInput("event");const i=r().getInput("body");const a=s().getOctokit(o);if((n==="COMMENT"||n==="REQUEST_CHANGES")&&!i){r().setFailed("Event type COMMENT & REQUEST_CHANGES require a body.")}const c=s().context.payload.pull_request;if(!c){r().setFailed("This action is meant to be ran on pull requests")}const u=`\nmutation {\n addPullRequestReview(input: {\n pullRequestId: "${c["node_id"]}",\n event: ${n},\n body: "${i}"\n }) {clientMutationId}\n}`;a.graphql(u).catch((e=>{r().error(e);r().setFailed(e.message)}))})();module.exports=__webpack_exports__})(); \ No newline at end of file + */function isObject(e){return Object.prototype.toString.call(e)==="[object Object]"}function isPlainObject(e){var r,t;if(isObject(e)===false)return false;r=e.constructor;if(r===undefined)return true;t=r.prototype;if(isObject(t)===false)return false;if(t.hasOwnProperty("isPrototypeOf")===false){return false}return true}r.isPlainObject=isPlainObject},467:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var s=_interopDefault(t(413));var o=_interopDefault(t(605));var n=_interopDefault(t(835));var i=_interopDefault(t(211));var a=_interopDefault(t(761));const c=s.Readable;const u=Symbol("buffer");const p=Symbol("type");class Blob{constructor(){this[p]="";const e=arguments[0];const r=arguments[1];const t=[];let s=0;if(e){const r=e;const o=Number(r.length);for(let e=0;e1&&arguments[1]!==undefined?arguments[1]:{},o=t.size;let n=o===undefined?0:o;var i=t.timeout;let a=i===undefined?0:i;if(e==null){e=null}else if(isURLSearchParams(e)){e=Buffer.from(e.toString())}else if(isBlob(e));else if(Buffer.isBuffer(e));else if(Object.prototype.toString.call(e)==="[object ArrayBuffer]"){e=Buffer.from(e)}else if(ArrayBuffer.isView(e)){e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)}else if(e instanceof s);else{e=Buffer.from(String(e))}this[d]={body:e,disturbed:false,error:null};this.size=n;this.timeout=a;if(e instanceof s){e.on("error",(function(e){const t=e.name==="AbortError"?e:new FetchError(`Invalid response body while trying to fetch ${r.url}: ${e.message}`,"system",e);r[d].error=t}))}}Body.prototype={get body(){return this[d].body},get bodyUsed(){return this[d].disturbed},arrayBuffer(){return consumeBody.call(this).then((function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}))},blob(){let e=this.headers&&this.headers.get("content-type")||"";return consumeBody.call(this).then((function(r){return Object.assign(new Blob([],{type:e.toLowerCase()}),{[u]:r})}))},json(){var e=this;return consumeBody.call(this).then((function(r){try{return JSON.parse(r.toString())}catch(r){return Body.Promise.reject(new FetchError(`invalid json response body at ${e.url} reason: ${r.message}`,"invalid-json"))}}))},text(){return consumeBody.call(this).then((function(e){return e.toString()}))},buffer(){return consumeBody.call(this)},textConverted(){var e=this;return consumeBody.call(this).then((function(r){return convertBody(r,e.headers)}))}};Object.defineProperties(Body.prototype,{body:{enumerable:true},bodyUsed:{enumerable:true},arrayBuffer:{enumerable:true},blob:{enumerable:true},json:{enumerable:true},text:{enumerable:true}});Body.mixIn=function(e){for(const r of Object.getOwnPropertyNames(Body.prototype)){if(!(r in e)){const t=Object.getOwnPropertyDescriptor(Body.prototype,r);Object.defineProperty(e,r,t)}}};function consumeBody(){var e=this;if(this[d].disturbed){return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`))}this[d].disturbed=true;if(this[d].error){return Body.Promise.reject(this[d].error)}let r=this.body;if(r===null){return Body.Promise.resolve(Buffer.alloc(0))}if(isBlob(r)){r=r.stream()}if(Buffer.isBuffer(r)){return Body.Promise.resolve(r)}if(!(r instanceof s)){return Body.Promise.resolve(Buffer.alloc(0))}let t=[];let o=0;let n=false;return new Body.Promise((function(s,i){let a;if(e.timeout){a=setTimeout((function(){n=true;i(new FetchError(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`,"body-timeout"))}),e.timeout)}r.on("error",(function(r){if(r.name==="AbortError"){n=true;i(r)}else{i(new FetchError(`Invalid response body while trying to fetch ${e.url}: ${r.message}`,"system",r))}}));r.on("data",(function(r){if(n||r===null){return}if(e.size&&o+r.length>e.size){n=true;i(new FetchError(`content size at ${e.url} over limit: ${e.size}`,"max-size"));return}o+=r.length;t.push(r)}));r.on("end",(function(){if(n){return}clearTimeout(a);try{s(Buffer.concat(t,o))}catch(r){i(new FetchError(`Could not create Buffer from response body for ${e.url}: ${r.message}`,"system",r))}}))}))}function convertBody(e,r){if(typeof l!=="function"){throw new Error("The package `encoding` must be installed to use the textConverted() function")}const t=r.get("content-type");let s="utf-8";let o,n;if(t){o=/charset=([^;]*)/i.exec(t)}n=e.slice(0,1024).toString();if(!o&&n){o=/0&&arguments[0]!==undefined?arguments[0]:undefined;this[T]=Object.create(null);if(e instanceof Headers){const r=e.raw();const t=Object.keys(r);for(const e of t){for(const t of r[e]){this.append(e,t)}}return}if(e==null);else if(typeof e==="object"){const r=e[Symbol.iterator];if(r!=null){if(typeof r!=="function"){throw new TypeError("Header pairs must be iterable")}const t=[];for(const r of e){if(typeof r!=="object"||typeof r[Symbol.iterator]!=="function"){throw new TypeError("Each header pair must be iterable")}t.push(Array.from(r))}for(const e of t){if(e.length!==2){throw new TypeError("Each header pair must be a name/value tuple")}this.append(e[0],e[1])}}else{for(const r of Object.keys(e)){const t=e[r];this.append(r,t)}}}else{throw new TypeError("Provided initializer must be an object")}}get(e){e=`${e}`;validateName(e);const r=find(this[T],e);if(r===undefined){return null}return this[T][r].join(", ")}forEach(e){let r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:undefined;let t=getHeaders(this);let s=0;while(s1&&arguments[1]!==undefined?arguments[1]:"key+value";const t=Object.keys(e[T]).sort();return t.map(r==="key"?function(e){return e.toLowerCase()}:r==="value"?function(r){return e[T][r].join(", ")}:function(r){return[r.toLowerCase(),e[T][r].join(", ")]})}const E=Symbol("internal");function createHeadersIterator(e,r){const t=Object.create(b);t[E]={target:e,kind:r,index:0};return t}const b=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==b){throw new TypeError("Value of `this` is not a HeadersIterator")}var e=this[E];const r=e.target,t=e.kind,s=e.index;const o=getHeaders(r,t);const n=o.length;if(s>=n){return{value:undefined,done:true}}this[E].index=s+1;return{value:o[s],done:false}}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));Object.defineProperty(b,Symbol.toStringTag,{value:"HeadersIterator",writable:false,enumerable:false,configurable:true});function exportNodeCompatibleHeaders(e){const r=Object.assign({__proto__:null},e[T]);const t=find(e[T],"Host");if(t!==undefined){r[t]=r[t][0]}return r}function createHeadersLenient(e){const r=new Headers;for(const t of Object.keys(e)){if(g.test(t)){continue}if(Array.isArray(e[t])){for(const s of e[t]){if(h.test(s)){continue}if(r[T][t]===undefined){r[T][t]=[s]}else{r[T][t].push(s)}}}else if(!h.test(e[t])){r[T][t]=[e[t]]}}return r}const w=Symbol("Response internals");const _=o.STATUS_CODES;class Response{constructor(){let e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;let r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};Body.call(this,e,r);const t=r.status||200;const s=new Headers(r.headers);if(e!=null&&!s.has("Content-Type")){const r=extractContentType(e);if(r){s.append("Content-Type",r)}}this[w]={url:r.url,status:t,statusText:r.statusText||_[t],headers:s,counter:r.counter}}get url(){return this[w].url||""}get status(){return this[w].status}get ok(){return this[w].status>=200&&this[w].status<300}get redirected(){return this[w].counter>0}get statusText(){return this[w].statusText}get headers(){return this[w].headers}clone(){return new Response(clone(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}Body.mixIn(Response.prototype);Object.defineProperties(Response.prototype,{url:{enumerable:true},status:{enumerable:true},ok:{enumerable:true},redirected:{enumerable:true},statusText:{enumerable:true},headers:{enumerable:true},clone:{enumerable:true}});Object.defineProperty(Response.prototype,Symbol.toStringTag,{value:"Response",writable:false,enumerable:false,configurable:true});const y=Symbol("Request internals");const v=n.parse;const G=n.format;const k="destroy"in s.Readable.prototype;function isRequest(e){return typeof e==="object"&&typeof e[y]==="object"}function isAbortSignal(e){const r=e&&typeof e==="object"&&Object.getPrototypeOf(e);return!!(r&&r.constructor.name==="AbortSignal")}class Request{constructor(e){let r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};let t;if(!isRequest(e)){if(e&&e.href){t=v(e.href)}else{t=v(`${e}`)}e={}}else{t=v(e.url)}let s=r.method||e.method||"GET";s=s.toUpperCase();if((r.body!=null||isRequest(e)&&e.body!==null)&&(s==="GET"||s==="HEAD")){throw new TypeError("Request with GET/HEAD method cannot have body")}let o=r.body!=null?r.body:isRequest(e)&&e.body!==null?clone(e):null;Body.call(this,o,{timeout:r.timeout||e.timeout||0,size:r.size||e.size||0});const n=new Headers(r.headers||e.headers||{});if(o!=null&&!n.has("Content-Type")){const e=extractContentType(o);if(e){n.append("Content-Type",e)}}let i=isRequest(e)?e.signal:null;if("signal"in r)i=r.signal;if(i!=null&&!isAbortSignal(i)){throw new TypeError("Expected signal to be an instanceof AbortSignal")}this[y]={method:s,redirect:r.redirect||e.redirect||"follow",headers:n,parsedURL:t,signal:i};this.follow=r.follow!==undefined?r.follow:e.follow!==undefined?e.follow:20;this.compress=r.compress!==undefined?r.compress:e.compress!==undefined?e.compress:true;this.counter=r.counter||e.counter||0;this.agent=r.agent||e.agent}get method(){return this[y].method}get url(){return G(this[y].parsedURL)}get headers(){return this[y].headers}get redirect(){return this[y].redirect}get signal(){return this[y].signal}clone(){return new Request(this)}}Body.mixIn(Request.prototype);Object.defineProperty(Request.prototype,Symbol.toStringTag,{value:"Request",writable:false,enumerable:false,configurable:true});Object.defineProperties(Request.prototype,{method:{enumerable:true},url:{enumerable:true},headers:{enumerable:true},redirect:{enumerable:true},clone:{enumerable:true},signal:{enumerable:true}});function getNodeRequestOptions(e){const r=e[y].parsedURL;const t=new Headers(e[y].headers);if(!t.has("Accept")){t.set("Accept","*/*")}if(!r.protocol||!r.hostname){throw new TypeError("Only absolute URLs are supported")}if(!/^https?:$/.test(r.protocol)){throw new TypeError("Only HTTP(S) protocols are supported")}if(e.signal&&e.body instanceof s.Readable&&!k){throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8")}let o=null;if(e.body==null&&/^(POST|PUT)$/i.test(e.method)){o="0"}if(e.body!=null){const r=getTotalBytes(e);if(typeof r==="number"){o=String(r)}}if(o){t.set("Content-Length",o)}if(!t.has("User-Agent")){t.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)")}if(e.compress&&!t.has("Accept-Encoding")){t.set("Accept-Encoding","gzip,deflate")}let n=e.agent;if(typeof n==="function"){n=n(r)}if(!t.has("Connection")&&!n){t.set("Connection","close")}return Object.assign({},r,{method:e.method,headers:exportNodeCompatibleHeaders(t),agent:n})}function AbortError(e){Error.call(this,e);this.type="aborted";this.message=e;Error.captureStackTrace(this,this.constructor)}AbortError.prototype=Object.create(Error.prototype);AbortError.prototype.constructor=AbortError;AbortError.prototype.name="AbortError";const O=s.PassThrough;const P=n.resolve;function fetch(e,r){if(!fetch.Promise){throw new Error("native promise missing, set fetch.Promise to your favorite alternative")}Body.Promise=fetch.Promise;return new fetch.Promise((function(t,n){const c=new Request(e,r);const u=getNodeRequestOptions(c);const p=(u.protocol==="https:"?i:o).request;const l=c.signal;let d=null;const m=function abort(){let e=new AbortError("The user aborted a request.");n(e);if(c.body&&c.body instanceof s.Readable){c.body.destroy(e)}if(!d||!d.body)return;d.body.emit("error",e)};if(l&&l.aborted){m();return}const g=function abortAndFinalize(){m();finalize()};const h=p(u);let T;if(l){l.addEventListener("abort",g)}function finalize(){h.abort();if(l)l.removeEventListener("abort",g);clearTimeout(T)}if(c.timeout){h.once("socket",(function(e){T=setTimeout((function(){n(new FetchError(`network timeout at: ${c.url}`,"request-timeout"));finalize()}),c.timeout)}))}h.on("error",(function(e){n(new FetchError(`request to ${c.url} failed, reason: ${e.message}`,"system",e));finalize()}));h.on("response",(function(e){clearTimeout(T);const r=createHeadersLenient(e.headers);if(fetch.isRedirect(e.statusCode)){const s=r.get("Location");const o=s===null?null:P(c.url,s);switch(c.redirect){case"error":n(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${c.url}`,"no-redirect"));finalize();return;case"manual":if(o!==null){try{r.set("Location",o)}catch(e){n(e)}}break;case"follow":if(o===null){break}if(c.counter>=c.follow){n(new FetchError(`maximum redirect reached at: ${c.url}`,"max-redirect"));finalize();return}const s={headers:new Headers(c.headers),follow:c.follow,counter:c.counter+1,agent:c.agent,compress:c.compress,method:c.method,body:c.body,signal:c.signal,timeout:c.timeout,size:c.size};if(e.statusCode!==303&&c.body&&getTotalBytes(c)===null){n(new FetchError("Cannot follow redirect with body being a readable stream","unsupported-redirect"));finalize();return}if(e.statusCode===303||(e.statusCode===301||e.statusCode===302)&&c.method==="POST"){s.method="GET";s.body=undefined;s.headers.delete("content-length")}t(fetch(new Request(o,s)));finalize();return}}e.once("end",(function(){if(l)l.removeEventListener("abort",g)}));let s=e.pipe(new O);const o={url:c.url,status:e.statusCode,statusText:e.statusMessage,headers:r,size:c.size,timeout:c.timeout,counter:c.counter};const i=r.get("Content-Encoding");if(!c.compress||c.method==="HEAD"||i===null||e.statusCode===204||e.statusCode===304){d=new Response(s,o);t(d);return}const u={flush:a.Z_SYNC_FLUSH,finishFlush:a.Z_SYNC_FLUSH};if(i=="gzip"||i=="x-gzip"){s=s.pipe(a.createGunzip(u));d=new Response(s,o);t(d);return}if(i=="deflate"||i=="x-deflate"){const r=e.pipe(new O);r.once("data",(function(e){if((e[0]&15)===8){s=s.pipe(a.createInflate())}else{s=s.pipe(a.createInflateRaw())}d=new Response(s,o);t(d)}));return}if(i=="br"&&typeof a.createBrotliDecompress==="function"){s=s.pipe(a.createBrotliDecompress());d=new Response(s,o);t(d);return}d=new Response(s,o);t(d)}));writeToStream(h,c)}))}fetch.isRedirect=function(e){return e===301||e===302||e===303||e===307||e===308};fetch.Promise=global.Promise;e.exports=r=fetch;Object.defineProperty(r,"__esModule",{value:true});r.default=r;r.Headers=Headers;r.Request=Request;r.Response=Response;r.FetchError=FetchError},223:(e,r,t)=>{var s=t(940);e.exports=s(once);e.exports.strict=s(onceStrict);once.proto=once((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return once(this)},configurable:true});Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return onceStrict(this)},configurable:true})}));function once(e){var f=function(){if(f.called)return f.value;f.called=true;return f.value=e.apply(this,arguments)};f.called=false;return f}function onceStrict(e){var f=function(){if(f.called)throw new Error(f.onceError);f.called=true;return f.value=e.apply(this,arguments)};var r=e.name||"Function wrapped with `once`";f.onceError=r+" shouldn't be called more than once";f.called=false;return f}},294:(e,r,t)=>{e.exports=t(219)},219:(e,r,t)=>{"use strict";var s=t(631);var o=t(16);var n=t(605);var i=t(211);var a=t(614);var c=t(357);var u=t(669);r.httpOverHttp=httpOverHttp;r.httpsOverHttp=httpsOverHttp;r.httpOverHttps=httpOverHttps;r.httpsOverHttps=httpsOverHttps;function httpOverHttp(e){var r=new TunnelingAgent(e);r.request=n.request;return r}function httpsOverHttp(e){var r=new TunnelingAgent(e);r.request=n.request;r.createSocket=createSecureSocket;r.defaultPort=443;return r}function httpOverHttps(e){var r=new TunnelingAgent(e);r.request=i.request;return r}function httpsOverHttps(e){var r=new TunnelingAgent(e);r.request=i.request;r.createSocket=createSecureSocket;r.defaultPort=443;return r}function TunnelingAgent(e){var r=this;r.options=e||{};r.proxyOptions=r.options.proxy||{};r.maxSockets=r.options.maxSockets||n.Agent.defaultMaxSockets;r.requests=[];r.sockets=[];r.on("free",(function onFree(e,t,s,o){var n=toOptions(t,s,o);for(var i=0,a=r.requests.length;i=this.maxSockets){o.requests.push(n);return}o.createSocket(n,(function(r){r.on("free",onFree);r.on("close",onCloseOrRemove);r.on("agentRemove",onCloseOrRemove);e.onSocket(r);function onFree(){o.emit("free",r,n)}function onCloseOrRemove(e){o.removeSocket(r);r.removeListener("free",onFree);r.removeListener("close",onCloseOrRemove);r.removeListener("agentRemove",onCloseOrRemove)}}))};TunnelingAgent.prototype.createSocket=function createSocket(e,r){var t=this;var s={};t.sockets.push(s);var o=mergeOptions({},t.proxyOptions,{method:"CONNECT",path:e.host+":"+e.port,agent:false,headers:{host:e.host+":"+e.port}});if(e.localAddress){o.localAddress=e.localAddress}if(o.proxyAuth){o.headers=o.headers||{};o.headers["Proxy-Authorization"]="Basic "+new Buffer(o.proxyAuth).toString("base64")}p("making CONNECT request");var n=t.request(o);n.useChunkedEncodingByDefault=false;n.once("response",onResponse);n.once("upgrade",onUpgrade);n.once("connect",onConnect);n.once("error",onError);n.end();function onResponse(e){e.upgrade=true}function onUpgrade(e,r,t){process.nextTick((function(){onConnect(e,r,t)}))}function onConnect(o,i,a){n.removeAllListeners();i.removeAllListeners();if(o.statusCode!==200){p("tunneling socket could not be established, statusCode=%d",o.statusCode);i.destroy();var c=new Error("tunneling socket could not be established, "+"statusCode="+o.statusCode);c.code="ECONNRESET";e.request.emit("error",c);t.removeSocket(s);return}if(a.length>0){p("got illegal response body from proxy");i.destroy();var c=new Error("got illegal response body from proxy");c.code="ECONNRESET";e.request.emit("error",c);t.removeSocket(s);return}p("tunneling connection has established");t.sockets[t.sockets.indexOf(s)]=i;return r(i)}function onError(r){n.removeAllListeners();p("tunneling socket could not be established, cause=%s\n",r.message,r.stack);var o=new Error("tunneling socket could not be established, "+"cause="+r.message);o.code="ECONNRESET";e.request.emit("error",o);t.removeSocket(s)}};TunnelingAgent.prototype.removeSocket=function removeSocket(e){var r=this.sockets.indexOf(e);if(r===-1){return}this.sockets.splice(r,1);var t=this.requests.shift();if(t){this.createSocket(t,(function(e){t.request.onSocket(e)}))}};function createSecureSocket(e,r){var t=this;TunnelingAgent.prototype.createSocket.call(t,e,(function(s){var n=e.request.getHeader("host");var i=mergeOptions({},t.options,{socket:s,servername:n?n.replace(/:.*$/,""):e.host});var a=o.connect(0,i);t.sockets[t.sockets.indexOf(s)]=a;r(a)}))}function toOptions(e,r,t){if(typeof e==="string"){return{host:e,port:r,localAddress:t}}return e}function mergeOptions(e){for(var r=1,t=arguments.length;r{"use strict";Object.defineProperty(r,"__esModule",{value:true});function getUserAgent(){if(typeof navigator==="object"&&"userAgent"in navigator){return navigator.userAgent}if(typeof process==="object"&&"version"in process){return`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`}return""}r.getUserAgent=getUserAgent},940:e=>{e.exports=wrappy;function wrappy(e,r){if(e&&r)return wrappy(e)(r);if(typeof e!=="function")throw new TypeError("need wrapper function");Object.keys(e).forEach((function(r){wrapper[r]=e[r]}));return wrapper;function wrapper(){var r=new Array(arguments.length);for(var t=0;t{module.exports=eval("require")("encoding")},357:e=>{"use strict";e.exports=require("assert")},614:e=>{"use strict";e.exports=require("events")},747:e=>{"use strict";e.exports=require("fs")},605:e=>{"use strict";e.exports=require("http")},211:e=>{"use strict";e.exports=require("https")},631:e=>{"use strict";e.exports=require("net")},87:e=>{"use strict";e.exports=require("os")},622:e=>{"use strict";e.exports=require("path")},413:e=>{"use strict";e.exports=require("stream")},16:e=>{"use strict";e.exports=require("tls")},835:e=>{"use strict";e.exports=require("url")},669:e=>{"use strict";e.exports=require("util")},761:e=>{"use strict";e.exports=require("zlib")}};var __webpack_module_cache__={};function __nccwpck_require__(e){var r=__webpack_module_cache__[e];if(r!==undefined){return r.exports}var t=__webpack_module_cache__[e]={exports:{}};var s=true;try{__webpack_modules__[e].call(t.exports,t,t.exports,__nccwpck_require__);s=false}finally{if(s)delete __webpack_module_cache__[e]}return t.exports}(()=>{__nccwpck_require__.n=e=>{var r=e&&e.__esModule?()=>e["default"]:()=>e;__nccwpck_require__.d(r,{a:r});return r}})();(()=>{__nccwpck_require__.d=(e,r)=>{for(var t in r){if(__nccwpck_require__.o(r,t)&&!__nccwpck_require__.o(e,t)){Object.defineProperty(e,t,{enumerable:true,get:r[t]})}}}})();(()=>{__nccwpck_require__.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r)})();(()=>{__nccwpck_require__.r=e=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var __webpack_exports__={};(()=>{"use strict";__nccwpck_require__.r(__webpack_exports__);var e=__nccwpck_require__(186);var r=__nccwpck_require__.n(e);var t=__nccwpck_require__(438);var s=__nccwpck_require__.n(t);const o=e.getInput("repo-token");const n=e.getInput("event");const i=e.getInput("body");const a=t.getOctokit(o);if((n==="COMMENT"||n==="REQUEST_CHANGES")&&!i){e.setFailed("Event type COMMENT & REQUEST_CHANGES require a body.")}const c=t.context.payload.pull_request;if(!c){e.setFailed("This action is meant to be ran on pull requests")}const u=`\nmutation {\n addPullRequestReview(input: {\n pullRequestId: "${c["node_id"]}",\n event: ${n},\n body: "${i}"\n }) {clientMutationId}\n}`;a.graphql(u).catch((r=>{e.error(r);e.setFailed(r.message)}))})();module.exports=__webpack_exports__})(); \ No newline at end of file diff --git a/index.ts b/index.ts index ca3b5f3..5d541df 100644 --- a/index.ts +++ b/index.ts @@ -1,5 +1,5 @@ -import core from '@actions/core'; -import github from '@actions/github'; +import * as core from '@actions/core'; +import * as github from '@actions/github'; const token = core.getInput('repo-token'); const requestEvent = core.getInput('event'); diff --git a/package.json b/package.json index 57bb137..9ba555d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "automatic-pull-request-review", - "version": "0.0.4", + "version": "0.0.5", "description": "👍 Github action to automate pull requests", "private": true, "main": "dist/index.js",