build: update distribution (#1208)
Co-authored-by: peter-evans <peter-evans@users.noreply.github.com>
This commit is contained in:
parent
8557470a68
commit
20dac2ed48
1 changed files with 9 additions and 1 deletions
10
dist/index.js
vendored
10
dist/index.js
vendored
|
@ -1138,13 +1138,21 @@ const plugin_paginate_rest_1 = __nccwpck_require__(4193);
|
||||||
const plugin_rest_endpoint_methods_1 = __nccwpck_require__(3044);
|
const plugin_rest_endpoint_methods_1 = __nccwpck_require__(3044);
|
||||||
const https_proxy_agent_1 = __nccwpck_require__(7219);
|
const https_proxy_agent_1 = __nccwpck_require__(7219);
|
||||||
exports.Octokit = core_1.Octokit.plugin(plugin_paginate_rest_1.paginateRest, plugin_rest_endpoint_methods_1.restEndpointMethods, autoProxyAgent);
|
exports.Octokit = core_1.Octokit.plugin(plugin_paginate_rest_1.paginateRest, plugin_rest_endpoint_methods_1.restEndpointMethods, autoProxyAgent);
|
||||||
// Octokit plugin to support the https_proxy environment variable
|
// Octokit plugin to support the https_proxy and no_proxy environment variable
|
||||||
function autoProxyAgent(octokit) {
|
function autoProxyAgent(octokit) {
|
||||||
const proxy = process.env.https_proxy || process.env.HTTPS_PROXY;
|
const proxy = process.env.https_proxy || process.env.HTTPS_PROXY;
|
||||||
|
const noProxy = process.env.no_proxy || process.env.NO_PROXY;
|
||||||
|
let noProxyArray = [];
|
||||||
|
if (noProxy) {
|
||||||
|
noProxyArray = noProxy.split(',');
|
||||||
|
}
|
||||||
if (!proxy)
|
if (!proxy)
|
||||||
return;
|
return;
|
||||||
const agent = new https_proxy_agent_1.HttpsProxyAgent(proxy);
|
const agent = new https_proxy_agent_1.HttpsProxyAgent(proxy);
|
||||||
octokit.hook.before('request', options => {
|
octokit.hook.before('request', options => {
|
||||||
|
if (noProxyArray.includes(options.request.hostname)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
options.request.agent = agent;
|
options.request.agent = agent;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue