Skip to content

ci: use pnpm in publish workflow and tolerate missing husky#1450

Merged
AbhiPrasad merged 1 commit intomainfrom
fix/publish-workflow-use-pnpm
Feb 27, 2026
Merged

ci: use pnpm in publish workflow and tolerate missing husky#1450
AbhiPrasad merged 1 commit intomainfrom
fix/publish-workflow-use-pnpm

Conversation

@AbhiPrasad
Copy link
Member

@AbhiPrasad AbhiPrasad commented Feb 27, 2026

Summary

  • Switch publish workflow and scripts from npm to pnpm for consistency with the rest of the repo
  • Add pnpm/action-setup@v4 to the publish CI workflow (replacing npm install -g [email protected])
  • Make root prepare script tolerate missing husky (husky || true)

Fixes the failed publish run: https://github.com/braintrustdata/braintrust-sdk-javascript/actions/runs/22496559262/job/65172571387

Test plan

  • Re-run the publish workflow and confirm it passes
  • Verify local pnpm install still runs husky prepare successfully

🤖 Generated with Claude Code

The publish workflow failed because `npm install` triggered the root
prepare script which runs `husky`, but husky wasn't installed in CI.
Switch all npm commands to pnpm for consistency with the rest of the
repo, and make the prepare script tolerate missing husky.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@AbhiPrasad AbhiPrasad requested review from cpinn and ibolmo February 27, 2026 17:48
if [ -n "${CI:-}" ] || [ -n "${GITHUB_ACTIONS:-}" ]; then
# Running in CI - publish without confirmation
npm publish --tag "$DIST_TAG"
pnpm publish --tag "$DIST_TAG" --no-git-checks
Copy link
Contributor

Choose a reason for hiding this comment

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

whats the need for the no-git-checks seems like we might want that setting?

--no-git-checks

Copy link
Member Author

Choose a reason for hiding this comment

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

good catch, that was just AI sneaking it in. I'll fix.

Copy link
Member Author

@AbhiPrasad AbhiPrasad Feb 27, 2026

Choose a reason for hiding this comment

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

It seems this is needed for pnpm specifically, pnpm has extra safety checks for publishing.

In CI, actions/checkout checks out a detached HEAD (not a named branch), so pnpm's default check — "are you on the publish branch (main)?" — fails. For prereleases, the script also modifies package.json without committing, which fails the "clean working tree" check. --no-git-checks skips both.

@AbhiPrasad AbhiPrasad changed the title fix(ci): use pnpm in publish workflow and tolerate missing husky ci: use pnpm in publish workflow and tolerate missing husky Feb 27, 2026
@AbhiPrasad AbhiPrasad merged commit 30b180a into main Feb 27, 2026
37 checks passed
@AbhiPrasad AbhiPrasad deleted the fix/publish-workflow-use-pnpm branch February 27, 2026 17:59
AbhiPrasad added a commit that referenced this pull request Feb 27, 2026
Reverts the publish-related changes from #1450 and #1451, restoring npm
for the publish workflow and scripts while keeping the husky || true fix.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
AbhiPrasad added a commit that referenced this pull request Feb 27, 2026
Reverts the publish-related changes from #1450 and #1451, restoring npm
for the publish workflow and scripts while keeping the husky || true
fix.

pnpm publish has a ton of drawbacks compared to using plain npm.

Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
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