From abe92dedff2b3b4792d2afe34251db053116947c Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 15 Mar 2022 17:35:37 +0100 Subject: [PATCH] fix: no webhook secret found? --- src/routes/webhooks/github/events.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/webhooks/github/events.ts b/src/routes/webhooks/github/events.ts index b50c19929..21eead6c2 100644 --- a/src/routes/webhooks/github/events.ts +++ b/src/routes/webhooks/github/events.ts @@ -47,7 +47,7 @@ export const post: RequestHandler = async (event) => { const applicationFound = await db.getApplicationWebhook({ projectId, branch }); if (applicationFound) { - const webhookSecret = applicationFound.gitSource.githubApp.webhookSecret; + const webhookSecret = applicationFound.gitSource.githubApp.webhookSecret || null; const hmac = crypto.createHmac('sha256', webhookSecret); const digest = Buffer.from( 'sha256=' + hmac.update(JSON.stringify(body)).digest('hex'),