From 282668dbe802d906b0a2a5ea704844578dfd5746 Mon Sep 17 00:00:00 2001 From: Dipanda Aser Date: Tue, 12 May 2026 13:07:20 +0000 Subject: [PATCH] =?UTF-8?q?fix(ci):=20drop=20fetch-tags=20on=20checkout=20?= =?UTF-8?q?=E2=80=94=20breaks=20workflow=5Fdispatch=20on=20a=20tag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `actions/checkout@v4` with `fetch-tags: true` triggered via `workflow_dispatch --ref v0.2.0` fails the initial git fetch with "Cannot fetch both and refs/tags/v0.2.0 to refs/tags/v0.2.0" — git refuses to fetch the SHA and the tag pointing at it in the same refspec. The setting was added so the SPA build's `git tag --points-at HEAD` resolves on shallow checkouts, but when the workflow is triggered by a `v*` tag (push or dispatch), the tag is already the checked-out ref. Default checkout suffices. --- .github/workflows/docker.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 198bf55..3c25fa6 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -38,10 +38,12 @@ jobs: contents: read steps: + # Default checkout is enough — when the workflow is triggered by a + # `v*` tag (push or dispatch), the tag itself is fetched as the + # checked-out ref, so `git tag --points-at HEAD` resolves it. Adding + # `fetch-tags: true` makes a workflow_dispatch on the tag fail with + # "Cannot fetch both and refs/tags/v0.2.0 to refs/tags/v0.2.0". - uses: actions/checkout@v4 - with: - # SPA build reads `git tag --points-at HEAD` for the version badge. - fetch-tags: true - uses: docker/setup-qemu-action@v3