Repository navigation
Publish to npm via trusted publishing - #189
Merged
Merged
Conversation
Adds a workflow_dispatch publish workflow so releases no longer need the npm token: after npm version + git push --follow-tags, run the workflow with the version. It checks out v<version>, verifies the package name, version, master ancestry for latest and that the version is new, then publishes via npm OIDC. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
The workflow now bumps the version itself (patch/minor/major, or a prerelease to the next dist-tag) from the higher of npm latest and master, publishes, pushes the v<version> tag and pushes the version bump to a release-v<version>-<timestamp> branch for a PR to master. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
npm version <bump>, npm publish --access public, then push the tag and the version bump branch. Drops the extra version checks and the prerelease option. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
prerelease publishes <next>-tp.0 to the next dist-tag and pushes only its tag, so the setup can be checked without moving latest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
07souravkunda
approved these changes
Nov 6, 2026
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.
Problem
browserstack-localis published to npm from a developer machine with an npm access token. npm is removing token-based publishing in January 2027. Its replacement, trusted publishing, only accepts a publish from a CI workflow registered on the package.Change
Adds
.github/workflows/publish.yml(Local Binding Publish), which runs the existing release steps in GitHub Actions.To release: Actions → Local Binding Publish → Run workflow on
master→ pick the Version Type:patch,minor,majororprerelease.npm version <type>npm version <type>(commit + tagv<version>)npm publish --access publicnpm publish --access publicgit push --follow-tagsgit push --follow-tagsto a newrelease-<timestamp>branch instead ofmaster. The run summary links to open the version bump PR intomasterThe bump goes to a branch because
masteronly accepts changes through pull requests. Merge the bump PR before the next release: ifmasterstill has the old version,npm versionstops with "tag already exists" and nothing is published.prereleaseis for test releases: it publishes<next>-tp.0(e.g.1.5.17-tp.0) to thenextdist-tag and pushes only its tag, solatestandmasterare untouched. Prereleases are never picked bynpm i browserstack-localor^/~ranges.The tag and branch are pushed only after the publish succeeds, so a failed publish can simply be re-run. Because the repo is public, npm also attaches provenance to each version.
Nothing runs until someone dispatches it, and nothing can publish until this workflow is added as the trusted publisher on npmjs.com.
Tests
actionlintclean. Actions pinned to commit SHAs, and npm pinned to11.21.0.npm publishandgit pushwere logging stubs:patch/minor/majorfrom 1.5.16latest→ tag +release-<timestamp>branchprereleasefrom 1.5.161.5.17-tp.0tonext→ tagv1.5.17-tp.0onlynpm version, nothing publishednpm publishfailsv1.5.16packs the same 21 files, byte-identical, as the publishedbrowserstack-local@1.5.16, so a CI publish ships the same package.After merge
browserstack/browserstack-local-nodejs/publish.yml.prerelease, then release withpatch/minor/major.🤖 Generated with Claude Code