Reintroduce AWS Lambda adapter

This commit is contained in:
Maciej Pędzich 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"
}

29
package-lock.json generated
View File

@ -9,7 +9,6 @@
"version": "1.0.0", "version": "1.0.0",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@netlify/functions": "github:netlify/functions",
"@probot/adapter-aws-lambda-serverless": "^3.0.3", "@probot/adapter-aws-lambda-serverless": "^3.0.3",
"metadata-scraper": "^0.2.60", "metadata-scraper": "^0.2.60",
"probot": "^12.2.8" "probot": "^12.2.8"
@ -65,17 +64,6 @@
"@jridgewell/sourcemap-codec": "^1.4.10" "@jridgewell/sourcemap-codec": "^1.4.10"
} }
}, },
"node_modules/@netlify/functions": {
"version": "1.6.0",
"resolved": "git+ssh://git@github.com/netlify/functions.git#3e1d890892fb6f1975ffaf92a78de68253432602",
"license": "MIT",
"dependencies": {
"is-promise": "^4.0.0"
},
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/@octokit/auth-app": { "node_modules/@octokit/auth-app": {
"version": "4.0.5", "version": "4.0.5",
"resolved": "https://registry.npmjs.org/@octokit/auth-app/-/auth-app-4.0.5.tgz", "resolved": "https://registry.npmjs.org/@octokit/auth-app/-/auth-app-4.0.5.tgz",
@ -2298,11 +2286,6 @@
"node": ">=0.10.0" "node": ">=0.10.0"
} }
}, },
"node_modules/is-promise": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz",
"integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ=="
},
"node_modules/jmespath": { "node_modules/jmespath": {
"version": "0.15.0", "version": "0.15.0",
"resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.15.0.tgz", "resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.15.0.tgz",
@ -3845,13 +3828,6 @@
"@jridgewell/sourcemap-codec": "^1.4.10" "@jridgewell/sourcemap-codec": "^1.4.10"
} }
}, },
"@netlify/functions": {
"version": "git+ssh://git@github.com/netlify/functions.git#3e1d890892fb6f1975ffaf92a78de68253432602",
"from": "@netlify/functions@github:netlify/functions",
"requires": {
"is-promise": "^4.0.0"
}
},
"@octokit/auth-app": { "@octokit/auth-app": {
"version": "4.0.5", "version": "4.0.5",
"resolved": "https://registry.npmjs.org/@octokit/auth-app/-/auth-app-4.0.5.tgz", "resolved": "https://registry.npmjs.org/@octokit/auth-app/-/auth-app-4.0.5.tgz",
@ -5698,11 +5674,6 @@
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
"integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==" "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q=="
}, },
"is-promise": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz",
"integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ=="
},
"jmespath": { "jmespath": {
"version": "0.15.0", "version": "0.15.0",
"resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.15.0.tgz", "resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.15.0.tgz",

View File

@ -17,7 +17,6 @@
}, },
"homepage": "https://github.com/maciejpedzich/mackorone-playlist-pr-bot#readme", "homepage": "https://github.com/maciejpedzich/mackorone-playlist-pr-bot#readme",
"dependencies": { "dependencies": {
"@netlify/functions": "github:netlify/functions",
"@probot/adapter-aws-lambda-serverless": "^3.0.3", "@probot/adapter-aws-lambda-serverless": "^3.0.3",
"metadata-scraper": "^0.2.60", "metadata-scraper": "^0.2.60",
"probot": "^12.2.8" "probot": "^12.2.8"