Skip to content
Open
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
27 changes: 26 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,33 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check for npm-published package changesets in this push
id: check_changesets
run: |
set -euo pipefail

# Only look at changeset files added/modified in this push.
# || true because grep -v exits 1 when there are no matches (i.e. no new changesets).
new_changesets=$(git diff --name-only --diff-filter=AM ${{ github.event.before }} ${{ github.sha }} -- '.changeset/*.md' | grep -v README.md || true)

if [ -z "$new_changesets" ]; then
echo "has_changesets=false" >> $GITHUB_OUTPUT
exit 0
fi

# Check if any new changesets reference our npm-published packages.
# Private packages (server-v3, server-v4) have their own release workflows.
has_publishable=false
for file in $new_changesets; do
if grep -qE '"@browserbasehq/stagehand"|"@browserbasehq/browse-cli"' "$file"; then
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Mar 16, 2026

Choose a reason for hiding this comment

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

P2: This check can produce false positives because it scans the whole changeset markdown file instead of only frontmatter package entries. According to linked Linear issue STG-1583, alpha publishing should only happen when a relevant changeset is actually present; this logic can still publish alpha when package names appear only in the note body.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/release.yml, line 67:

<comment>This check can produce false positives because it scans the whole changeset markdown file instead of only frontmatter package entries. According to linked Linear issue STG-1583, alpha publishing should only happen when a relevant changeset is actually present; this logic can still publish alpha when package names appear only in the note body.</comment>

<file context>
@@ -46,25 +46,30 @@ jobs:
+          # Private packages (server-v3, server-v4) have their own release workflows.
+          has_publishable=false
+          for file in $new_changesets; do
+            if grep -qE '"@browserbasehq/stagehand"|"@browserbasehq/browse-cli"' "$file"; then
+              has_publishable=true
+              break
</file context>
Suggested change
if grep -qE '"@browserbasehq/stagehand"|"@browserbasehq/browse-cli"' "$file"; then
if sed -n '/^---$/,/^---$/p' "$file" | grep -qE "^[[:space:]]*['\"](@browserbasehq/stagehand|@browserbasehq/browse-cli)['\"]:[[:space:]]"; then
Fix with Cubic

has_publishable=true
break
fi
done
echo "has_changesets=$has_publishable" >> $GITHUB_OUTPUT

- name: Publish Canary
if: github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/main' && steps.check_changesets.outputs.has_changesets == 'true'
run: |
git checkout main
pnpm run release-canary
Expand Down
Loading