From f024cda9b08fb3ab39d2cca0cafe61512af38f0d Mon Sep 17 00:00:00 2001 From: Niek Palm Date: Thu, 17 Jun 2021 12:19:43 +0200 Subject: [PATCH] fix: scale down runners (#905) * fix: scale down runners * fix: scale down runners --- .../lambdas/runners/src/scale-runners/gh-auth.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 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..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,14 @@ 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 = { + let authOptions: StrategyOptions = { appId, privateKey, - installationId, clientId, clientSecret, }; + if (installationId) authOptions = { ...authOptions, installationId }; + console.debug(ghesApiUrl); if (ghesApiUrl) { authOptions.request = request.defaults({ @@ -61,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`); - // } }