File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 11import { Octokit as Core } from '@octokit/core'
22import { paginateRest } from '@octokit/plugin-paginate-rest'
33import { legacyRestEndpointMethods } from '@octokit/plugin-rest-endpoint-methods'
4- const HttpsProxyAgent = require ( "https-proxy-agent" )
4+
5+ const HttpsProxyAgent = require ( 'https-proxy-agent' )
56
67const DEFAULTS = {
78 baseUrl : getApiBaseUrl ( )
89}
910
11+ const httpProxy = process . env [ 'HTTP_PROXY' ] || process . env [ 'http_proxy' ]
12+ const httpsProxy = process . env [ 'HTTPS_PROXY' ] || process . env [ 'https_proxy' ]
13+
14+ const proxy = httpProxy
15+ ? new HttpsProxyAgent ( httpProxy )
16+ : httpsProxy
17+ ? new HttpsProxyAgent ( httpProxy )
18+ : undefined
19+
1020export const Octokit = Core . plugin (
1121 paginateRest ,
1222 legacyRestEndpointMethods
@@ -15,7 +25,7 @@ export const Octokit = Core.plugin(
1525 ...DEFAULTS ,
1626 ...options ,
1727 request : {
18- agent : new HttpsProxyAgent ( ) ,
28+ agent : proxy ,
1929 ...options . request
2030 }
2131 }
You can’t perform that action at this time.
0 commit comments