chore: Decouple browse-cli release cycle from stagehand core#1885
Merged
chore: Decouple browse-cli release cycle from stagehand core#1885
Conversation
Add browse-cli to the changeset `ignore` list so the main "Version Packages" PR no longer includes it. A new `release-cli.yml` workflow (triggered via workflow_dispatch) independently versions and publishes browse-cli to npm using Trusted Publishing. The workflow: 1. Detects pending browse-cli changesets (fails on mixed changesets) 2. Temporarily swaps the ignore config to version only browse-cli 3. Builds, publishes to npm, commits the version bump, and tags Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Contributor
There was a problem hiding this comment.
1 issue found across 2 files
Confidence score: 2/5
- There is a high-risk release integrity issue in
.github/workflows/release-cli.yml: manual dispatch from non-mainrefs can publish unmerged branch code. - Given the issue’s high severity/confidence (8/10, 8/10) and direct impact on what gets released to users, this is likely merge-blocking until ref restrictions are added.
- Pay close attention to
.github/workflows/release-cli.yml- ensure the release job is restricted tomainso only merged code can be published.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name=".github/workflows/release-cli.yml">
<violation number="1" location=".github/workflows/release-cli.yml:13">
P1: Restrict this release job to `main`; currently a manual dispatch on another ref can publish unmerged branch code.</violation>
</file>
Architecture diagram
sequenceDiagram
participant Dev as Developer
participant GHA as GitHub Actions (release-cli)
participant FS as Local Filesystem
participant NPM as npm Registry
participant Git as GitHub Repository
Note over Dev,Git: NEW: Independent CLI Release Flow (Manual)
Dev->>GHA: Trigger workflow_dispatch
GHA->>FS: Scan .changeset/*.md for "@browserbasehq/browse-cli"
alt No CLI changesets found
GHA-->>Dev: Exit (Success/Neutral)
else Mixed changesets detected (CLI + Core)
GHA-->>Dev: NEW: Fail with Error (Must split changesets)
else CLI-only changesets found
GHA->>FS: Backup .changeset/config.json
GHA->>FS: NEW: Patch config.json (Ignore Core, include CLI)
GHA->>GHA: pnpm changeset version
Note right of GHA: Consumes CLI changesets,<br/>updates CLI version/changelog
GHA->>FS: Restore original .changeset/config.json
GHA->>GHA: pnpm exec turbo run build
GHA->>NPM: NEW: npm publish (packages/cli)
Note right of NPM: Uses Trusted Publishing (OIDC)
GHA->>Git: Commit version bump & push tag
Git-->>GHA: Success
GHA-->>Dev: Release Complete
end
Note over Git,FS: CHANGED: Standard Release Flow (release.yml)
Note over Git,FS: Now automatically ignores browse-cli changesets<br/>due to updated .changeset/config.json
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Adds an `if: github.ref == 'refs/heads/main'` guard to prevent accidental publishes from non-main branches via workflow_dispatch. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… error changesets validates that non-ignored packages can't depend on ignored ones, even via devDependencies. Since browse-cli depends on stagehand via workspace:*, the config swap alone fails. Fix: temporarily remove the stagehand dep from package.json before running changeset version (tsup bundles it at build time so it's not needed for versioning), then merge the version bump back into the original package.json. Tested locally end-to-end: version bumps correctly, CLI changesets consumed, core changesets untouched, changelog generates with PR links. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
pirate
approved these changes
Mar 25, 2026
pirate
reviewed
Mar 25, 2026
The setup-node-pnpm-turbo action already handles node version. The second setup-node call only needs to set registry-url for Trusted Publishing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
pirate
approved these changes
Mar 26, 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.
Summary
@browserbasehq/browse-clito the changesetignorelist so the main "Version Packages" PR no longer includes CLI version bumpsrelease-cli.ymlworkflow (triggered viaworkflow_dispatch) that independently versions and publishes browse-cli to npmHow it works
Main release flow (
release.yml) — unchanged, but now skips browse-cli. Core stagehand changesets are versioned and published as before.CLI release flow (
release-cli.yml) — triggered manually via GitHub Actions "Run workflow":changeset versionto consume CLI changesets and bumppackages/cli/package.jsonConstraints
alpha) releases — add a canary step torelease-cli.ymlif needed laterTest plan
release.ymlstill creates "Version Packages" PR for core changesets (browse-cli changesets should be excluded)release-cli.ymlvia workflow_dispatch with a pending browse-cli changeset and verify it publishes correctly🤖 Generated with Claude Code
Summary by cubic
Decouples the
@browserbasehq/browse-clirelease cycle from stagehand core so we can ship CLI updates independently. Implements STG-1663.New Features
@browserbasehq/browse-clito.changesetignore sorelease.ymlskips CLI.release-cli.yml(manual viaworkflow_dispatch, restricted tomain) to version and publish CLI with Trusted Publishing..changesetignore to version only CLI and strips the@browserbasehq/stagehandworkspace dep beforechangeset versionto satisfy Changesets; restores both after.packages/clito npm, commits the bump, and tags.Migration
Written for commit c298904. Summary will update on new commits. Review in cubic