Skip to content

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

Merged
miguelg719 merged 1 commit intomainfrom
contrib/1660
Feb 4, 2026
Merged

fix(ci): handle new tags in server release workflow (#1660)#1661
miguelg719 merged 1 commit intomainfrom
contrib/1660

Conversation

@miguelg719
Copy link
Collaborator

@miguelg719 miguelg719 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

test plan


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.

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

# 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

<!-- This is an auto-generated description by cubic. -->
---
## 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.

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

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

---------

Co-authored-by: Chromie Bot <chromie@browserbase.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Miguel <36487034+miguelg719@users.noreply.github.com>
@miguelg719 miguelg719 marked this pull request as ready for review February 4, 2026 21:14
@changeset-bot
Copy link

changeset-bot bot commented Feb 4, 2026

⚠️ No Changeset found

Latest commit: d71339d

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

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.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 4, 2026

Greptile Overview

Greptile Summary

Fixed git fetch failure for new tags in the server release workflow by adding graceful error handling.

  • Added || true to allow git fetch to fail without stopping the workflow when fetching tags that don't exist on the remote yet
  • Redirected stderr to /dev/null to suppress error messages for expected failures
  • The subsequent git rev-parse check correctly handles both existing and new tags, ensuring proper workflow behavior

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • The fix is minimal, well-understood, and directly addresses the exit code 128 error. The logic properly handles both existing and new tags with no side effects.
  • No files require special attention

Important Files Changed

Filename Overview
.github/workflows/stagehand-server-release.yml Added graceful failure handling for git fetch when tag doesn't exist remotely, fixing exit code 128 errors for new releases

Sequence Diagram

sequenceDiagram
    participant GHA as GitHub Actions
    participant Git as Git Commands
    participant Remote as Remote Repository
    participant Local as Local Repository

    GHA->>Git: Configure git user
    Git->>Local: Set user.name and user.email
    
    GHA->>Git: Fetch tag from remote
    Git->>Remote: git fetch --force origin "refs/tags/${TAG}:refs/tags/${TAG}"
    
    alt Tag exists on remote
        Remote-->>Git: Tag found
        Git-->>Local: Update local tag reference
        Git-->>GHA: Success (exit 0)
    else Tag doesn't exist on remote (new release)
        Remote-->>Git: Error 128 (tag not found)
        Note over Git: 2>/dev/null suppresses error message
        Note over Git: || true converts exit code to 0
        Git-->>GHA: Success (exit 0)
    end
    
    GHA->>Git: Check if tag exists locally
    Git->>Local: git rev-parse -q --verify "refs/tags/${TAG}"
    
    alt Tag exists locally
        Local-->>Git: Tag found
        Git-->>GHA: Tag exists
        GHA->>GHA: Exit (no action needed)
    else Tag doesn't exist locally
        Local-->>Git: Tag not found
        Git-->>GHA: Tag doesn't exist
        GHA->>Git: Create new tag
        Git->>Local: git tag -a "${TAG}" "${TARGET_SHA}"
        GHA->>Git: Push tag to remote
        Git->>Remote: git push origin "${TAG}"
        Remote-->>Git: Tag pushed successfully
        Git-->>GHA: Success
    end
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

@miguelg719 miguelg719 merged commit 653268b into main Feb 4, 2026
21 checks passed
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.

3 participants