From c3fb5646d5fa39019832facd23ccc87e4c6a7c24 Mon Sep 17 00:00:00 2001 From: Ubergeek Date: Thu, 21 Mar 2019 14:49:58 +0000 Subject: [PATCH] Fixed githook for reals --- githook.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/githook.php b/githook.php index 4110b97..84d21f4 100644 --- a/githook.php +++ b/githook.php @@ -2,7 +2,7 @@ /* gitea deploy webhook */ -/* security and environment*/ +/* security */ $access_token = '1234567890'; $ansible_lastrun = '/dev/shm/ansible-hook-last-run'; $ansible_dropfile = '/dev/shm/run-ansible'; @@ -34,7 +34,7 @@ if ($remoteip !== $allowedip) //* if you need get full json input */ //fwrite($fs, 'DATA: '.print_r($data, true).PHP_EOL); -if ($data["repository"]["full_name"] == 'thunix/www') { +if ($data["repository"]["full_name"] == 'thunix/ansible') { syslog(LOG_INFO, 'Ansible Webhook recieved.'); if ( time () - filemtime ( $ansible_lastrun ) > $ratelimit ) { touch ( $ansible_dropfile ); @@ -49,7 +49,7 @@ if ($data["repository"]["full_name"] == 'thunix/www') { } elseif ($data["repository"]["full_name"] == 'thunix/www') { syslog(LOG_INFO, 'WWW Webhook recieved.'); - if ( time () - filemtime ( $www_lastrun ) > $ratelimit ) { + if ( time () - filemtime ( $lastrun ) > $ratelimit ) { touch ( $www_dropfile ); touch ( $www_lastrun ); http_response_code(200);