Skip to content

Commit 4a3a3cc

Browse files
authored
Update pull-request.yml try-catch
1 parent 147875f commit 4a3a3cc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.github/workflows/pull-request.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ 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
42+
3843
3944
echo "Latest NuGet package version found: $LATEST_VERSION"
4045
echo "version=$LATEST_VERSION" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)