Skip to content

Commit 9d328bf

Browse files
committed
ci(release): replace fetch-tags with fetch-depth:0 in checkout
The push-tag trigger that fired for v0.0.2 failed with Cannot fetch both ef6dffd... and refs/tags/v0.0.2 to refs/tags/v0.0.2 — a known interaction in actions/checkout@v4 where `fetch-tags: true` combined with a tag ref tries to fetch the same ref twice. Switching to `fetch-depth: 0` gives the resolve-tag step the full history it needs without the duplicate-fetch conflict. (The release.yml flow itself is unchanged; this only fixes the runner side.)
1 parent ef6dffd commit 9d328bf

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,15 @@ jobs:
2727
# so we pin to a known path.
2828
MCPP_HOME: /home/runner/.mcpp
2929
steps:
30-
# fetch-tags so the resolve-tag step can detect existing tags
31-
# without an extra round-trip; full history isn't needed.
30+
# fetch-depth: 0 instead of fetch-tags: true — actions/checkout@v4
31+
# fails on push-tag triggers when both the ref'd tag and
32+
# `fetch-tags: true` are set:
33+
# "Cannot fetch both <sha> and refs/tags/vX.Y.Z to refs/tags/vX.Y.Z"
34+
# Full-history fetch covers the resolve-tag step's needs without
35+
# that contention.
3236
- uses: actions/checkout@v4
3337
with:
34-
fetch-tags: true
38+
fetch-depth: 0
3539

3640
- name: Resolve target tag + commit
3741
id: resolve

0 commit comments

Comments
 (0)