Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

Commit 1d39a68

Browse files
committed
Debug webhook failure
1 parent 9e931d1 commit 1d39a68

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pr-trigger.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class IgnoredBecause {
4141
export async function httpTrigger(context: Context, req: HttpRequest) {
4242
const isDev = process.env.AZURE_FUNCTIONS_ENVIRONMENT === "Development";
4343
const secret = process.env.GITHUB_WEBHOOK_SECRET;
44-
const { headers, body } = req, githubId = headers["x-github-delivery"];
44+
const { headers, body, rawBody } = req, githubId = headers["x-github-delivery"];
4545
const evName = headers["x-github-event"], evAction = body.action;
4646

4747
context.log(`>>> HTTP Trigger [${
@@ -52,7 +52,7 @@ export async function httpTrigger(context: Context, req: HttpRequest) {
5252

5353
// For process.env.GITHUB_WEBHOOK_SECRET see
5454
// https://ms.portal.azure.com/#blade/WebsitesExtension/FunctionsIFrameBlade/id/%2Fsubscriptions%2F57bfeeed-c34a-4ffd-a06b-ccff27ac91b8%2FresourceGroups%2Fdtmergebot%2Fproviders%2FMicrosoft.Web%2Fsites%2FDTMergeBot
55-
if (!isDev && !(await verify(secret!, body, headers["x-hub-signature-256"]!)))
55+
if (!isDev && !(await verify(secret!, rawBody, headers["x-hub-signature-256"]!)))
5656
return reply(context, 500, "This webhook did not come from GitHub");
5757

5858
if (evName === "check_run" && evAction === "completed") {

0 commit comments

Comments
 (0)