From 80368e06477cfeb5208106d9b919bd13b0eb0cc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20P=C4=99dzich?= Date: Thu, 6 Jul 2023 11:42:13 +0200 Subject: [PATCH] Add handling of non-multiline PRIVATE_KEY variable --- index.ts => app.ts | 0 netlify/functions/index.ts | 7 +++++-- tsconfig.json | 1 - 3 files changed, 5 insertions(+), 3 deletions(-) rename index.ts => app.ts (100%) diff --git a/index.ts b/app.ts similarity index 100% rename from index.ts rename to app.ts diff --git a/netlify/functions/index.ts b/netlify/functions/index.ts index 92198ac..3d4781d 100644 --- a/netlify/functions/index.ts +++ b/netlify/functions/index.ts @@ -2,10 +2,13 @@ import { createLambdaFunction, createProbot } from '@probot/adapter-aws-lambda-serverless'; -import { appFn } from '../..'; + +import { appFn } from '../../app'; + +const privateKey = (process.env.PRIVATE_KEY as string).replace(/\\n/gm, '\n'); const handler = createLambdaFunction(appFn, { - probot: createProbot() + probot: createProbot({ overrides: { privateKey } }) }); export { handler }; diff --git a/tsconfig.json b/tsconfig.json index 55b3234..b5f2227 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,6 @@ "target": "esnext", "module": "commonjs", "rootDir": "./", - "outDir": "./netlify/functions", "noEmit": true, "esModuleInterop": true, "forceConsistentCasingInFileNames": true,