mirror of
https://github.com/actions/labeler.git
synced 2025-12-17 15:46:44 +00:00
Bump actions/github to 2.2.0 to support GHES (#72)
* Bumping actions/github to 2.2.0 * Husky commit correct node modules
This commit is contained in:
42
node_modules/@octokit/request/dist-web/index.js
generated
vendored
42
node_modules/@octokit/request/dist-web/index.js
generated
vendored
@@ -1,10 +1,10 @@
|
||||
import { endpoint } from '@octokit/endpoint';
|
||||
import getUserAgent from 'universal-user-agent';
|
||||
import { getUserAgent } from 'universal-user-agent';
|
||||
import isPlainObject from 'is-plain-object';
|
||||
import nodeFetch from 'node-fetch';
|
||||
import { RequestError } from '@octokit/request-error';
|
||||
|
||||
const VERSION = "0.0.0-development";
|
||||
const VERSION = "5.4.2";
|
||||
|
||||
function getBufferResponse(response) {
|
||||
return response.arrayBuffer();
|
||||
@@ -23,9 +23,9 @@ function fetchWrapper(requestOptions) {
|
||||
method: requestOptions.method,
|
||||
body: requestOptions.body,
|
||||
headers: requestOptions.headers,
|
||||
redirect: requestOptions.redirect
|
||||
redirect: requestOptions.redirect,
|
||||
}, requestOptions.request))
|
||||
.then(response => {
|
||||
.then((response) => {
|
||||
url = response.url;
|
||||
status = response.status;
|
||||
for (const keyAndValue of response.headers) {
|
||||
@@ -34,32 +34,37 @@ function fetchWrapper(requestOptions) {
|
||||
if (status === 204 || status === 205) {
|
||||
return;
|
||||
}
|
||||
// GitHub API returns 200 for HEAD requsets
|
||||
// GitHub API returns 200 for HEAD requests
|
||||
if (requestOptions.method === "HEAD") {
|
||||
if (status < 400) {
|
||||
return;
|
||||
}
|
||||
throw new RequestError(response.statusText, status, {
|
||||
headers,
|
||||
request: requestOptions
|
||||
request: requestOptions,
|
||||
});
|
||||
}
|
||||
if (status === 304) {
|
||||
throw new RequestError("Not modified", status, {
|
||||
headers,
|
||||
request: requestOptions
|
||||
request: requestOptions,
|
||||
});
|
||||
}
|
||||
if (status >= 400) {
|
||||
return response
|
||||
.text()
|
||||
.then(message => {
|
||||
.then((message) => {
|
||||
const error = new RequestError(message, status, {
|
||||
headers,
|
||||
request: requestOptions
|
||||
request: requestOptions,
|
||||
});
|
||||
try {
|
||||
Object.assign(error, JSON.parse(error.message));
|
||||
let responseBody = JSON.parse(error.message);
|
||||
Object.assign(error, responseBody);
|
||||
let errors = responseBody.errors;
|
||||
// Assumption `errors` would always be in Array format
|
||||
error.message =
|
||||
error.message + ": " + errors.map(JSON.stringify).join(", ");
|
||||
}
|
||||
catch (e) {
|
||||
// ignore, see octokit/rest.js#684
|
||||
@@ -76,21 +81,21 @@ function fetchWrapper(requestOptions) {
|
||||
}
|
||||
return getBufferResponse(response);
|
||||
})
|
||||
.then(data => {
|
||||
.then((data) => {
|
||||
return {
|
||||
status,
|
||||
url,
|
||||
headers,
|
||||
data
|
||||
data,
|
||||
};
|
||||
})
|
||||
.catch(error => {
|
||||
.catch((error) => {
|
||||
if (error instanceof RequestError) {
|
||||
throw error;
|
||||
}
|
||||
throw new RequestError(error.message, 500, {
|
||||
headers,
|
||||
request: requestOptions
|
||||
request: requestOptions,
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -107,20 +112,21 @@ function withDefaults(oldEndpoint, newDefaults) {
|
||||
};
|
||||
Object.assign(request, {
|
||||
endpoint,
|
||||
defaults: withDefaults.bind(null, endpoint)
|
||||
defaults: withDefaults.bind(null, endpoint),
|
||||
});
|
||||
return endpointOptions.request.hook(request, endpointOptions);
|
||||
};
|
||||
return Object.assign(newApi, {
|
||||
endpoint,
|
||||
defaults: withDefaults.bind(null, endpoint)
|
||||
defaults: withDefaults.bind(null, endpoint),
|
||||
});
|
||||
}
|
||||
|
||||
const request = withDefaults(endpoint, {
|
||||
headers: {
|
||||
"user-agent": `octokit-request.js/${VERSION} ${getUserAgent()}`
|
||||
}
|
||||
"user-agent": `octokit-request.js/${VERSION} ${getUserAgent()}`,
|
||||
},
|
||||
});
|
||||
|
||||
export { request };
|
||||
//# sourceMappingURL=index.js.map
|
||||
|
||||
1
node_modules/@octokit/request/dist-web/index.js.map
generated
vendored
Normal file
1
node_modules/@octokit/request/dist-web/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user