Reintroduce AWS Lambda adapter

This commit is contained in:
2023-07-06 13:55:18 +02:00
parent 123f2b78ee
commit 629d4f11f8
5 changed files with 18 additions and 52 deletions

View File

@@ -1,22 +0,0 @@
import type { Handler, HandlerEvent, HandlerContext } from '@netlify/functions';
import { createProbot } from 'probot';
import { appFn } from '../../appFn';
const privateKey = (process.env.PRIVATE_KEY as string).replace(/\\n/gm, '\n');
const handler: Handler = async (
event: HandlerEvent,
context: HandlerContext
) => {
const probot = createProbot({ overrides: { privateKey } });
await appFn(probot);
return {
statusCode: 200,
body: 'Playlist Entry Validator by Maciej Pędzich'
};
};
export { handler };

View File

@@ -0,0 +1,14 @@
import {
createProbot,
createLambdaFunction
} from '@probot/adapter-aws-lambda-serverless';
import { appFn } from '../../../appFn';
const privateKey = (process.env.PRIVATE_KEY as string).replace(/\\n/gm, '\n');
const handler = createLambdaFunction(appFn, {
probot: createProbot({ overrides: { privateKey } })
});
export { handler };

View File

@@ -0,0 +1,4 @@
{
"name": "mackorone-playlist-pr-bot",
"version": "1.0.0"
}