Skip to content

Commit

Permalink
check proxy bypass before setting proxy agent (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericsciple authored and bryanmacfarlane committed Jan 23, 2020
1 parent 80e6ba7 commit 432a78c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
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)) {
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

0 comments on commit 432a78c

Please sign in to comment.