From 74db970c649e6fdbde0370df3972c2bf5ea9910f Mon Sep 17 00:00:00 2001 From: Jose Armesto Date: Mon, 1 Jun 2026 12:16:39 +0200 Subject: [PATCH] fix(release): normalize empty manifest version to 0.0.0 for first release 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. --- .github/workflows/release.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9930d7d..4f66941 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -105,9 +105,12 @@ jobs: base_branch=$(jq -r '.baseBranchName' <<<"$PR_JSON") # Read the single root (".") entry of the release-please manifest at a ref. + # On a fresh repo the manifest is an empty object until the first release lands, + # so a missing "." key is normalized to 0.0.0 — otherwise the numeric comparisons + # below silently fall through and the first release's bump is classified as none. manifest_version() { gh api "repos/${GH_REPO}/contents/.release-please-manifest.json?ref=$1" \ - -H "Accept: application/vnd.github.raw" | jq -r '.["."]' + -H "Accept: application/vnd.github.raw" | jq -r '.["."] // "0.0.0"' } current=$(manifest_version "$base_branch")