Skip to content

fix(ci): handle new tags in server release workflow#1660

Merged
miguelg719 merged 3 commits intobrowserbase:contrib/1660from
chromiebot:chromie/fix-server-release-tag-fetch
Feb 4, 2026
Merged

fix(ci): handle new tags in server release workflow#1660
miguelg719 merged 3 commits intobrowserbase:contrib/1660from
chromiebot:chromie/fix-server-release-tag-fetch

Conversation

@chromiebot
Copy link
Contributor

@chromiebot chromiebot commented Feb 4, 2026

why

The git fetch command was failing with exit code 128 when trying to fetch a tag that doesn't exist on the remote yet (which is the case for new releases). This caused the entire release workflow to fail.

what changed

Added || true to allow the fetch to fail gracefully for new tags. The subsequent git rev-parse correctly handles both cases:

  • Existing tag: script exits with "Tag already exists" message
  • New tag: script proceeds to create and push the new tag

Fixes: https://github.com/browserbase/stagehand/actions/runs/21644437387

test plan


Summary by cubic

Fixes the server release workflow failing on new tags by allowing git fetch to fail gracefully when the tag doesn’t exist yet. Prevents release runs from stopping with exit code 128.

  • Bug Fixes
    • Added || true to git fetch for refs/tags/${TAG} to ignore missing remote tag errors.
    • Existing tag: logs “Tag already exists” and exits; new tag: proceeds to create and push.

Written for commit 5e25d90. Summary will update on new commits. Review in cubic

The git fetch command was failing with exit code 128 when trying to
fetch a tag that doesn't exist on the remote yet (which is the case
for new releases). This caused the entire release workflow to fail.

Added `|| true` to allow the fetch to fail gracefully for new tags.
The subsequent git rev-parse correctly handles both cases:
- Existing tag: script exits with "Tag already exists" message
- New tag: script proceeds to create and push the new tag

Fixes: https://github.com/browserbase/stagehand/actions/runs/21644437387

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@changeset-bot
Copy link

changeset-bot bot commented Feb 4, 2026

⚠️ No Changeset found

Latest commit: 5e25d90

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 4, 2026

Greptile Overview

Greptile Summary

Fixed the server release workflow to handle new tags gracefully by allowing the git fetch command to fail without breaking the workflow.

  • Modified git fetch to use 2>/dev/null || true pattern to suppress error output and return success even when the tag doesn't exist on remote yet
  • The subsequent git rev-parse check correctly handles both existing and new tags
  • This resolves the exit code 128 failure that was blocking new releases

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is a minimal, well-understood fix to a CI workflow that adds proper error handling for a known failure case. The || true pattern is standard practice in bash scripts for allowing commands to fail gracefully. The logic correctly handles both existing and new tags via the subsequent git rev-parse check.
  • No files require special attention

Important Files Changed

Filename Overview
.github/workflows/stagehand-server-release.yml Added `

Sequence Diagram

sequenceDiagram
    participant GHA as GitHub Actions
    participant Git as Git Repository
    participant Remote as Remote Origin
    
    Note over GHA: Workflow triggered on push to main
    
    GHA->>GHA: Detect release metadata
    GHA->>GHA: Determine TAG and VERSION
    
    Note over GHA: Create stagehand/server tag
    GHA->>Git: Configure git user
    
    GHA->>Remote: git fetch --force origin refs/tags/${TAG}
    alt Tag exists on remote
        Remote-->>GHA: Return tag successfully
    else Tag doesn't exist (new release)
        Remote--xGHA: Exit code 128 (suppressed by || true)
        Note over GHA: 2>/dev/null hides error<br/>|| true returns success
    end
    
    GHA->>Git: git rev-parse -q --verify refs/tags/${TAG}
    alt Tag exists locally
        Git-->>GHA: Tag found
        GHA->>GHA: Exit with "Tag already exists"
    else Tag doesn't exist locally
        Git--xGHA: Tag not found
        GHA->>Git: git tag -a ${TAG} ${TARGET_SHA}
        GHA->>Remote: git push origin ${TAG}
        Remote-->>GHA: Tag pushed successfully
    end
    
    GHA->>GHA: Build SEA binaries
    GHA->>GHA: Publish GitHub Release
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

This PR only modifies CI workflows and does not affect library code,
so no version bump is needed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.
Architecture diagram
sequenceDiagram
    participant Runner as GHA Runner (Release Workflow)
    participant Git as Git CLI (Local)
    participant Remote as GitHub Remote (Origin)

    Note over Runner, Remote: Release Tag Validation & Creation Flow

    Runner->>Git: git config user.name/email
    
    Runner->>Git: CHANGED: git fetch origin refs/tags/${TAG}
    Git->>Remote: Request tag reference
    alt Tag exists on remote
        Remote-->>Git: Tag data
        Git-->>Runner: Success (0)
    else Tag does not exist
        Remote-->>Git: Error (128)
        Git-->>Runner: CHANGED: Success (0) via "|| true"
    end

    Runner->>Git: git rev-parse --verify refs/tags/${TAG}
    
    alt Tag exists locally (after fetch)
        Git-->>Runner: Reference found
        Runner->>Runner: Log "Tag already exists" & Exit
    else Tag does not exist (New Release)
        Git-->>Runner: Reference not found
        Runner->>Git: git tag ${TAG}
        Runner->>Git: git push origin ${TAG}
        Git->>Remote: Push new tag reference
        Remote-->>Git: Success
    end
Loading

@miguelg719 miguelg719 changed the base branch from main to contrib/1660 February 4, 2026 21:13
@miguelg719 miguelg719 merged commit d71339d into browserbase:contrib/1660 Feb 4, 2026
17 of 18 checks passed
miguelg719 added a commit that referenced this pull request Feb 4, 2026
# why
The git fetch command was failing with exit code 128 when trying to
fetch a tag that doesn't exist on the remote yet (which is the case for
new releases). This caused the entire release workflow to fail.

# what changed
Added `|| true` to allow the fetch to fail gracefully for new tags. The
subsequent git rev-parse correctly handles both cases:
- Existing tag: script exits with "Tag already exists" message
- New tag: script proceeds to create and push the new tag

# test plan

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Prevented the server release workflow from failing on new releases by
letting git fetch ignore missing remote tags. Existing tags exit with a
clear message; new tags proceed to be created and pushed.

<sup>Written for commit d71339d.
Summary will update on new commits. <a
href="https://cubic.dev/pr/browserbase/stagehand/pull/1661">Review in
cubic</a></sup>

<!-- End of auto-generated description by cubic. -->

Co-authored-by: Chromie <miguel@browserbase.com>
Co-authored-by: Chromie Bot <chromie@browserbase.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
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