From 52ba192d81f7918894a60e0d4cd8c4ab255fd6ba Mon Sep 17 00:00:00 2001 From: AJ Schmidt Date: Fri, 30 Jun 2023 12:37:06 -0400 Subject: [PATCH 1/3] fix types --- index.d.ts | 4 ++-- lambda-function.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/index.d.ts b/index.d.ts index c3d04d1..1637d32 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,5 +1,5 @@ import { Probot } from "probot"; -import { APIGatewayProxyHandler } from "aws-lambda"; +import { APIGatewayProxyEvent, APIGatewayProxyResult } from "aws-lambda"; import { ApplicationFunction } from "probot/lib/types"; export * from "probot"; @@ -7,4 +7,4 @@ export * from "probot"; export function createLambdaFunction( app: ApplicationFunction, options: { probot: Probot } -): APIGatewayProxyHandler; +): (event: APIGatewayProxyEvent) => Promise; diff --git a/lambda-function.js b/lambda-function.js index 7b61b07..9ca6b09 100644 --- a/lambda-function.js +++ b/lambda-function.js @@ -3,7 +3,7 @@ module.exports = lambdaFunction; const lowercaseKeys = require("lowercase-keys"); const { template } = require("./views/probot"); -async function lambdaFunction(probot, event, context) { +async function lambdaFunction(probot, event) { if (event.httpMethod === "GET" && event.path === "/probot") { const res = { statusCode: 200, From e61d804e4b21c093a49d4a6ad1bc9f562c82d366 Mon Sep 17 00:00:00 2001 From: AJ Schmidt Date: Fri, 30 Jun 2023 12:59:45 -0400 Subject: [PATCH 2/3] re-add `context` w/ types --- index.d.ts | 11 +++++++++-- lambda-function.js | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/index.d.ts b/index.d.ts index 1637d32..2dc6ca8 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,5 +1,9 @@ import { Probot } from "probot"; -import { APIGatewayProxyEvent, APIGatewayProxyResult } from "aws-lambda"; +import { + APIGatewayProxyEvent, + APIGatewayProxyResult, + Context, +} from "aws-lambda"; import { ApplicationFunction } from "probot/lib/types"; export * from "probot"; @@ -7,4 +11,7 @@ export * from "probot"; export function createLambdaFunction( app: ApplicationFunction, options: { probot: Probot } -): (event: APIGatewayProxyEvent) => Promise; +): ( + event: APIGatewayProxyEvent, + context: Context +) => Promise; diff --git a/lambda-function.js b/lambda-function.js index 9ca6b09..7b61b07 100644 --- a/lambda-function.js +++ b/lambda-function.js @@ -3,7 +3,7 @@ module.exports = lambdaFunction; const lowercaseKeys = require("lowercase-keys"); const { template } = require("./views/probot"); -async function lambdaFunction(probot, event) { +async function lambdaFunction(probot, event, context) { if (event.httpMethod === "GET" && event.path === "/probot") { const res = { statusCode: 200, From e0201372c2d90f4226655f3de26a7e3dcccbf385 Mon Sep 17 00:00:00 2001 From: Gregor Martynus <39992+gr2m@users.noreply.github.com> Date: Wed, 5 Jul 2023 11:54:15 -0700 Subject: [PATCH 3/3] ci(test): run on pull requests --- .github/workflows/test.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eaa3ab5..2c712b2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,10 @@ name: Test - -on: [push] +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize] jobs: test_matrix: