Skip to content

Commit e66b285

Browse files
committed
fix(snippets): strip tag prefix for goreleaser
GoReleaser OSS rejects prefixed tags like `snippets/v0.1.0`; the `monorepo.tag_prefix` knob that would parse them is Pro-only. Compute a plain-semver SEMVER_TAG before invoking goreleaser-action and keep TAG_NAME (with prefix) for the `gh release` upload/publish calls — the GitHub release object itself is still keyed by the prefixed tag.
1 parent 1c5f00a commit e66b285

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

.github/workflows/release-please.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,14 @@ jobs:
128128

129129
- uses: sigstore/cosign-installer@d7d6bc7722e3daa8354c50bcb52f4837da5e9b6a # v3.7.0
130130

131+
# GoReleaser OSS requires GORELEASER_CURRENT_TAG to be a plain semver
132+
# string; the monorepo `tag_prefix` knob that would let it parse
133+
# `snippets/v0.1.0` is Pro-only. Strip the prefix here. We keep
134+
# TAG_NAME (full prefixed form) for `gh release` calls below — the
135+
# GitHub release object still uses the prefixed tag.
136+
- name: Compute semver tag for goreleaser
137+
run: echo "SEMVER_TAG=${TAG_NAME#snippets/}" >> "$GITHUB_ENV"
138+
131139
# goreleaser builds binaries + cosign-signs them into ./dist. It does
132140
# NOT touch GitHub releases (release.disable: true in the goreleaser
133141
# config).
@@ -139,7 +147,7 @@ jobs:
139147
args: release --clean
140148
env:
141149
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
142-
GORELEASER_CURRENT_TAG: ${{ env.TAG_NAME }}
150+
GORELEASER_CURRENT_TAG: ${{ env.SEMVER_TAG }}
143151

144152
- name: Upload artifacts to draft release
145153
env:

0 commit comments

Comments
 (0)