Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/publish-js-sdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,12 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for changelog generation
- uses: pnpm/action-setup@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
- name: Install npm 11.6.2
run: npm install -g npm@11.6.2

- name: Determine version
id: set_version
Expand Down
6 changes: 3 additions & 3 deletions js/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ verify-ci: build docs test

publish-sdk-js:
./scripts/validate-release.sh
npm install
npm run build
npm publish
pnpm install
pnpm run build
pnpm publish --no-git-checks

# This is the only method I could find to install a package without explicitly
# adding a dependency or modifying lock files.
Expand Down
8 changes: 4 additions & 4 deletions js/scripts/publish-prerelease.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ echo ""

# Build the SDK
echo "Building SDK..."
npm install
npm run build
pnpm install
pnpm run build
echo "Build complete."
echo ""

Expand All @@ -87,13 +87,13 @@ echo ""
# In CI, just publish. Locally, ask for confirmation
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.

else
# Running locally - ask for confirmation
read -p "Ready to publish version $NEW_VERSION to npm with tag @$DIST_TAG? (y/N) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
npm publish --tag "$DIST_TAG"
pnpm publish --tag "$DIST_TAG" --no-git-checks
else
echo "Publish cancelled."
echo ""
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"start": "turbo run start",
"clean": "turbo run clean",
"test": "turbo run test --filter=\"!@braintrust/otel\"",
"prepare": "husky",
"prepare": "husky || true",
"lint:prettier": "prettier --check .",
"lint:eslint": "turbo run lint",
"fix:prettier": "prettier --write .",
Expand Down
Loading