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 <daniel@makrotopia.org>
This commit is contained in:
Daniel Golle authored and Rosen Penev committed 2024-09-02 11:02:09 -07:00
1 parent af2e481894
commit 0455db48ff
1 file changed
+2 -1
@@ -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