This repository was archived by the owner on Jul 1, 2024. It is now read-only.
File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ class IgnoredBecause {
41
41
export async function httpTrigger ( context : Context , req : HttpRequest ) {
42
42
const isDev = process . env . AZURE_FUNCTIONS_ENVIRONMENT === "Development" ;
43
43
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" ] ;
45
45
const evName = headers [ "x-github-event" ] , evAction = body . action ;
46
46
47
47
context . log ( `>>> HTTP Trigger [${
@@ -52,7 +52,7 @@ export async function httpTrigger(context: Context, req: HttpRequest) {
52
52
53
53
// For process.env.GITHUB_WEBHOOK_SECRET see
54
54
// 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" ] ! ) ) )
56
56
return reply ( context , 500 , "This webhook did not come from GitHub" ) ;
57
57
58
58
if ( evName === "check_run" && evAction === "completed" ) {
You can’t perform that action at this time.
0 commit comments