From be8affb158ea7b2ab5433a545d3352dc86ecb936 Mon Sep 17 00:00:00 2001 From: VirtualHotBar <96966978+VirtualHotBar@users.noreply.github.com> Date: Tue, 3 Mar 2026 23:49:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E4=B8=8A=E4=B8=80=E4=B8=AA=E6=A0=87=E7=AD=BE=E7=9A=84=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BB=A5=E7=A1=AE=E4=BF=9D=E6=AD=A3=E7=A1=AE=E5=A4=84?= =?UTF-8?q?=E7=90=86=E5=BD=93=E5=89=8D=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/generate-changelog.mjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/generate-changelog.mjs b/scripts/generate-changelog.mjs index 5fc0924..96a9e39 100644 --- a/scripts/generate-changelog.mjs +++ b/scripts/generate-changelog.mjs @@ -57,7 +57,10 @@ try { console.warn(`Tag ${currentTag} not found locally. Using HEAD as end of range.`); } -const prevTag = tags.find((t) => t !== currentTag) || ''; +const currentTagIndex = tags.indexOf(currentTag); +const prevTag = tagExists + ? (currentTagIndex >= 0 ? tags[currentTagIndex + 1] || '' : '') + : tags[0] || ''; const endRef = tagExists ? currentTag : 'HEAD'; const range = prevTag ? `${prevTag}..${endRef}` : endRef;