Wave 3 (#3): tolerate zero previous tags in versionCode check

This commit is contained in:
Lukas Holzner committed 2026-10-02 18:32:14 +02:00
1 parent ed769b0c4a
commit 25d43a7702
1 file changed
+1 -1
+1 -1
View File
@@ -127,7 +127,7 @@ jobs:
# so a tag without a bump would strand users on the old build. # so a tag without a bump would strand users on the old build.
run: | run: |
CUR=$(grep -oE 'versionCode [0-9]+' android/app/build.gradle | grep -oE '[0-9]+' | head -1) 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 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) 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})" echo "versionCode: $PREV ($PREV_TAG) -> $CUR (${GITHUB_REF_NAME})"