diff --git a/appFn.ts b/netlify/functions/validate-pr/appFn.ts similarity index 99% rename from appFn.ts rename to netlify/functions/validate-pr/appFn.ts index 3a2c822..1342ef3 100644 --- a/appFn.ts +++ b/netlify/functions/validate-pr/appFn.ts @@ -5,7 +5,7 @@ import { getPlaylistIdFromUrl } from './getPlaylistIdFromUrl'; type ReviewEvent = 'REQUEST_CHANGES' | 'COMMENT' | 'APPROVE'; -export const appFn = (app: Probot) => { +const appFn = (app: Probot) => { app.on( ['pull_request.opened', 'pull_request.synchronize'], async ({ payload, octokit }) => { @@ -218,3 +218,5 @@ export const appFn = (app: Probot) => { } ); }; + +export { appFn }; diff --git a/getPlaylistIdFromUrl.ts b/netlify/functions/validate-pr/getPlaylistIdFromUrl.ts similarity index 100% rename from getPlaylistIdFromUrl.ts rename to netlify/functions/validate-pr/getPlaylistIdFromUrl.ts diff --git a/netlify/functions/validate-pr/index.ts b/netlify/functions/validate-pr/index.ts index 7287734..907e3af 100644 --- a/netlify/functions/validate-pr/index.ts +++ b/netlify/functions/validate-pr/index.ts @@ -3,7 +3,7 @@ import { createLambdaFunction } from '@probot/adapter-aws-lambda-serverless'; -import { appFn } from '../../../appFn'; +import { appFn } from './appFn'; const privateKey = (process.env.PRIVATE_KEY as string).replace(/\\n/gm, '\n'); diff --git a/tsconfig.json b/tsconfig.json index b5f2227..efdc5a5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,5 +8,6 @@ "forceConsistentCasingInFileNames": true, "strict": true, "skipLibCheck": true - } + }, + "include": ["netlify/functions/validate-pr"] }