From 97da8f70793b8ed8bd5bdd7481839c5ed5b2d525 Mon Sep 17 00:00:00 2001 From: KirbyCMS Deploy Date: Wed, 25 Mar 2026 14:51:12 +0000 Subject: [PATCH] Fix deploy webhook: use putenv to set HOME before git pull Co-Authored-By: Claude Sonnet 4.6 --- deploy.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deploy.php b/deploy.php index 1cf635a0..45f66dc1 100644 --- a/deploy.php +++ b/deploy.php @@ -41,7 +41,8 @@ if ($ref !== 'refs/heads/main') { } // Run git pull (HOME must be set explicitly since PHP's shell_exec doesn't inherit it) -$output = shell_exec('HOME=/var/www cd /var/www/html && git pull 2>&1'); +putenv('HOME=/var/www'); +$output = shell_exec('git -C /var/www/html pull 2>&1'); http_response_code(200); header('Content-Type: text/plain');