fix(ci): handle new tags in server release workflow#1660
Merged
miguelg719 merged 3 commits intobrowserbase:contrib/1660from Feb 4, 2026
Merged
Conversation
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>
|
Contributor
Greptile OverviewGreptile SummaryFixed the server release workflow to handle new tags gracefully by allowing the git fetch command to fail without breaking the workflow.
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
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
|
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>
Contributor
There was a problem hiding this comment.
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
miguelg719
approved these changes
Feb 4, 2026
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>
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.
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
|| trueto allow the fetch to fail gracefully for new tags. The subsequent git rev-parse correctly handles both cases: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.
Written for commit 5e25d90. Summary will update on new commits. Review in cubic