Fix release workflows failing on unmerged branches#371
Merged
Conversation
Co-authored-by: devstress <30769729+devstress@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix failed release workflows for version 1.0.0
Fix release workflows failing on unmerged branches
Oct 28, 2025
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.
Release workflows fail with exit code 1 when
release/v1.0.0branch exists remotely but is not merged to main, preventing the workflow from continuing with version 1.0.0 and recreating the branch.Root Cause
The
check_branch_merged()function returns non-zero exit codes to indicate branch states (0=merged, 1=unmerged, 2=non-existent). GitHub Actions treats any non-zero exit code as a failure, causing the workflow to abort before conditional logic can handle the unmerged state.Changes
Wrapped
check_branch_merged()calls withset +e/set -eto allow non-zero exit codes without failing the workflow:Modified 6 locations across:
.github/workflows/release-major.yml.github/workflows/release-minor.yml.github/workflows/release-patch.ymlEach workflow has two call sites: one for initial version (CURRENT="1.0.0") and one for bumped versions.
Behavior
When
release/v1.0.0exists but is not merged:Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.