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:
PJ Quirk
2020-05-15 15:25:57 -04:00
committed by GitHub
parent c201d45ef4
commit 0649bd8119
7893 changed files with 2232817 additions and 49009 deletions

View File

@@ -0,0 +1,24 @@
import { VERSION } from "./version";
/**
* @param octokit Octokit instance
* @param options Options passed to Octokit constructor
*/
export function requestLog(octokit) {
octokit.hook.wrap("request", (request, options) => {
octokit.log.debug("request", options);
const start = Date.now();
const requestOptions = octokit.request.endpoint.parse(options);
const path = requestOptions.url.replace(options.baseUrl, "");
return request(options)
.then(response => {
octokit.log.info(`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms`);
return response;
})
.catch(error => {
octokit.log.info(`${requestOptions.method} ${path} - ${error.status} in ${Date.now() -
start}ms`);
throw error;
});
});
}
requestLog.VERSION = VERSION;

View File

@@ -0,0 +1 @@
export const VERSION = "1.0.0";