From ed769b0c4abcff6314713e97158700d8305793b5 Mon Sep 17 00:00:00 2001 From: Lukas Holzner Date: Fri, 2 Oct 2026 18:19:25 +0200 Subject: [PATCH] Wave 3 (#3): POSIX grep in versionCode check (no PCRE on runner) --- .gitea/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 2d86d99..0a5f5a6 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -126,10 +126,10 @@ jobs: # Android/Obtainium refuse to install over an equal-or-lower versionCode, # so a tag without a bump would strand users on the old build. run: | - CUR=$(grep -oP 'versionCode \K[0-9]+' android/app/build.gradle | 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) if [ -n "$PREV_TAG" ]; then - PREV=$(git show "$PREV_TAG:android/app/build.gradle" | grep -oP 'versionCode \K[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})" [ "$CUR" -gt "$PREV" ] || { echo "::error::Bump versionCode in android/app/build.gradle above $PREV before tagging"; exit 1; } else