fix(release): handle empty manifest for first release auto-merge - #191
Merged
Conversation
…ease
The auto-merge reconcile step in the release workflow reads the current
version from .release-please-manifest.json on the base branch. On a fresh
repo the manifest is "{}" until the first release lands, so jq returns
"null" for the "." key. The subsequent numeric -gt comparisons then all
fall through and classify the bump as "none", which is never auto-merged
at any auto-merge-level.
Normalize a missing "." key to "0.0.0" so the first release is bump-classified
correctly (e.g. 0.0.0 -> 1.0.0 = major, 0.0.0 -> 0.1.0 = minor). Whether the
PR actually auto-merges still depends on the configured auto-merge-level.
fiunchinho
marked this pull request as ready for review
June 1, 2026 11:52
fiunchinho
enabled auto-merge (squash)
June 1, 2026 12:09
QuentinBisson
approved these changes
Jun 1, 2026
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.
Summary
The auto-merge reconcile step in
.github/workflows/release.yamlmis-classifies the bump on a brand-new repo's first release-please PR, leaving auto-merge disabled even when the configuredauto-merge-levelwould allow it.Reproduction
On a fresh repo (manifest is
{}until the first release lands), the run logs show:null -> 1.0.0andbump=noneare wrong — there's a real version on the PR head branch.Root cause
manifest_version()runsjq -r '.["."]'against the manifest. On the base branch the manifest is{}, so jq returns the stringnull. The subsequentIFS=. read -r cmaj cmin cpat <<<"$current"producescmaj=null, and the-gtarithmetic comparisons all silently evaluate to false (bash treats unset/non-numeric as 0 in this context underset -e), so the chain falls through tobump=none. Auto-merge is then never enabled, sincenoneis below everyauto-merge-level.Fix
Normalize a missing
"."key to"0.0.0"inmanifest_version()using jq's alternative operator:With the fix, the same first-release scenario classifies correctly as
0.0.0 -> 1.0.0 (major bump). Whether the PR actually auto-merges then depends onauto-merge-levelas documented — a major bump still won't merge at levelminor, which is the intended behavior.Test plan
giantswarm/test-release-please(a fresh repo with an empty manifest) by pinning its workflow to this branch — will report the run output here once the PR is open and the test workflow is updated.