ci: run the changesets version command through a shell#56
Merged
Conversation
changesets/action execs the `version` input directly instead of through a
shell, splitting it on whitespace and running the first token with the
rest as literal argv. `yarn changeset version && yarn install` therefore
sent `&&`, `yarn`, `install` to the changeset CLI itself as extra
positional arguments, which it rejected ("Too many arguments passed to
changesets — we only accept the command name as an argument"). That
aborted the version step before it could write any changes, so the
resulting "no commits between main and changeset-release/main" made the
action fail to open a Version Packages PR (seen on the #55 merge).
Wrap the compound command in `bash -c "..."` so bash — not changesets/action
— parses the `&&`.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Contributor
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
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.
Summary
.github/workflows/on_push.yml'schangesets/actionstep hadversion: yarn changeset version && yarn install.changesets/actionexecs that string directly (not through a shell) by splitting on whitespace and running the first token with the rest as literal argv — so the changeset CLI itself received&&,yarn,installas extra positional arguments and rejected them:🦋 error Too many arguments passed to changesets - we only accept the command name as an argument.mainandchangeset-release/main, and the action failed to open a "Version Packages" PR withNo commits between main and changeset-release/main.bash -c "..."so bash — notchangesets/action— parses the&&.Why
Discovered on the #55 merge (which included a changeset) — its post-merge workflow run failed exactly this way, twice (including a manual rerun), and no Version Packages PR was produced. The
&& yarn installchaining itself is intentional/correct (added to keepyarn.lockin sync with a version-bumped peerDependency range — see the existing comment) — it just needs to actually go through a shell.Test plan
versionfield's value is exactlybash -c "yarn changeset version && yarn install"(viapython3 -c "import yaml; ...")