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

check proxy bypass before setting proxy agent #320

Merged
merged 1 commit into from
Jan 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/github/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/github/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"url": "https://github.com/actions/toolkit/issues"
},
"dependencies": {
"@actions/http-client": "^1.0.2",
"@actions/http-client": "^1.0.3",
"@octokit/graphql": "^4.3.1",
"@octokit/rest": "^16.15.0"
},
Expand Down
10 changes: 5 additions & 5 deletions packages/github/src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import Octokit from '@octokit/rest'
import * as Context from './context'
import * as http from 'http'
import {HttpClient} from '@actions/http-client'
import * as httpClient from '@actions/http-client'

// We need this in order to extend Octokit
Octokit.prototype = new Octokit()
Expand Down Expand Up @@ -122,10 +122,10 @@ export class GitHub extends Octokit {
options: Octokit.Options
): http.Agent | undefined {
if (!options.request?.agent) {
const proxyUrl = process.env['https_proxy'] || process.env['HTTPS_PROXY']
if (proxyUrl) {
const httpClient = new HttpClient()
return httpClient.getAgent('https://api.github.com')
const serverUrl = 'https://api.github.com'
if (httpClient.getProxyUrl(serverUrl)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check the bypass list before setting proxy agent

const hc = new httpClient.HttpClient()
return hc.getAgent(serverUrl)
}
}

Expand Down
6 changes: 3 additions & 3 deletions packages/tool-cache/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/tool-cache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"dependencies": {
"@actions/core": "^1.2.0",
"@actions/exec": "^1.0.0",
"@actions/http-client": "^1.0.2",
"@actions/http-client": "^1.0.3",
"@actions/io": "^1.0.1",
"semver": "^6.1.0",
"uuid": "^3.3.2"
Expand Down