forked from mirrors/action-gh-release
vendor node_modules for release
This commit is contained in:
parent
6ecc92f5ad
commit
83407ce885
446 changed files with 83961 additions and 2 deletions
26
node_modules/@octokit/rest/plugins/authentication-deprecated/index.js
generated
vendored
Normal file
26
node_modules/@octokit/rest/plugins/authentication-deprecated/index.js
generated
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
module.exports = authenticationPlugin
|
||||
|
||||
const { Deprecation } = require('deprecation')
|
||||
const once = require('once')
|
||||
|
||||
const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation))
|
||||
|
||||
const authenticate = require('./authenticate')
|
||||
const beforeRequest = require('./before-request')
|
||||
const requestError = require('./request-error')
|
||||
|
||||
function authenticationPlugin (octokit, options) {
|
||||
if (options.auth) {
|
||||
octokit.authenticate = () => {
|
||||
deprecateAuthenticate(octokit.log, new Deprecation('[@octokit/rest] octokit.authenticate() is deprecated and has no effect when "auth" option is set on Octokit constructor'))
|
||||
}
|
||||
return
|
||||
}
|
||||
const state = {
|
||||
octokit,
|
||||
auth: false
|
||||
}
|
||||
octokit.authenticate = authenticate.bind(null, state)
|
||||
octokit.hook.before('request', beforeRequest.bind(null, state))
|
||||
octokit.hook.error('request', requestError.bind(null, state))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue