тест 6 обработчика гитлаба
This commit is contained in:
parent
2c5bef703d
commit
7b8cac26c6
@ -7,7 +7,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)
|
||||
{
|
||||
@ -16,7 +16,6 @@
|
||||
}
|
||||
|
||||
$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,10 +23,9 @@
|
||||
exit(json_last_error());
|
||||
}
|
||||
|
||||
if(strcmp($json['object_kind'], 'push') == 0)
|
||||
if($json['total_commits'] > 0)
|
||||
{
|
||||
$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));
|
||||
echo "<p>$result</p>";
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user