From 9d328bfa612e27eab58a06f3435a2c9cf94b4763 Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Sat, 9 May 2026 05:14:56 +0800 Subject: [PATCH] ci(release): replace fetch-tags with fetch-depth:0 in checkout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The push-tag trigger that fired for v0.0.2 failed with Cannot fetch both ef6dffd0a... 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.) --- .github/workflows/release.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ceedc33..b8e1ab5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,11 +27,15 @@ jobs: # so we pin to a known path. MCPP_HOME: /home/runner/.mcpp steps: - # fetch-tags so the resolve-tag step can detect existing tags - # without an extra round-trip; full history isn't needed. + # fetch-depth: 0 instead of fetch-tags: true — actions/checkout@v4 + # fails on push-tag triggers when both the ref'd tag and + # `fetch-tags: true` are set: + # "Cannot fetch both and refs/tags/vX.Y.Z to refs/tags/vX.Y.Z" + # Full-history fetch covers the resolve-tag step's needs without + # that contention. - uses: actions/checkout@v4 with: - fetch-tags: true + fetch-depth: 0 - name: Resolve target tag + commit id: resolve