mirror of
https://github.com/actions/setup-node.git
synced 2025-07-27 08:58:24 +02:00
.
This commit is contained in:
parent
beb1329f9f
commit
2b95e76931
7736 changed files with 1874747 additions and 51184 deletions
35
node_modules/@octokit/rest/plugins/authentication-deprecated/index.js
generated
vendored
35
node_modules/@octokit/rest/plugins/authentication-deprecated/index.js
generated
vendored
|
@ -1,26 +1,31 @@
|
|||
module.exports = authenticationPlugin
|
||||
module.exports = authenticationPlugin;
|
||||
|
||||
const { Deprecation } = require('deprecation')
|
||||
const once = require('once')
|
||||
const { Deprecation } = require("deprecation");
|
||||
const once = require("once");
|
||||
|
||||
const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation))
|
||||
const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
|
||||
|
||||
const authenticate = require('./authenticate')
|
||||
const beforeRequest = require('./before-request')
|
||||
const requestError = require('./request-error')
|
||||
const authenticate = require("./authenticate");
|
||||
const beforeRequest = require("./before-request");
|
||||
const requestError = require("./request-error");
|
||||
|
||||
function authenticationPlugin (octokit, options) {
|
||||
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
|
||||
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))
|
||||
};
|
||||
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