fix(tag): bind tag-release.ps1 arguments by name, not position - #191
Merged
Merged
Conversation
Run 34236210310 died with "A positional parameter cannot be found that accepts argument '-Title'". Expanding an ARRAY into a PowerShell script binds every element by position, so '-Version' landed in $Version, '1.0.52' in $Sha, '-Sha' in $Title, and '-Title' had no position left to bind to. The parameter names were being passed as values. A hash table binds by name, which is what this needed. Inputs now arrive as environment variables rather than being interpolated into the script text, so a title containing a quote cannot break the parse either.
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.
Run
34236210310failed with:My bug. I built the arguments as an array and expanded it into the script. Array expansion binds by position, so given
tag-release.ps1's parameter order (Version,Sha,Title,NotesFile) the run actually passed:$Version-Version$Sha1.0.52$Title-Sha$NotesFilea1517e5…-Titlehad no position left → errorThe parameter names were being passed as values. A hash table binds by name, which is what this needed all along.
Also switched the inputs to environment variables instead of interpolating them into the script text, so a release title containing a quote can't break the parse.
Nothing was created by the failed run. Parameter binding failed before the script body executed, so there's no partial tag or draft release to clean up — safe to re-dispatch with the same inputs.
Worth noting what the failed run did prove: the artifact download and the bundle-matches-the-sha check both ran and passed, so
openloop-1.0.52-52.aabis present in run34164631594and still verifies againsta1517e5.🤖 Generated with Claude Code
https://claude.ai/code/session_01Miqsf1M14nY5TKiZHzyjNY
Note
Low Risk
CI-only change to argument binding for the release tagging workflow; no app runtime or auth logic affected.
Overview
Fixes the Cut the tag and release step in
.github/workflows/tag.ymlsotag-release.ps1receives parameters correctly when optional-Titleand-NotesFileare used.The workflow now builds a hashtable and splats it (
@tagArgs) instead of an array. Array splatting bound-Version,-Sha, etc. as positional values and causedA positional parameter cannot be found that accepts argument '-Title'.Workflow inputs are passed via
env(VERSION,SHA,TITLE,USE_NOTES) rather than embedding${{ inputs.* }}in the script, so release titles with quotes cannot break PowerShell parsing. Inline comments document both behaviors.Reviewed by Cursor Bugbot for commit ee96a3f. Bugbot is set up for automated code reviews on this repo. Configure here.