тест 1 обработчика гитлаба

This commit is contained in:
Dmitry Karpukhin 2026-01-16 11:26:56 +08:00
parent f66611ce18
commit db0f991107

View File

@ -6,7 +6,7 @@
$hash = hash_hmac('sha256', $payload, $key, false);
$signature = $_SERVER['HTTP_X_GITEA_SIGNATURE']?? '';
file_put_contents("/var/www/lk/storage/logs/temp_sign", print_r($signature, 1));
// check payload signature against header signature
if ($hash !== $signature)
{
@ -15,6 +15,7 @@
}
$json = json_decode($payload, true);
file_put_contents("/var/www/lk/storage/logs/temp_json", print_r($json, 1));
if (json_last_error() !== JSON_ERROR_NONE)
{
@ -24,5 +25,6 @@
if(strcmp($json['object_kind'], 'push') == 0)
{
shell_exec("cd /var/www/lk && git reset --hard HEAD && git pull");
$result = shell_exec("cd /var/www/lk && git reset --hard HEAD && git pull");
file_put_contents("/var/www/lk/storage/logs/temp_exec", print_r($result, 1));
}