Update to the latest version of @actions/github.
This commit is contained in:
parent
55458a1ab1
commit
9ed519fa12
419 changed files with 56978 additions and 151535 deletions
22
node_modules/@octokit/request/dist-src/fetch-wrapper.js
generated
vendored
22
node_modules/@octokit/request/dist-src/fetch-wrapper.js
generated
vendored
|
|
@ -1,4 +1,4 @@
|
|||
import isPlainObject from "is-plain-object";
|
||||
import { isPlainObject } from "is-plain-object";
|
||||
import nodeFetch from "node-fetch";
|
||||
import { RequestError } from "@octokit/request-error";
|
||||
import getBuffer from "./get-buffer-response";
|
||||
|
|
@ -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) {
|
||||
|
|
@ -33,22 +33,22 @@ export default function fetchWrapper(requestOptions) {
|
|||
}
|
||||
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 {
|
||||
let responseBody = JSON.parse(error.message);
|
||||
|
|
@ -73,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,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue