[patch] 增强Git提交调试日志
This commit is contained in:
@@ -141,16 +141,36 @@ jobs:
|
||||
git config user.name "Gitea Actions Bot"
|
||||
git config user.email "bot@gitea.local"
|
||||
|
||||
# 检查文件状态
|
||||
Write-Host "=== Git Status Before Add ==="
|
||||
git status
|
||||
|
||||
Write-Host "`n=== Checking file changes ==="
|
||||
Write-Host "config.py changes:"
|
||||
git diff config.py | Select-Object -First 10
|
||||
Write-Host "version_history.json changes:"
|
||||
git diff version_history.json | Select-Object -First 10
|
||||
|
||||
# 添加修改的文件
|
||||
Write-Host "`n=== Adding files ==="
|
||||
git add config.py
|
||||
Write-Host "Added config.py"
|
||||
git add version_history.json
|
||||
Write-Host "Added version_history.json"
|
||||
|
||||
# 检查暂存区
|
||||
Write-Host "`n=== Git Status After Add ==="
|
||||
git status
|
||||
|
||||
Write-Host "`n=== Staged changes ==="
|
||||
git diff --staged --stat
|
||||
|
||||
# 检查是否有变更
|
||||
$hasChanges = git diff --staged --quiet
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
# 动态获取当前分支名(兼容 master 和 develop)
|
||||
$BRANCH = "${{ github.ref_name }}"
|
||||
Write-Host "Committing to branch: $BRANCH"
|
||||
Write-Host "`nCommitting to branch: $BRANCH"
|
||||
|
||||
git commit -m "[skip ci] Update version to v$VERSION"
|
||||
git push origin $BRANCH
|
||||
|
||||
Reference in New Issue
Block a user