From 5ca2219234dc5d8902c0a799c9af3f44a8daf1de Mon Sep 17 00:00:00 2001 From: Patrick Schaper Date: Thu, 21 May 2026 15:27:44 +0200 Subject: [PATCH] fix: derive current version from latest git tag, not VERSION file Reading current_version from the VERSION file caused the semver bump and changelog range to be wrong whenever the file was stale. Using the latest git tag ensures the release always builds on the actual last published version. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/release.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6801e89..324fd7a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -71,7 +71,13 @@ jobs: run: | set -euo pipefail - current_version="$(tr -d '[:space:]' < VERSION)" + # Use the latest git tag as the source of truth so the bump is + # always based on the actual last release, even if the VERSION file + # is stale (e.g. a back-merge PR was never merged). + current_version="$(git describe --tags --abbrev=0 2>/dev/null | tr -d '[:space:]')" + if [[ -z "${current_version}" ]]; then + current_version="$(tr -d '[:space:]' < VERSION)" + fi next_version="$(npx --yes semver@7.6.3 "${current_version}" -i "${{ inputs.bump }}")" release_branch="release/v${next_version}"