Skip to content

fix: escape commas in PackageReleaseNotes before passing to MSBuild - #17

Merged
teghoz merged 1 commit into
mainfrom
fix/publish-release-notes-escaping
Sep 20, 2026
Merged

teghoz merged 1 commit into
mainfrom
fix/publish-release-notes-escaping

Conversation

@teghoz

@teghoz teghoz commented Sep 20, 2026

Copy link
Copy Markdown
Owner

The v1.1.0 publish run failed. Nothing was pushed to NuGet — the failure happened at pack, before the push step — so 1.1.0 is 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. The v1.1.0 tag message was the first release note to contain a comma, so all nine pack invocations died with:

MSBUILD : error MSB1006: Property is not valid.
Switch:  RedisCacheOptions

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 Show target echoing $(PackageReleaseNotes):

Input Result
...(EvictionRetryWindow, ReconnectPollInterval) MSB1006, Switch: ReconnectPollInterval)
multi-line value, no commas passes through intact — newlines are not the problem
...(EvictionRetryWindow%2C ReconnectPollInterval)%3B done NOTES=[...(EvictionRetryWindow, ReconnectPollInterval); done]

So commas are the trigger, newlines are fine, and percent-escaping round-trips exactly.

The fix

$notes = $notes.Replace('%', '%25').Replace(',', '%2C').Replace(';', '%3B')

% 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 the v1.1.0 tag to the merge commit and re-run the publish. The tag never produced an artifact or a GitHub Release, so moving it costs nothing.

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.
@teghoz teghoz self-assigned this Sep 20, 2026
@teghoz
teghoz merged commit 8ca33a0 into main Sep 20, 2026
4 checks passed
@teghoz
teghoz deleted the fix/publish-release-notes-escaping branch September 20, 2026 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant