Add handling of non-multiline PRIVATE_KEY variable

This commit is contained in:
Maciej Pędzich 2023-07-06 11:42:13 +02:00
parent e33aadee11
commit 80368e0647
3 changed files with 5 additions and 3 deletions

View File

View File

@ -2,10 +2,13 @@ import {
createLambdaFunction, createLambdaFunction,
createProbot createProbot
} from '@probot/adapter-aws-lambda-serverless'; } 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, { const handler = createLambdaFunction(appFn, {
probot: createProbot() probot: createProbot({ overrides: { privateKey } })
}); });
export { handler }; export { handler };

View File

@ -3,7 +3,6 @@
"target": "esnext", "target": "esnext",
"module": "commonjs", "module": "commonjs",
"rootDir": "./", "rootDir": "./",
"outDir": "./netlify/functions",
"noEmit": true, "noEmit": true,
"esModuleInterop": true, "esModuleInterop": true,
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,