fix(update): fix version fetch logic
Some checks are pending
Docker Build and Publish / build (push) Waiting to run

This commit is contained in:
xboard 2025-02-09 14:24:49 +08:00
parent 7ac2e2e2ed
commit 0f80ab8d5f

View File

@ -254,6 +254,8 @@ class UpdateService
protected function getCurrentCommit(): string protected function getCurrentCommit(): string
{ {
try { try {
// Ensure git configuration is correct
Process::run(sprintf('git config --global --add safe.directory %s', base_path()));
$result = Process::run('git rev-parse HEAD'); $result = Process::run('git rev-parse HEAD');
$fullHash = trim($result->output()); $fullHash = trim($result->output());
return $fullHash ? $this->formatCommitHash($fullHash) : 'unknown'; return $fullHash ? $this->formatCommitHash($fullHash) : 'unknown';