Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update distribution #1208

Merged
merged 1 commit into from Aug 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion dist/index.js
Expand Up @@ -1138,13 +1138,21 @@ const plugin_paginate_rest_1 = __nccwpck_require__(4193);
const plugin_rest_endpoint_methods_1 = __nccwpck_require__(3044);
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);
// Octokit plugin to support the https_proxy environment variable
// Octokit plugin to support the https_proxy and no_proxy environment variable
function autoProxyAgent(octokit) {
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)
return;
const agent = new https_proxy_agent_1.HttpsProxyAgent(proxy);
octokit.hook.before('request', options => {
if (noProxyArray.includes(options.request.hostname)) {
return;
}
options.request.agent = agent;
});
}
Expand Down