File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -114,11 +114,21 @@ jobs:
114114
115115 # Check if target version already exists on NuGet
116116 NUGET_EXISTS=false
117- if echo "$NUGET_VERSIONS" | jq -e ".[] | select(. == \"$TARGET_VERSION\")" > /dev/null 2>&1; then
118- echo "Version $TARGET_VERSION exists on NuGet.org (release is immutable)"
119- NUGET_EXISTS=true
117+
118+ echo "Checking if $TARGET_VERSION exists in NuGet versions..."
119+ echo "NuGet versions JSON: $NUGET_VERSIONS"
120+
121+ # Validate JSON is not empty
122+ if [ -z "$NUGET_VERSIONS" ] || [ "$NUGET_VERSIONS" = "[]" ]; then
123+ echo "No versions found on NuGet.org"
120124 else
121- echo "Version $TARGET_VERSION not on NuGet.org"
125+ # Check if version exists in the array
126+ if echo "$NUGET_VERSIONS" | jq -e --arg ver "$TARGET_VERSION" '.[] | select(. == $ver)' > /dev/null 2>&1; then
127+ echo "Version $TARGET_VERSION exists on NuGet.org (release is immutable)"
128+ NUGET_EXISTS=true
129+ else
130+ echo "Version $TARGET_VERSION not on NuGet.org"
131+ fi
122132 fi
123133
124134 echo ""
You can’t perform that action at this time.
0 commit comments