Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrurodr committed Mar 7, 2022
1 parent 956c8a0 commit a8d1aab
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { endGroup, startGroup } from '@actions/core'
import * as github from '@actions/github'
import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios'
import { formatEvent } from './format'
import { HttpsProxyAgent } from 'https-proxy-agent'
import createHttpsProxyAgent from 'https-proxy-agent'
import { getInputs, Inputs, statusOpts } from './input'
import { logDebug, logError, logInfo } from './utils'
import { fitEmbed } from './validate'
Expand Down Expand Up @@ -37,14 +37,10 @@ function wrapWebhook(webhook: string, payload: Object): Promise<void> {
const port = fullProxy ? parseInt(fullProxy.split(':')[1]) : ''
let proxy: any = host && port ? { proxy: { host, port }} : null
if(proxy) {
const agent = new HttpsProxyAgent({host, port, rejectUnauthorized: false})
const agent = createHttpsProxyAgent({host, port, rejectUnauthorized: false})
proxy = { httpAgent: agent, httpsAgent: agent}
}
const client = axios.create({...proxy, maxRedirects: 0, timeout: 0, })
client.interceptors.request.use( (config: AxiosRequestConfig) => {
logInfo(JSON.stringify(config))
return config
})
client.interceptors.response.use((axiosResponse: AxiosResponse) => {
logInfo(JSON.stringify(axiosResponse))
return axiosResponse
Expand Down

0 comments on commit a8d1aab

Please sign in to comment.