From 786d9c61108991edbea061b4d84cb6f418f0e682 Mon Sep 17 00:00:00 2001 From: Logan Date: Mon, 17 Aug 2026 20:37:43 -0400 Subject: [PATCH] fix(release): seed the version floor on the parent, not on HEAD The floor tag marks what has already been released, so tagging the commit being pushed leaves nothing between the floor and HEAD -- semantic-release then correctly reports there is nothing to release. That is what the first run did: it seeded v0.0.0 on the merge commit itself and cut no release. HEAD^ is the first parent, so on a merge commit it is main as it was before the merge and everything the merge brought in is releasable. The tag has been moved to 6fb7b5e by hand; this is so the next repo never needs that. --- .gitea/workflows/release.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 5941245..4216ef3 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -128,12 +128,26 @@ jobs: token="${ACTIONS_TOKEN:-$PACKAGE_TOKEN}" [ -n "$ACTIONS_TOKEN" ] || echo "note: GITEA_TOKEN is unset; using the PAT" + # **On the parent, not on HEAD.** The floor marks what has + # already been released, so tagging the commit being pushed + # leaves nothing between the floor and HEAD — semantic-release + # then correctly reports there is nothing to release, which is + # exactly what the first run of this workflow did. HEAD^ is the + # first parent, so on the merge commit this fires for it is main + # as it was before the merge, and everything the merge brought + # in is releasable. + floor=$(git rev-parse "${{ github.sha }}^" 2>/dev/null || true) + if [ -z "$floor" ]; then + echo "HEAD has no parent, so no commit can precede the floor" >&2 + exit 1 + fi + echo "no v* tag exists — seeding v0.0.0 so the first release is 0.0.1" - git tag v0.0.0 "${{ github.sha }}" + git tag v0.0.0 "$floor" git push --quiet \ "https://x-access-token:${token}@${SERVER_URL#https://}/${REPO}.git" \ refs/tags/v0.0.0 - echo "seeded v0.0.0 at ${{ github.sha }}" + echo "seeded v0.0.0 at $floor (parent of ${{ github.sha }})" # Pinned rather than installed into the repo: this is a Go project # and a package.json at its root invites the npm plugin and every -- 2.54.0