From fefcc6ac66cabb995ee59f131e69f3b142057a3b Mon Sep 17 00:00:00 2001 From: denglihong2007 <2639367181@qq.com> Date: Sun, 2 Mar 2025 14:25:50 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E4=BC=98=E5=8C=96=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bb9f5fc..f5dcfd0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -91,18 +91,21 @@ jobs: id: release_notes shell: pwsh run: | + # 获取最新 Release 版本号 $latestTag = gh release list --limit 1 --json tagName --jq ".[0].tagName" 2>$null + echo "Latest release tag: $latestTag" if (-not $latestTag) { $latestTag = "" } $originalOutputEncoding = [Console]::OutputEncoding [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 - + try { # 初始化日志文件(UTF-8 编码) $releaseNotesPath = "release_notes.md" - + echo "Release notes path: $releaseNotesPath" + # 获取 Commit 日志 if (-not $latestTag) { Set-Content -Path $releaseNotesPath -Value "## 初始版本" -Encoding UTF8 @@ -112,6 +115,7 @@ jobs: Set-Content -Path $releaseNotesPath -Value "## 更新日志" -Encoding UTF8 $commitLogs = git log $latestTag --pretty=format:"%s" } + echo "Commit logs: $commitLogs" } finally { # 恢复原始编码设置 [Console]::OutputEncoding = $originalOutputEncoding