Skip to content

Commit 94078a1

Browse files
committed
Only use proxy for OpenAI
Signed-off-by: adshao <tjusgj@gmail.com>
1 parent 5c7e561 commit 94078a1

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

dist/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39193,6 +39193,7 @@ const httpsProxyAgent = __nccwpck_require__(81908);
3919339193
function configWithProxy(config) {
3919439194
var c = config || {};
3919539195
if (process.env.HTTPS_PROXY) {
39196+
core.debug(`use proxy: ${process.env.HTTPS_PROXY}`);
3919639197
c.proxy = false;
3919739198
c.httpsAgent = new httpsProxyAgent(process.env.HTTPS_PROXY);
3919839199
return c;
@@ -39236,12 +39237,13 @@ async function run() {
3923639237
var content = comment.body;
3923739238

3923839239
const url = `${githubBaseURL}/repos/${repoOwner}/${repoName}/pulls/${prNumber}`;
39239-
var response = await axios.get(url, configWithProxy({
39240+
core.debug(`diff url: ${url}`);
39241+
var response = await axios.get(url, {
3924039242
headers: {
3924139243
Authorization: `Bearer ${githubToken}`,
3924239244
Accept: 'application/vnd.github.diff'
3924339245
}
39244-
}));
39246+
});
3924539247
const code = response.data;
3924639248
const files = parsePullRequestDiff(code);
3924739249
core.debug(`diff files: ${files}`);

index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const httpsProxyAgent = require('https-proxy-agent');
77
function configWithProxy(config) {
88
var c = config || {};
99
if (process.env.HTTPS_PROXY) {
10+
core.debug(`use proxy: ${process.env.HTTPS_PROXY}`);
1011
c.proxy = false;
1112
c.httpsAgent = new httpsProxyAgent(process.env.HTTPS_PROXY);
1213
return c;
@@ -50,12 +51,13 @@ async function run() {
5051
var content = comment.body;
5152

5253
const url = `${githubBaseURL}/repos/${repoOwner}/${repoName}/pulls/${prNumber}`;
53-
var response = await axios.get(url, configWithProxy({
54+
core.debug(`diff url: ${url}`);
55+
var response = await axios.get(url, {
5456
headers: {
5557
Authorization: `Bearer ${githubToken}`,
5658
Accept: 'application/vnd.github.diff'
5759
}
58-
}));
60+
});
5961
const code = response.data;
6062
const files = parsePullRequestDiff(code);
6163
core.debug(`diff files: ${files}`);

0 commit comments

Comments
 (0)