From a3b217da0bf21fdd1f072a0bc8e31b33110a0253 Mon Sep 17 00:00:00 2001 From: Peter Evans <18365890+peter-evans@users.noreply.github.com> Date: Tue, 13 Dec 2022 13:15:44 +0900 Subject: [PATCH] fix: use base url for proxy check --- dist/index.js | 2 +- src/octokit-client.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index a6913fb..8576ed4 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1241,7 +1241,7 @@ exports.Octokit = core_1.Octokit.plugin(plugin_paginate_rest_1.paginateRest, plu // Octokit plugin to support the standard environment variables http_proxy, https_proxy and no_proxy function autoProxyAgent(octokit) { octokit.hook.before('request', options => { - const proxy = (0, proxy_from_env_1.getProxyForUrl)(options.url); + const proxy = (0, proxy_from_env_1.getProxyForUrl)(options.baseUrl); if (proxy) { options.request.agent = new https_proxy_agent_1.HttpsProxyAgent(proxy); } diff --git a/src/octokit-client.ts b/src/octokit-client.ts index 87d569a..2cf277b 100644 --- a/src/octokit-client.ts +++ b/src/octokit-client.ts @@ -15,7 +15,7 @@ export const Octokit = Core.plugin( // Octokit plugin to support the standard environment variables http_proxy, https_proxy and no_proxy function autoProxyAgent(octokit: Core) { octokit.hook.before('request', options => { - const proxy = getProxyForUrl(options.url) + const proxy = getProxyForUrl(options.baseUrl) if (proxy) { options.request.agent = new HttpsProxyAgent(proxy) }