fix: remove unsupported cwd parameter from changesets action#8128
Conversation
The changesets/action v1 does not support the 'cwd' parameter, which was causing the workflow to fail with 'There is no .changeset directory in this project' error. Changed to use 'cd ui &&' prefix in the publish and version commands to run from the correct directory where the .changeset folder exists. Signed-off-by: Alex Hancock <alexhancock@block.xyz>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c1b22c4850
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| publish: cd ui && pnpm run release | ||
| version: cd ui && pnpm run version |
There was a problem hiding this comment.
Restore changesets cwd instead of shelling with cd
In the Create Release Pull Request or Publish to npm step (main branch, non-dry-run), changesets/action does not run publish/version as a shell command; it tokenizes the string (script.split(/\s+/)) and executes the first token directly. With publish: cd ui && pnpm run release (and same for version), the action will attempt to exec cd and fail with ENOENT, and removing cwd: ui also means internal changeset state is resolved from repo root rather than ui/.changeset. This will break actual release runs once the step is exercised.
Useful? React with 👍 / 👎.
v1.0.0 does not declare cwd as an input so it is silently ignored, causing the 'no .changeset directory' error. v1.4.0+ added proper cwd support. Upgrade to v1.7.0 and restore the original clean publish/version scripts with cwd: ui instead of the broken 'cd ui &&' prefix approach, which fails because changesets/action splits the script on whitespace and execs the first token directly rather than via a shell. Signed-off-by: Douwe Osinga <douwe@squareup.com>
|
My agent had a different take. Let me know what you think |
…ose#8128) Signed-off-by: Alex Hancock <alexhancock@block.xyz> Signed-off-by: Douwe Osinga <douwe@squareup.com> Co-authored-by: Douwe Osinga <douwe@squareup.com> Signed-off-by: Cameron Yick <cameron.yick@datadoghq.com>
…ose#8128) Signed-off-by: Alex Hancock <alexhancock@block.xyz> Signed-off-by: Douwe Osinga <douwe@squareup.com> Co-authored-by: Douwe Osinga <douwe@squareup.com> Signed-off-by: Cameron Yick <cameron.yick@datadoghq.com>
Problem
The npm publish workflow was failing with the error:
This was caused by the
changesets/action@v1not supporting thecwdparameter that was being used in the workflow.Solution
Removed the unsupported
cwd: uiparameter and instead prefixed the publish and version commands withcd ui &&to run them from the correct directory where the.changesetfolder exists.Changes
publish: pnpm run release→publish: cd ui && pnpm run releaseversion: pnpm run version→version: cd ui && pnpm run versioncwd: uiVerification
✅ Workflow run #23572031847 completed successfully
References