Skip to content

fix(ci): drop fetch-tags on checkout — breaks workflow_dispatch on a tag#61

Merged
DipandaAser merged 1 commit into
mainfrom
fix/docker-checkout-tag-conflict
May 12, 2026
Merged

fix(ci): drop fetch-tags on checkout — breaks workflow_dispatch on a tag#61
DipandaAser merged 1 commit into
mainfrom
fix/docker-checkout-tag-conflict

Conversation

@DipandaAser

@DipandaAser DipandaAser commented May 12, 2026

Copy link
Copy Markdown
Owner

actions/checkout@v4 with fetch-tags: true triggered via workflow_dispatch --ref v0.2.0 fails the initial git fetch:

fatal: Cannot fetch both a7f7ad1... 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.

After this merges

To rebuild the missing v0.2.0 images, force-move the tag to the new main commit (which contains this fix):

git fetch origin main
git tag -f v0.2.0 origin/main
git push -f origin v0.2.0

That force-push (from a real git client, not GITHUB_TOKEN) triggers the Docker workflow against the fixed docker.yml and builds :0.2.0, :0.2, :0, :latest correctly. The npm publish for v0.2.0 already happened on a7f7ad1, so this is only catching up the Docker artifacts — npm isn't affected by the tag move.

`actions/checkout@v4` with `fetch-tags: true` triggered via
`workflow_dispatch --ref v0.2.0` fails the initial git fetch with
"Cannot fetch both <sha> 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.
@DipandaAser DipandaAser merged commit 846cd3e into main May 12, 2026
1 check passed
@DipandaAser DipandaAser deleted the fix/docker-checkout-tag-conflict branch May 12, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant