Skip to content

Instantly share code, notes, and snippets.

View gaborszita's full-sized avatar

Gabor Szita gaborszita

View GitHub Profile
@mahdyar
mahdyar / verify-github-webhook.php
Created August 13, 2021 10:09
Verify GitHub webhook request sha256 in PHP
<?php
// It's better to be exported as an environment variable or in a .env file.
define("SECRET", "<SECRET>");
$body = file_get_contents("php://input");
// $decodedBody = json_decode(urldecode($body));
if (verifySignature($body) !== false) {
// verified