mirror of
https://github.com/actions/stale.git
synced 2026-01-01 01:07:09 +08:00
Add support to v1 to connect to GHES (#69)
* Bumping actions/github to 2.2.0 for GHES * 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,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
6
node_modules/@octokit/request/dist-src/index.js
generated
vendored
6
node_modules/@octokit/request/dist-src/index.js
generated
vendored
@@ -1,9 +1,9 @@
|
||||
import { endpoint } from "@octokit/endpoint";
|
||||
import getUserAgent from "universal-user-agent";
|
||||
import { getUserAgent } from "universal-user-agent";
|
||||
import { VERSION } from "./version";
|
||||
import withDefaults from "./with-defaults";
|
||||
export const request = withDefaults(endpoint, {
|
||||
headers: {
|
||||
"user-agent": `octokit-request.js/${VERSION} ${getUserAgent()}`
|
||||
}
|
||||
"user-agent": `octokit-request.js/${VERSION} ${getUserAgent()}`,
|
||||
},
|
||||
});
|
||||
|
||||
0
node_modules/@octokit/request/dist-src/types.js
generated
vendored
0
node_modules/@octokit/request/dist-src/types.js
generated
vendored
2
node_modules/@octokit/request/dist-src/version.js
generated
vendored
2
node_modules/@octokit/request/dist-src/version.js
generated
vendored
@@ -1 +1 @@
|
||||
export const VERSION = "0.0.0-development";
|
||||
export const VERSION = "5.4.2";
|
||||
|
||||
4
node_modules/@octokit/request/dist-src/with-defaults.js
generated
vendored
4
node_modules/@octokit/request/dist-src/with-defaults.js
generated
vendored
@@ -11,12 +11,12 @@ export default 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),
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user