Skip to content
Latchkey

GoReleaser "failed to fetch tags" (shallow clone) in CI

GoReleaser reads tags from the local clone to pick the current and previous version for the changelog. A shallow CI checkout omits tags, so GoReleaser either fails or uses a stale version.

What this error means

GoReleaser warns "couldn't find any tags before ..." or produces a wrong version and an empty changelog because tags were not fetched into the shallow clone.

Terminal
  • couldn't find any tags before "v1.4.0"
⨯ release failed after 1s
  error=failed to fetch tags: fatal: No names found, cannot describe anything.

Common causes

Shallow checkout without tags

The default fetch-depth: 1 clones only the tip commit and no tag objects, so GoReleaser cannot describe the version.

Tags exist on the remote but were not fetched

Even a deeper fetch may skip tags unless fetch-tags or fetch-depth: 0 is set.

How to fix it

Do a full fetch with tags

Set fetch-depth: 0 so actions/checkout brings the entire history and all tags GoReleaser needs.

.github/workflows/release.yml
- uses: actions/checkout@v4
  with:
    fetch-depth: 0

Fetch tags explicitly if you keep a shallow clone

When a full clone is too expensive, unshallow and fetch tags before running GoReleaser.

Terminal
git fetch --prune --unshallow --tags
goreleaser release --clean

How to prevent it

  • Standardize on fetch-depth: 0 for every release workflow.
  • Verify the changelog is populated as a sign tags were fetched.
  • Avoid shallow clones in jobs that call git describe semantics.

Frequently asked questions

What causes ""couldn't find any tags""?
The default fetch-depth: 1 clones only the tip commit and no tag objects, so GoReleaser cannot describe the version.
How do I fix "couldn't find any tags"?
Set fetch-depth: 0 so actions/checkout brings the entire history and all tags GoReleaser needs.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card