Skip to content

Commit

Permalink
version
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrurodr committed Mar 7, 2022
1 parent a8d1aab commit 6fcddf1
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const core_1 = require("@actions/core");
const github = __importStar(require("@actions/github"));
const axios_1 = __importDefault(require("axios"));
const format_1 = require("./format");
const https_proxy_agent_1 = require("https-proxy-agent");
const https_proxy_agent_1 = __importDefault(require("https-proxy-agent"));
const input_1 = require("./input");
const utils_1 = require("./utils");
const validate_1 = require("./validate");
Expand Down Expand Up @@ -71,14 +71,10 @@ function wrapWebhook(webhook, payload) {
const port = fullProxy ? parseInt(fullProxy.split(':')[1]) : '';
let proxy = host && port ? { proxy: { host, port } } : null;
if (proxy) {
const agent = new https_proxy_agent_1.HttpsProxyAgent({ host, port, rejectUnauthorized: false });
const agent = https_proxy_agent_1.default({ host, port, rejectUnauthorized: false });
proxy = { httpAgent: agent, httpsAgent: agent };
}
const client = axios_1.default.create(Object.assign(Object.assign({}, proxy), { maxRedirects: 0, timeout: 0 }));
client.interceptors.request.use((config) => {
utils_1.logInfo(JSON.stringify(config));
return config;
});
client.interceptors.response.use((axiosResponse) => {
utils_1.logInfo(JSON.stringify(axiosResponse));
return axiosResponse;
Expand Down

0 comments on commit 6fcddf1

Please sign in to comment.