Skip to content

fix(ci): use NuGet flat container API for version check#158

Merged
macalbert merged 2 commits intomainfrom
fix/publish-nuget-version-check
Apr 15, 2026
Merged

fix(ci): use NuGet flat container API for version check#158
macalbert merged 2 commits intomainfrom
fix/publish-nuget-version-check

Conversation

@macalbert
Copy link
Copy Markdown
Owner

@macalbert macalbert commented Apr 15, 2026

Description

Fix publish-nuget workflow failing when there's no new version to publish.

Type of Change

  • Bug fix

Changes Made

  • Replace dotnet package search with curl to NuGet flat container API (/v3-flatcontainer/envilder/index.json)
  • Add proper || echo "0.0.0" fallback so any failure (package not found, network error) defaults gracefully

Root Cause

The dotnet package search ... | jq ... pipeline had no failure fallback. With GitHub Actions' default set -eo pipefail, if dotnet package search exits non-zero (package not yet published, CLI output format change, transient error), the entire step fails — aborting the workflow instead of setting version_changed=false and skipping publish.

Evidence

Checklist

  • Code follows project conventions
  • No breaking changes

Open with Devin

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.
Copilot AI review requested due to automatic review settings April 15, 2026 09:28
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 15, 2026

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • .github/workflows/publish-nuget.yml is excluded by none and included by none

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: aceb9a05-9249-465e-81e4-d70c09232eed

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/publish-nuget-version-check

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

This comment was marked as resolved.

Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

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
@macalbert macalbert self-assigned this Apr 15, 2026
@macalbert macalbert added the bug Something isn't working label Apr 15, 2026
@macalbert macalbert merged commit 864108a into main Apr 15, 2026
4 checks passed
@macalbert macalbert deleted the fix/publish-nuget-version-check branch April 15, 2026 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants