From: Daniel Golle Date: Mon, 19 Aug 2024 14:15:09 +0000 (+0100) Subject: ci: avoid subshell invocation on APK version check X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=0455db48ff25be0ff55593d4b14229ac47917789;p=openwrt-packages.git ci: avoid subshell invocation on APK version check Use return code instead of scraping the stdio of `apk version --check`. Signed-off-by: Daniel Golle --- diff --git a/.github/workflows/check-apk-valid-version.yml b/.github/workflows/check-apk-valid-version.yml index def88c864..bc6ce0761 100644 --- a/.github/workflows/check-apk-valid-version.yml +++ b/.github/workflows/check-apk-valid-version.yml @@ -55,7 +55,8 @@ jobs: fi PKG_VERSION=$(grep -E '^PKG_VERSION' "$ROOT/Makefile" | cut -f 2 -d '=') if [ -n "$PKG_VERSION" ]; then - if [[ -n $($GITHUB_WORKSPACE/apk version --check "$PKG_VERSION") ]]; then + $GITHUB_WORKSPACE/apk version --quiet --check "$PKG_VERSION" + if [[ "$?" -gt "0" ]]; then echo "PKG_VERSION is not compatible: $PKG_VERSION" INCOMPATIBLE_VERSION+=" $ROOT" fi