From 9b362b3c737f798b372fb8c1619cbf7f270da471 Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Sat, 30 Aug 2025 08:52:45 +0200 Subject: [PATCH] BREAKING CHANGE: Handling of Spools with Tags from Vendors. fix: improve get_last_tag function to handle non-beta tags and fallback to newest tag --- scripts/update_changelog.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/scripts/update_changelog.py b/scripts/update_changelog.py index 5a9b732..aa48399 100644 --- a/scripts/update_changelog.py +++ b/scripts/update_changelog.py @@ -14,10 +14,27 @@ def get_version(): return version_match.group(1) if version_match else None def get_last_tag(): + """Get the last non-beta tag for changelog generation""" try: - result = subprocess.run(['git', 'describe', '--tags', '--abbrev=0'], + # Get all tags sorted by version + result = subprocess.run(['git', 'tag', '-l', '--sort=-version:refname'], capture_output=True, text=True) - return result.stdout.strip() + if result.returncode != 0: + return None + + tags = result.stdout.strip().split('\n') + + # Find the first (newest) non-beta tag + for tag in tags: + if tag and not '-beta' in tag.lower(): + print(f"Using last stable tag for changelog: {tag}") + return tag + + # Fallback: if no non-beta tags found, use the newest tag + print("No stable tags found, using newest tag") + if tags and tags[0]: + return tags[0] + return None except subprocess.CalledProcessError: return None