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'),