Skip to content

Commit 78d2ae6

Browse files
committed
fix action
1 parent a2ae3af commit 78d2ae6

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.github/workflows/nuget.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,15 @@ jobs:
2828
id: get_latest_version
2929
run: |
3030
echo "Debugging curl output for NuGet versions:"
31-
curl_output=$(curl -s "https://api.nuget.org/v3-flatcontainer/SimpleDataGrid/index.json")
32-
echo "$curl_output"
33-
LATEST_VERSION=$(echo "$curl_output" | jq -r '.versions[0]')
31+
HTTP_CODE=$(curl -s -o curl_output.txt -w "%{http_code}" "https://api.nuget.org/v3-flatcontainer/SimpleDataGrid/index.json")
32+
echo "HTTP Status Code: $HTTP_CODE"
33+
cat curl_output.txt
34+
if [ "$HTTP_CODE" -eq 200 ]; then
35+
LATEST_VERSION=$(cat curl_output.txt | jq -r '.versions[0]')
36+
else
37+
echo "Curl failed or returned non-200 status. Assuming no previous version."
38+
LATEST_VERSION=""
39+
fi
3440
echo "LATEST_VERSION=$LATEST_VERSION" >> $GITHUB_ENV
3541
3642
- name: Compare versions

0 commit comments

Comments
 (0)