mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-06-09 21:51:11 +00:00
new toolkit and scoped registries
This commit is contained in:
parent
a9f1343a9a
commit
feb12fe291
403 changed files with 81577 additions and 1990 deletions
22
node_modules/@octokit/rest/plugins/log/index.js
generated
vendored
Normal file
22
node_modules/@octokit/rest/plugins/log/index.js
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
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, '')
|
||||
|
||||
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
|
||||
})
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue