1
0
Fork 0

check proxy bypass before setting proxy agent (#320)

pull/325/head
eric sciple 2020-01-23 14:35:41 -05:00 committed by Bryan MacFarlane
parent 80e6ba7033
commit 432a78c48c
5 changed files with 13 additions and 13 deletions

View File

@ -5,9 +5,9 @@
"requires": true, "requires": true,
"dependencies": { "dependencies": {
"@actions/http-client": { "@actions/http-client": {
"version": "1.0.2", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.2.tgz", "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.3.tgz",
"integrity": "sha512-ngdGx7aXM7i9BFT+7e3RWWAEt3bX4tKrdI5w5hf0wYpHz66u5Nw6AFSFXG5wzQyUQbkgeNRnJZyK2zciGqXgrQ==", "integrity": "sha512-wFwh1U4adB/Zsk4cc9kVqaBOHoknhp/pJQk+aWTocbAZWpIl4Zx/At83WFRLXvxB+5HVTWOACM6qjULMZfQSfw==",
"requires": { "requires": {
"tunnel": "0.0.6" "tunnel": "0.0.6"
} }

View File

@ -37,7 +37,7 @@
"url": "https://github.com/actions/toolkit/issues" "url": "https://github.com/actions/toolkit/issues"
}, },
"dependencies": { "dependencies": {
"@actions/http-client": "^1.0.2", "@actions/http-client": "^1.0.3",
"@octokit/graphql": "^4.3.1", "@octokit/graphql": "^4.3.1",
"@octokit/rest": "^16.15.0" "@octokit/rest": "^16.15.0"
}, },

View File

@ -12,7 +12,7 @@ import {
import Octokit from '@octokit/rest' import Octokit from '@octokit/rest'
import * as Context from './context' import * as Context from './context'
import * as http from 'http' 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 // We need this in order to extend Octokit
Octokit.prototype = new Octokit() Octokit.prototype = new Octokit()
@ -122,10 +122,10 @@ export class GitHub extends Octokit {
options: Octokit.Options options: Octokit.Options
): http.Agent | undefined { ): http.Agent | undefined {
if (!options.request?.agent) { if (!options.request?.agent) {
const proxyUrl = process.env['https_proxy'] || process.env['HTTPS_PROXY'] const serverUrl = 'https://api.github.com'
if (proxyUrl) { if (httpClient.getProxyUrl(serverUrl)) {
const httpClient = new HttpClient() const hc = new httpClient.HttpClient()
return httpClient.getAgent('https://api.github.com') return hc.getAgent(serverUrl)
} }
} }

View File

@ -5,9 +5,9 @@
"requires": true, "requires": true,
"dependencies": { "dependencies": {
"@actions/http-client": { "@actions/http-client": {
"version": "1.0.2", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.2.tgz", "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.3.tgz",
"integrity": "sha512-ngdGx7aXM7i9BFT+7e3RWWAEt3bX4tKrdI5w5hf0wYpHz66u5Nw6AFSFXG5wzQyUQbkgeNRnJZyK2zciGqXgrQ==", "integrity": "sha512-wFwh1U4adB/Zsk4cc9kVqaBOHoknhp/pJQk+aWTocbAZWpIl4Zx/At83WFRLXvxB+5HVTWOACM6qjULMZfQSfw==",
"requires": { "requires": {
"tunnel": "0.0.6" "tunnel": "0.0.6"
} }

View File

@ -38,7 +38,7 @@
"dependencies": { "dependencies": {
"@actions/core": "^1.2.0", "@actions/core": "^1.2.0",
"@actions/exec": "^1.0.0", "@actions/exec": "^1.0.0",
"@actions/http-client": "^1.0.2", "@actions/http-client": "^1.0.3",
"@actions/io": "^1.0.1", "@actions/io": "^1.0.1",
"semver": "^6.1.0", "semver": "^6.1.0",
"uuid": "^3.3.2" "uuid": "^3.3.2"