Skip to content

Commit 2b93226

Browse files
Branimir Rakiccursoragent
authored andcommitted
fix(ci): fetch-tags on tag-introspection checkouts so signed annotated tags pass
The `Validate release candidate` job in `release.yml` and the `Require signed annotated tag` job in `npm-publish.yml` both use `actions/checkout` to materialise the pushed tag, then run `git cat-file -t <tag>` to verify the tag is annotated (and `git cat-file -p <tag>` to grep for a PGP/SSH signature block). `actions/checkout@v4` does not fetch annotated tag OBJECTS by default — it materialises the tag as a synthetic lightweight ref pointing at the commit. So `git cat-file -t <tag>` returns `commit` instead of `tag`, and the structural signed-tag gate rejects legitimately signed tags with "Tag is a lightweight ref ... lightweight tags cannot carry a signature". This was the failure mode on `v10.0.0-rc.8`: the tag was correctly created with `git tag -s` (annotated, SSH-signed) and `git ls-remote` on the remote shows it as a tag object whose `^{}` peels to the merge commit. But the workflow's runner saw it as lightweight because `fetch-tags: true` was missing from the checkout. Setting `fetch-tags: true` makes actions/checkout actually download the annotated tag object alongside the commit, so `git cat-file -t` returns the expected `tag` and the signature-block grep can read the body. Author intent (from the existing comments in release.yml around line 100) is unambiguous: the structural check is meant to PASS for annotated signed tags and only REJECT lightweight or unsigned tags. This fix restores that intended behaviour. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 2729848 commit 2b93226

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

.github/workflows/npm-publish.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,13 @@ jobs:
227227
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
228228
with:
229229
fetch-depth: 1
230+
# `fetch-tags: true` so the annotated tag OBJECT (not just the
231+
# ref) is materialised on the runner. Without this,
232+
# actions/checkout creates a synthetic lightweight ref pointing
233+
# at the commit, and `git cat-file -t <tag>` returns `commit`
234+
# instead of `tag` — defeating the signed-annotated-tag check
235+
# below for legitimately signed tags.
236+
fetch-tags: true
230237
persist-credentials: false
231238

232239
- name: Validate tag is annotated and signed

.github/workflows/release.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ jobs:
5656
# `fetch-depth: 0` so we can verify the tag's commit ancestry
5757
# against `main` below (origin/main must be locally walkable).
5858
fetch-depth: 0
59+
# `fetch-tags: true` so the annotated tag OBJECT (not just the
60+
# ref) is materialised on the runner. Without this,
61+
# actions/checkout creates a synthetic lightweight ref pointing
62+
# at the commit, and `git cat-file -t <tag>` returns `commit`
63+
# instead of `tag` — defeating the structural signed-tag check
64+
# below for legitimately signed annotated tags.
65+
fetch-tags: true
5966
persist-credentials: false
6067
- name: Validate tag format
6168
run: |

0 commit comments

Comments
 (0)