From 340670742c41a6de65a76fb24b25959c82618793 Mon Sep 17 00:00:00 2001 From: haosicheng Date: Wed, 15 Oct 2025 09:55:11 +0800 Subject: [PATCH] =?UTF-8?q?[patch]=20=E4=BC=98=E5=8C=96=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=E5=90=88=E5=B9=B6=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/gui-version-release.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/gui-version-release.yml b/.gitea/workflows/gui-version-release.yml index 94be626..3dcc319 100644 --- a/.gitea/workflows/gui-version-release.yml +++ b/.gitea/workflows/gui-version-release.yml @@ -515,10 +515,27 @@ jobs: Write-Host ""; Write-Host "Step 5.2: Committing version changes..."; - git commit -m "[skip ci] Update version to v$VERSION" --no-verify; + + # Check if there are changes to commit + $hasUncommitted = git diff --quiet; $diffExitCode1 = $LASTEXITCODE; + $hasStagedChanges = git diff --staged --quiet; $diffExitCode2 = $LASTEXITCODE; + + if (($diffExitCode1 -ne 0) -or ($diffExitCode2 -ne 0)) { + Write-Host "Detected uncommitted changes, creating commit..."; + git commit -m "[skip ci] Update version to v$VERSION" --no-verify; + + if ($LASTEXITCODE -eq 0) { + Write-Host "OK: Commit successful"; + } else { + Write-Host "ERROR: Commit failed"; + } + } else { + Write-Host "No changes to commit (already committed in merge)"; + Write-Host "Skipping commit step"; + $LASTEXITCODE = 0; + } if ($LASTEXITCODE -eq 0) { - Write-Host "OK: Commit successful"; Write-Host ""; Write-Host "Step 5.3: Pushing to remote...";