Skip to content

Ignore snapshot-* tags in GoReleaser git state - #26

Merged
rethab merged 1 commit into
mainfrom
fix/goreleaser-ignore-snapshot-tags
Jul 12, 2026
Merged

Ignore snapshot-* tags in GoReleaser git state#26
rethab merged 1 commit into
mainfrom
fix/goreleaser-ignore-snapshot-tags

Conversation

@rethab

@rethab rethab commented Jul 12, 2026

Copy link
Copy Markdown
Owner

The Snapshot workflow publishes a GitHub release tagged snapshot-<version> on every push to main, which creates a real git tag. That tag isn't valid semver, so on the next run GoReleaser picks it up as the current tag via git describe, fails to parse it, and incpatch in the snapshot version_template blows up with invalid semantic version.

The very first snapshot run worked fine (no tags existed yet, so GoReleaser defaulted to 0.0.0), but it permanently poisoned every run after it — every Snapshot workflow run since has failed, while the regular Build/CI workflow is unaffected.

Fix: add git.ignore_tags: ["snapshot-*"] to .goreleaser.yml so GoReleaser never considers its own snapshot release tags when computing the current/previous version. Verified locally with goreleaser release --snapshot --clean (v2.17.0, matching the pinned CI version) — it now correctly falls back to v0.0.0 and builds successfully.

The Snapshot workflow publishes releases tagged snapshot-<version>,
creating a real git tag. That tag isn't valid semver, so on the next
run GoReleaser picks it up as the current tag, fails to parse it, and
incpatch in the snapshot version_template blows up. The first ever
snapshot run worked (no tags existed yet) but poisoned every run since.
@rethab
rethab merged commit fd1fe9c into main Jul 12, 2026
1 check passed
@rethab
rethab deleted the fix/goreleaser-ignore-snapshot-tags branch July 12, 2026 06:34
rethab added a commit that referenced this pull request Aug 5, 2026
The Snapshot workflow publishes a GitHub release tagged
`snapshot-<version>` on every push to main, which creates a real git
tag. That tag isn't valid semver, so on the next run GoReleaser picks it
up as the current tag via `git describe`, fails to parse it, and
`incpatch` in the snapshot `version_template` blows up with `invalid
semantic version`.

The very first snapshot run worked fine (no tags existed yet, so
GoReleaser defaulted to `0.0.0`), but it permanently poisoned every run
after it — every Snapshot workflow run since has failed, while the
regular Build/CI workflow is unaffected.

Fix: add `git.ignore_tags: ["snapshot-*"]` to `.goreleaser.yml` so
GoReleaser never considers its own snapshot release tags when computing
the current/previous version. Verified locally with `goreleaser release
--snapshot --clean` (v2.17.0, matching the pinned CI version) — it now
correctly falls back to `v0.0.0` and builds successfully.
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