Skip to content

Commit b39d044

Browse files
DJGosnellclaude
andcommitted
Fix NuGet version check for trailing .0 normalization.
NuGet strips trailing .0 from versions (e.g. 146.0.7678.0 becomes 146.0.7678). Check both the original and normalized forms. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3598758 commit b39d044

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/check-update.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,14 @@ jobs:
112112
PACKAGE="bblanchon.PDFium.Win32"
113113
URL="https://api.nuget.org/v3-flatcontainer/${PACKAGE,,}/index.json"
114114
115-
echo "Checking NuGet for $PACKAGE version $VERSION..."
115+
# NuGet normalizes versions by stripping trailing .0 (e.g. 146.0.7678.0 -> 146.0.7678)
116+
NORMALIZED_VERSION=$(echo "$VERSION" | sed 's/\.0$//')
117+
118+
echo "Checking NuGet for $PACKAGE version $VERSION (normalized: $NORMALIZED_VERSION)..."
116119
VERSIONS=$(curl -s "$URL" | jq -r '.versions[]')
117120
118-
if echo "$VERSIONS" | grep -qx "$VERSION"; then
119-
echo "$PACKAGE $VERSION found on NuGet."
121+
if echo "$VERSIONS" | grep -qx "$VERSION\|$NORMALIZED_VERSION"; then
122+
echo "$PACKAGE found on NuGet."
120123
else
121124
echo "::error::$PACKAGE $VERSION not found on NuGet. The upstream GitHub release may have been published before NuGet packages. Try again later."
122125
exit 1

0 commit comments

Comments
 (0)