From 269d89ea51d7af18ec0625a97b3f1ae55f39b421 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sat, 15 Feb 2025 15:36:54 +1100 Subject: [PATCH] Fix issue where latest tag wasn't obtained early enough in auto-release script --- .github/workflows/release.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f7a9319f0..bada64472 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,6 +16,12 @@ jobs: with: fetch-depth: 0 + - name: Get Latest Tag + run: | + latest_tag=$(git describe --tags $(git rev-list --tags --max-count=1) || echo "v0.0.0") + echo "Latest tag: $latest_tag" + echo "latest_tag=$latest_tag" >> $GITHUB_ENV + - name: Check for changes since last release run: | if [ -z "$(git diff --name-only ${{ env.latest_tag }})" ]; then @@ -53,9 +59,8 @@ jobs: - name: Calculate next version run: | - latest_tag=$(git describe --tags $(git rev-list --tags --max-count=1) || echo "v0.0.0") - echo "Latest tag: $latest_tag" - IFS='.' read -r major minor patch <<< "$latest_tag" + echo "Latest tag: ${{ env.latest_tag }}" + IFS='.' read -r major minor patch <<< "${{ env.latest_tag }}" new_minor=$((minor + 1)) new_tag="$major.$new_minor.0" echo "New tag: $new_tag"