Fix: the version switch reached dotnet letter by letter - #3
Merged
Conversation
The result of an if expression with a single entry comes out of PowerShell as a string, not as a one-element array - and splatting a string spreads it one character at a time. dotnet was handed "- p : V e r s i o n = 1 . 1 . 0" and MSBuild refused it, so the first release run died in the first build. The list is now declared as one and filled entry by entry. While in there: a version typed without the leading v gets one, because the tags are called v1.0, v1.1, and the download link in the README hangs on that spelling. The normalised name travels as RELEASE_TAG - deliberately not under the name it came in as, since entries in env: take precedence over anything a step writes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TLEChwrQa1sywq2ctaj3MF
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 first release run died in the first build:
$versionArgs = if ($Version) { @("-p:Version=$Version") } else { @() }looks like it produces a list, but PowerShell unrolls a single-entry array on its way out of anifexpression — so the variable held a string, and splatting a string spreads it one character at a time. The list is declared as one and filled entry by entry now.The ordinary build never hit this: without
-Versionthe branch is empty and nothing gets passed.Also in here, from watching the run:
1.1was typed into the version field, and the tags are calledv1.0,v1.1— the download link hangs on that spelling. A missingvis added now. The normalised name travels on asRELEASE_TAG, deliberately not under the name it arrived in, because entries inenv:take precedence over anything a step writes toGITHUB_ENV.Once this is in, the run for
v1.1can go again —1.1in the field would work as well now.Testing
The YAML parses; PowerShell can't be run in this environment, so the next run is the check. The failure mode was visible in the log line above, and the fix is the standard remedy for it.
Generated by Claude Code