From c6cbca36b927fa7d2438ef79365721c301e4aec1 Mon Sep 17 00:00:00 2001 From: Niek Palm Date: Thu, 17 Jun 2021 11:58:35 +0200 Subject: [PATCH 1/2] fix: scale down runners --- .../lambdas/runners/src/scale-runners/gh-auth.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/runners/lambdas/runners/src/scale-runners/gh-auth.ts b/modules/runners/lambdas/runners/src/scale-runners/gh-auth.ts index 9f548ca3d9..67a07b7937 100644 --- a/modules/runners/lambdas/runners/src/scale-runners/gh-auth.ts +++ b/modules/runners/lambdas/runners/src/scale-runners/gh-auth.ts @@ -46,13 +46,21 @@ export async function createGithubAuth( const appId: number = parseInt(process.env.GITHUB_APP_ID as string); const clientId = process.env.GITHUB_APP_CLIENT_ID as string; - const authOptions: StrategyOptions = { + // const authOptions: StrategyOptions = { + // appId, + // privateKey, + // installationId, + // clientId, + // clientSecret, + // }; + let authOptions: StrategyOptions = { appId, privateKey, - installationId, clientId, clientSecret, }; + if (installationId) authOptions = { ...authOptions, installationId }; + console.debug(ghesApiUrl); if (ghesApiUrl) { authOptions.request = request.defaults({ From 0b773e91f71fb54b20e30b33c2e19c748fd7e24a Mon Sep 17 00:00:00 2001 From: Niek Palm Date: Thu, 17 Jun 2021 12:02:22 +0200 Subject: [PATCH 2/2] fix: scale down runners --- .../lambdas/runners/src/scale-runners/gh-auth.ts | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/modules/runners/lambdas/runners/src/scale-runners/gh-auth.ts b/modules/runners/lambdas/runners/src/scale-runners/gh-auth.ts index 67a07b7937..661a665523 100644 --- a/modules/runners/lambdas/runners/src/scale-runners/gh-auth.ts +++ b/modules/runners/lambdas/runners/src/scale-runners/gh-auth.ts @@ -46,13 +46,6 @@ export async function createGithubAuth( const appId: number = parseInt(process.env.GITHUB_APP_ID as string); const clientId = process.env.GITHUB_APP_CLIENT_ID as string; - // const authOptions: StrategyOptions = { - // appId, - // privateKey, - // installationId, - // clientId, - // clientSecret, - // }; let authOptions: StrategyOptions = { appId, privateKey, @@ -69,9 +62,4 @@ export async function createGithubAuth( } const result = (await createAppAuth(authOptions)({ type: authType })) as AppAuthentication; return result; - // if (result.type == 'oauth-app') { - // return result; - // } else { - // throw Error(`Authentication type ${authType} is not`); - // } }