From fb1edd99fd069d950112fe337deb4c87ed322969 Mon Sep 17 00:00:00 2001 From: Eric Hare Date: Wed, 10 Jun 2026 08:41:00 -0700 Subject: [PATCH] fix(ci): create GitHub releases on the dispatched v-prefixed tag (1.10.1) (#13609) fix(ci): create GitHub releases on the dispatched v-prefixed tag The create_release job passed the bare version (v stripped) as the release tag with no commit target, so when that tag did not exist GitHub minted a new lightweight tag at the default-branch HEAD -- the wrong commit, still carrying the previous version (main only adopts a release's version via the post-release back-merge). Every release since 1.8.2 shipped a stray bare tag (1.8.2, 1.8.3, 1.9.0-1.9.6, 1.10.0) pointing at a previous-version commit, and the GitHub release had to be manually re-pointed to the real vX.Y.Z tag after each release. - create_release now attaches the release to inputs.release_tag for stable releases; pre-releases keep their computed tag (e.g. 1.10.0rc1) but it is minted at the release commit via 'commit:'. - release-lfx.yml pins the minted lfx-v* tag to github.sha instead of the default branch. The validate-tag-format guard (#12847) only blocks at dispatch time; create_release was re-creating the very duplicates it guards against. --- .github/workflows/release-lfx.yml | 3 +++ .github/workflows/release.yml | 18 +++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-lfx.yml b/.github/workflows/release-lfx.yml index fd7c11b8bf..0c3f438411 100644 --- a/.github/workflows/release-lfx.yml +++ b/.github/workflows/release-lfx.yml @@ -337,6 +337,9 @@ jobs: uses: softprops/action-gh-release@v2 with: tag_name: lfx-v${{ github.event.inputs.version }} + # Pin the minted tag to the commit this release was built from; + # without it GitHub creates the tag at the default-branch HEAD. + target_commitish: ${{ github.sha }} name: LFX ${{ github.event.inputs.version }} body_path: release_notes.md draft: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 41c9e13e24..ade6471a4c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1216,6 +1216,20 @@ jobs: with: name: dist-main path: dist + # The release must attach to the dispatched v-prefixed tag. Passing the + # bare version as `tag` made GitHub mint a new lightweight tag at the + # default-branch HEAD — the wrong commit, still carrying the previous + # version (main only adopts the new version via the post-release + # back-merge). Pre-releases keep their computed tag (e.g. 1.10.0rc1), + # but `commit` pins any newly minted tag to the release commit. + - name: Resolve release commit + id: release_commit + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + sha=$(gh api "repos/${{ github.repository }}/commits/${{ inputs.release_tag }}" --jq '.sha') + echo "Release tag '${{ inputs.release_tag }}' resolves to commit $sha" + echo "sha=$sha" >> "$GITHUB_OUTPUT" - name: Create Release uses: ncipollo/release-action@v1 with: @@ -1224,6 +1238,8 @@ jobs: draft: false generateReleaseNotes: true prerelease: ${{ inputs.pre_release }} - tag: ${{ needs.determine-main-version.outputs.version }} + tag: ${{ inputs.pre_release && needs.determine-main-version.outputs.version || inputs.release_tag }} + name: ${{ needs.determine-main-version.outputs.version }} + commit: ${{ steps.release_commit.outputs.sha }} allowUpdates: true updateOnlyUnreleased: false