Repository navigation
fix: escape commas in PackageReleaseNotes before passing to MSBuild - #17
Merged
Merged
Conversation
MSBuild splits -p: property values on commas and semicolons, so any tag message containing one aborts the pack with: MSBUILD : error MSB1006: Property is not valid. The v1.1.0 tag was the first release note with a comma in it, and every one of the nine pack invocations failed. The step then fell through to Get-ChildItem ./nupkg, which failed on the missing directory, so nothing reached NuGet. Escape %, then , and ; — MSBuild unescapes %25/%2C/%3B back to the literal characters, so the notes land in the nuspec unchanged. Verified locally: a comma reproduces MSB1006, and the escaped value round-trips intact.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
v1.1.0publish run failed. Nothing was pushed to NuGet — the failure happened at pack, before the push step — so1.1.0is still free.What happened
The workflow reads the annotated tag body and passes it through:
"-p:PackageReleaseNotes=$notes"MSBuild splits
-p:values on commas and semicolons. Thev1.1.0tag message was the first release note to contain a comma, so all nine pack invocations died with:The step then continued to
Get-ChildItem ./nupkg, which failed on the now-missing directory and surfaced as the visible error — masking the real cause a few lines above.Failed run: https://github.com/teghoz/CacheWeave/actions/runs/35486623021
Verified locally
A minimal project with a
Showtarget echoing$(PackageReleaseNotes):...(EvictionRetryWindow, ReconnectPollInterval)MSB1006,Switch: ReconnectPollInterval)...(EvictionRetryWindow%2C ReconnectPollInterval)%3B doneNOTES=[...(EvictionRetryWindow, ReconnectPollInterval); done]So commas are the trigger, newlines are fine, and percent-escaping round-trips exactly.
The fix
%is escaped first so an existing percent in a release note isn't corrupted. MSBuild unescapes on the way in, so the nuspec gets the original text.This has been latent since the pipeline was written; earlier tags happened to have short, comma-free messages.
Next
Once this is on
main, I'll move thev1.1.0tag to the merge commit and re-run the publish. The tag never produced an artifact or a GitHub Release, so moving it costs nothing.