From a6a6f2e62d9b0880fb0c08ce3c6428e45c5f4675 Mon Sep 17 00:00:00 2001 From: zgq Date: Thu, 8 Oct 2026 11:20:48 +0800 Subject: [PATCH] fix: preserve annotated tag validation in package workflow --- .github/workflows/package.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 5e2b65c..447aa84 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -29,6 +29,9 @@ jobs: - name: Require an annotated release tag on main if: github.ref_type == 'tag' run: | + # actions/checkout resolves the tag ref to GITHUB_SHA after fetching it. + # Restore the remote tag object before checking that this is annotated. + git fetch --force origin "refs/tags/${GITHUB_REF_NAME}:refs/tags/${GITHUB_REF_NAME}" test "$(git cat-file -t "$GITHUB_REF")" = tag git merge-base --is-ancestor "$GITHUB_SHA" origin/main