From 31340eb641fd24ba865eec6df92c2b4bc08f0f2f Mon Sep 17 00:00:00 2001 From: Stanley Zhang Date: Wed, 11 Jan 2023 17:24:57 +1300 Subject: [PATCH] Add support of proxy --- package.json | 3 ++- src/main.ts | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 3e3e94a..cb21af2 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,8 @@ "dependencies": { "@actions/core": "^1.10.0", "@octokit/auth-app": "^4.0.7", - "@octokit/rest": "^19.0.5" + "@octokit/rest": "^19.0.5", + "proxy-agent": "^5.0.0" }, "devDependencies": { "@types/jest": "^27.0.1", diff --git a/src/main.ts b/src/main.ts index 986abf2..d3ace44 100644 --- a/src/main.ts +++ b/src/main.ts @@ -2,6 +2,7 @@ import {createAppAuth} from '@octokit/auth-app'; import {Octokit} from '@octokit/rest'; import {Endpoints} from '@octokit/types'; import * as core from '@actions/core'; +import ProxyAgent from 'proxy-agent'; type listInstallationsResponse = Endpoints['GET /app/installations']['response']; @@ -13,6 +14,9 @@ async function run(): Promise { const scope: string = core.getInput('scope'); const appOctokit = new Octokit({ authStrategy: createAppAuth, + request: { + agent: new ProxyAgent(), + }, auth: { appId, privateKey,