From 4a3a3cc1ae00b1619fe4d50aa19ea1df3891c21d Mon Sep 17 00:00:00 2001 From: akdalin-hee <124877763+akdalin-hee@users.noreply.github.com> Date: Wed, 20 Aug 2025 15:59:32 +0100 Subject: [PATCH] Update pull-request.yml try-catch --- .github/workflows/pull-request.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index b9f64595..835e0e29 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -34,7 +34,12 @@ jobs: "$API_URL") ### extract latest nuget pkg version - LATEST_VERSION=$(echo "$VERSIONS_JSON" | jq -r '.[0].name // "0.0.0"') + if echo "$VERSIONS_JSON" | jq . >/dev/null 2>&1; then + LATEST_VERSION=$(echo "$VERSIONS_JSON" | jq -r 'try (.[0].name) catch "0.0.0"') + else + LATEST_VERSION="0.0.0" + fi + echo "Latest NuGet package version found: $LATEST_VERSION" echo "version=$LATEST_VERSION" >> $GITHUB_OUTPUT