release: refetch the annotated tag object that checkout replaces
Gates / test (push) Successful in 1m16s
Gates / test-aarch64 (push) Successful in 4m33s
Gates / frontend (push) Successful in 48s
Gates / package (push) Successful in 3m50s
Gates / container (push) Successful in 2m22s
CI / gates (push) Successful in 12m52s
Release / guard (push) Failing after 7s
Release / gates (push) Skipped
Release / publish (push) Skipped

This commit is contained in:
2026-08-08 16:03:04 +02:00
parent e14a29c5de
commit 32cd9b8e3e
+12
View File
@@ -171,6 +171,13 @@ jobs:
run: | run: |
set -euo pipefail set -euo pipefail
# actions/checkout on a tag ref fetches the *commit* SHA into
# refs/tags/<tag>, silently replacing the annotated tag object with a
# lightweight tag. Without this refetch, every signed tag reads as
# unannotated and the check below refuses it. --force because that
# wrong local ref already exists.
git fetch --force --no-tags origin "refs/tags/$TAG:refs/tags/$TAG"
if [ "$(git cat-file -t "refs/tags/$TAG")" != "tag" ]; then if [ "$(git cat-file -t "refs/tags/$TAG")" != "tag" ]; then
echo "refusing '$TAG': not an annotated tag, so it carries no signature" echo "refusing '$TAG': not an annotated tag, so it carries no signature"
exit 1 exit 1
@@ -491,6 +498,11 @@ jobs:
exit 1 exit 1
fi fi
# Same refetch as the guard: checkout replaced the annotated tag
# object with a lightweight one, and the tagger date below needs the
# real object.
git fetch --force --no-tags origin "refs/tags/$TAG:refs/tags/$TAG"
version="${TAG#v}" version="${TAG#v}"
tag_commit=$(git rev-parse "refs/tags/$TAG^{commit}") tag_commit=$(git rev-parse "refs/tags/$TAG^{commit}")
epoch=$(git for-each-ref --format='%(taggerdate:unix)' "refs/tags/$TAG") epoch=$(git for-each-ref --format='%(taggerdate:unix)' "refs/tags/$TAG")