diff --git a/apps/api/src/routes/webhooks/github/handlers.ts b/apps/api/src/routes/webhooks/github/handlers.ts index 215d3ec69..26c400737 100644 --- a/apps/api/src/routes/webhooks/github/handlers.ts +++ b/apps/api/src/routes/webhooks/github/handlers.ts @@ -66,13 +66,19 @@ export async function configureGitHubApp(request, reply) { } export async function gitHubEvents(request: FastifyRequest): Promise { try { - const allowedGithubEvents = ['push', 'pull_request']; + const allowedGithubEvents = ['push', 'pull_request', 'ping', 'installation']; const allowedActions = ['opened', 'reopened', 'synchronize', 'closed']; const githubEvent = request.headers['x-github-event']?.toString().toLowerCase(); const githubSignature = request.headers['x-hub-signature-256']?.toString().toLowerCase(); if (!allowedGithubEvents.includes(githubEvent)) { throw { status: 500, message: 'Event not allowed.' } } + if (githubEvent === 'ping') { + return { pong: 'cool' } + } + if (githubEvent === 'installation') { + return { status: 'cool' } + } let projectId, branch; const body = request.body if (githubEvent === 'push') {