From adb60ad8d7f86d09d497a0e7798c8c407c2099b7 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 25 Jul 2022 20:01:11 +0000 Subject: [PATCH] hm fix --- apps/api/src/routes/webhooks/github/handlers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/api/src/routes/webhooks/github/handlers.ts b/apps/api/src/routes/webhooks/github/handlers.ts index 74d53ecef..968305a97 100644 --- a/apps/api/src/routes/webhooks/github/handlers.ts +++ b/apps/api/src/routes/webhooks/github/handlers.ts @@ -82,7 +82,7 @@ export async function gitHubEvents(request: FastifyRequest): Promi branch = body.ref.includes('/') ? body.ref.split('/')[2] : body.ref; } else if (githubEvent === 'pull_request') { projectId = body.pull_request.base.repo.id; - branch = body.pull_request.head.ref.includes('/') ? body.pull_request.head.ref.split('/')[2] : body.pull_request.head.ref; + branch = body.pull_request.base.ref.includes('/') ? body.pull_request.base.ref.split('/')[2] : body.pull_request.base.ref; } if (!projectId || !branch) { throw { status: 500, message: 'Cannot parse projectId or branch from the webhook?!' }