Skip to content

Commit bf447db

Browse files
committed
Fix bad script that does not match NuGet version correctly.
1 parent 2a13250 commit bf447db

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

.github/workflows/patchright_release.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff 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 ""

0 commit comments

Comments
 (0)