Fix deploy webhook: set HOME for git pull in shell_exec
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -40,8 +40,8 @@ if ($ref !== 'refs/heads/main') {
|
||||
die('Ignored: not main branch.');
|
||||
}
|
||||
|
||||
// Run git pull
|
||||
$output = shell_exec('cd /var/www/html && git pull 2>&1');
|
||||
// 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');
|
||||
|
||||
http_response_code(200);
|
||||
header('Content-Type: text/plain');
|
||||
|
||||
Reference in New Issue
Block a user