From 25d43a770208670b03d9cd21346fb74c2c789341 Mon Sep 17 00:00:00 2001 From: Lukas Holzner Date: Fri, 2 Oct 2026 18:32:14 +0200 Subject: [PATCH] Wave 3 (#3): tolerate zero previous tags in versionCode check --- .gitea/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 0a5f5a6..f818ee7 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -127,7 +127,7 @@ jobs: # so a tag without a bump would strand users on the old build. run: | CUR=$(grep -oE 'versionCode [0-9]+' android/app/build.gradle | grep -oE '[0-9]+' | head -1) - PREV_TAG=$(git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -2 | tail -1) + PREV_TAG=$(git tag --sort=-v:refname 2>/dev/null | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -2 | tail -1 || true) if [ -n "$PREV_TAG" ]; then PREV=$(git show "$PREV_TAG:android/app/build.gradle" | grep -oE 'versionCode [0-9]+' | grep -oE '[0-9]+' | head -1) echo "versionCode: $PREV ($PREV_TAG) -> $CUR (${GITHUB_REF_NAME})"