Skip to content

Commit 95f6d12

Browse files
authored
Update pull-request.yml try-catch
1 parent a22643e commit 95f6d12

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

.github/workflows/pull-request.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ jobs:
3434
"$API_URL")
3535
3636
### extract latest nuget pkg version
37-
LATEST_VERSION=$(echo "$VERSIONS_JSON" | jq -r '.[0].name // "0.0.0"')
37+
if echo "$VERSIONS_JSON" | jq . >/dev/null 2>&1; then
38+
LATEST_VERSION=$(echo "$VERSIONS_JSON" | jq -r 'try (.[0].name) catch "0.0.0"')
39+
else
40+
LATEST_VERSION="0.0.0"
41+
fi
3842
3943
echo "Latest NuGet package version found: $LATEST_VERSION"
4044
echo "version=$LATEST_VERSION" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)