mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-05-24 06:44:44 +00:00
.
This commit is contained in:
parent
beb1329f9f
commit
2b95e76931
7736 changed files with 1874747 additions and 51184 deletions
34
node_modules/@octokit/rest/plugins/log/index.js
generated
vendored
34
node_modules/@octokit/rest/plugins/log/index.js
generated
vendored
|
@ -1,22 +1,28 @@
|
|||
module.exports = octokitDebug
|
||||
module.exports = octokitDebug;
|
||||
|
||||
function octokitDebug (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, '')
|
||||
function octokitDebug(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
|
||||
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
|
||||
})
|
||||
})
|
||||
octokit.log.info(
|
||||
`${requestOptions.method} ${path} - ${error.status} in ${Date.now() -
|
||||
start}ms`
|
||||
);
|
||||
throw error;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue