mirror of
https://github.com/actions/labeler.git
synced 2025-12-19 00:26:47 +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:
29
node_modules/@octokit/request/dist-src/fetch-wrapper.js
generated
vendored
29
node_modules/@octokit/request/dist-src/fetch-wrapper.js
generated
vendored
@@ -15,9 +15,9 @@ export default 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) {
|
||||
@@ -26,32 +26,37 @@ export default 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
|
||||
@@ -68,21 +73,21 @@ export default function fetchWrapper(requestOptions) {
|
||||
}
|
||||
return getBuffer(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,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user