Skip to content

Commit 6112f4f

Browse files
committed
fix(ci): start release notes from a tag that exists
The notes range was built from the previous release's *name*, never from a check that it exists. 1.9.3 shipped only as rc.1, so v1.9.4-rc.1 asked git for v1.9.3..v1.9.4-rc.1 and the publish step died on `unknown revision` -- after all four platforms had already built and uploaded their artifacts. The existing rc walk-down covers a skipped RC. Nothing covered a skipped stable, and that loop does not run at all for an rc.1 (`for n = 0; n >= 1`). This is not only about release notes: publish-msstore has `needs: publish-release`, so the same missing tag would have taken the Store deployment down with it on a stable promotion, which is the one place that failure is expensive to discover. Falls back to the nearest tag reachable from the release commit's parent, which is what "since the last release" meant to begin with -- v1.9.2 for the tag that failed, a 25-commit range. If no tag is reachable at all, the root commit keeps the range valid rather than handing git an empty left-hand side.
1 parent e032894 commit 6112f4f

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,24 @@ jobs:
745745
fi
746746
done
747747
fi
748+
# Everything above computes what the previous release was *called* and
749+
# never checks that it exists. A version line that stopped at its RC
750+
# makes that a name for nothing: 1.9.3 shipped only as rc.1, so
751+
# v1.9.4-rc.1 asked git for v1.9.3..v1.9.4-rc.1 and the publish step
752+
# died on `unknown revision` -- after all four platforms had already
753+
# built, and with publish-msstore sitting behind publish-release, so
754+
# the same gap would silently block a stable release's Store
755+
# deployment too. The rc walk-down above handles a skipped RC; nothing
756+
# handled a skipped stable, and it does not run at all for an rc.1.
757+
if ! git rev-parse -q --verify "refs/tags/${NOTES_START_TAG}" >/dev/null; then
758+
# The nearest tag reachable from the release commit's parent, which
759+
# is what "since the last release" meant in the first place. Empty
760+
# only when no tag is reachable at all (a first release), so fall
761+
# back to the root commit to keep the range valid either way.
762+
FALLBACK="$(git describe --tags --abbrev=0 "${TAG}^" 2>/dev/null || true)"
763+
NOTES_START_TAG="${FALLBACK:-$(git rev-list --max-parents=0 HEAD | tail -1)}"
764+
echo "Previous-release tag did not exist; starting notes from ${NOTES_START_TAG}"
765+
fi
748766
echo "Computed notes_start_tag=${NOTES_START_TAG} for tag=${TAG}"
749767
750768
echo "tag=$TAG" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)