Skip to content

Commit 27f0212

Browse files
committed
Merge branch 'main' into v2
2 parents 331baa9 + 9d8c8cd commit 27f0212

File tree

4 files changed

+135
-376
lines changed

4 files changed

+135
-376
lines changed

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@
2828
},
2929
"homepage": "https://github.com/sturdy-dev/codeball-action#readme",
3030
"dependencies": {
31-
"@actions/core": "^1.8.2",
31+
"@actions/core": "^1.9.1",
3232
"@actions/github": "^5.0.3",
33-
"@octokit/action": "^3.18.1",
34-
"@octokit/core": "^3.6.0",
35-
"@octokit/plugin-rest-endpoint-methods": "^5.13.0",
36-
"node-fetch": "^3.2.4"
33+
"@octokit/core": "^4.0.5",
34+
"@octokit/plugin-paginate-rest": "^4.1.0",
35+
"@octokit/plugin-rest-endpoint-methods": "^6.3.0",
36+
"https-proxy-agent": "^5.0.1",
37+
"node-fetch": "^3.2.10"
3738
},
3839
"devDependencies": {
3940
"@types/jest": "^27.5.1",

src/lib/octokit/index.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
import {Octokit as Core} from '@octokit/core'
22
import {paginateRest} from '@octokit/plugin-paginate-rest'
33
import {legacyRestEndpointMethods} from '@octokit/plugin-rest-endpoint-methods'
4-
import ProxyAgent from 'proxy-agent'
4+
5+
const HttpsProxyAgent = require('https-proxy-agent')
56

67
const 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+
1020
export 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 ProxyAgent(),
28+
agent: proxy,
1929
...options.request
2030
}
2131
}

src/suggester/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ const suggestViaGitHub = async ({
126126
path: string
127127
start_line?: number
128128
side?: 'LEFT' | 'RIGHT'
129-
line?: number
129+
line: number
130130
start_side?: 'LEFT' | 'RIGHT'
131131
}
132132

0 commit comments

Comments
 (0)