fix(ci): use NuGet flat container API for version check#158
Conversation
Replace dotnet package search with curl to NuGet flat container API. The dotnet CLI command fails under pipefail when the package is not found or the output format changes, causing the entire workflow to abort instead of gracefully skipping the publish step. The curl approach adds a proper || fallback so any failure defaults to version 0.0.0, matching how the npm and pypi workflows handle it.
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Capture HTTP status code from the NuGet API and handle explicitly: - 200: parse published version from response - 404: first publish, default to 0.0.0 - other: fail fast to avoid accidental publish on transient errors
Description
Fix publish-nuget workflow failing when there's no new version to publish.
Type of Change
Changes Made
dotnet package searchwithcurlto NuGet flat container API (/v3-flatcontainer/envilder/index.json)|| echo "0.0.0"fallback so any failure (package not found, network error) defaults gracefullyRoot Cause
The
dotnet package search ... | jq ...pipeline had no failure fallback. With GitHub Actions' defaultset -eo pipefail, ifdotnet package searchexits non-zero (package not yet published, CLI output format change, transient error), the entire step fails — aborting the workflow instead of settingversion_changed=falseand skipping publish.Evidence
|| echo "0.0.0"fallback patternsChecklist