From 1c40546f3f0b16e91328936c3eea71612fc78364 Mon Sep 17 00:00:00 2001 From: thibaud-lclr Date: Tue, 14 Apr 2026 10:28:15 +0200 Subject: [PATCH] fix(ci): build changelog from last stable release tag --- .gitea/workflows/release.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index e67325a..51d46b6 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -26,13 +26,19 @@ jobs: set -euo pipefail current_tag="${GITHUB_REF_NAME}" - previous_tag="" + previous_stable_tag="" - if previous_tag="$(git describe --tags --abbrev=0 "${current_tag}^" 2>/dev/null)"; then - range="${previous_tag}..${current_tag}" + if previous_stable_tag="$( + git describe --tags --abbrev=0 \ + --exclude '*-rc*' \ + --exclude '*-beta*' \ + --exclude '*-alpha*' \ + "${current_tag}^" 2>/dev/null + )"; then + range="${previous_stable_tag}..${current_tag}" { printf '## Changelog\n\n' - printf 'Changes since `%s`.\n\n' "${previous_tag}" + printf 'Changes since `%s`.\n\n' "${previous_stable_tag}" git log --reverse --pretty=format:'- %h %s' "${range}" printf '\n' } >CHANGELOG.md