Skip to content

fix: remove unsupported cwd parameter from changesets action#8128

Merged
alexhancock merged 3 commits into
mainfrom
fix-npm-publish-workflow
Mar 26, 2026
Merged

fix: remove unsupported cwd parameter from changesets action#8128
alexhancock merged 3 commits into
mainfrom
fix-npm-publish-workflow

Conversation

@alexhancock
Copy link
Copy Markdown
Collaborator

Problem

The npm publish workflow was failing with the error:

Error: There is no .changeset directory in this project

This was caused by the changesets/action@v1 not supporting the cwd parameter that was being used in the workflow.

Solution

Removed the unsupported cwd: ui parameter and instead prefixed the publish and version commands with cd ui && to run them from the correct directory where the .changeset folder exists.

Changes

  • publish: pnpm run releasepublish: cd ui && pnpm run release
  • version: pnpm run versionversion: cd ui && pnpm run version
  • Removed: cwd: ui

Verification

✅ Workflow run #23572031847 completed successfully

  • All 6 build jobs passed
  • Release to npm job passed (46s)
  • No ".changeset directory" error

References

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>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread .github/workflows/publish-npm.yml Outdated
Comment on lines +303 to +304
publish: cd ui && pnpm run release
version: cd ui && pnpm run version
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Douwe Osinga added 2 commits March 26, 2026 07:42
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>
@DOsinga
Copy link
Copy Markdown
Collaborator

DOsinga commented Mar 26, 2026

My agent had a different take. Let me know what you think

@alexhancock alexhancock added this pull request to the merge queue Mar 26, 2026
Merged via the queue into main with commit 8c8bb10 Mar 26, 2026
23 checks passed
@alexhancock alexhancock deleted the fix-npm-publish-workflow branch March 26, 2026 14:42
hydrosquall pushed a commit to hydrosquall/goose that referenced this pull request Mar 31, 2026
…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>
hydrosquall pushed a commit to hydrosquall/goose that referenced this pull request Mar 31, 2026
…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>
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.

2 participants