Commit 6a5a811
fix(release): only GPG-sign when signing secrets are configured
Every Release workflow run since June has failed (8+ consecutive), and
releases have been cut manually as a workaround.
The `signs` block in .goreleaser.yml unconditionally GPG-signs
checksums.txt using `{{ .Env.GPG_FINGERPRINT }}`, but the GPG_PRIVATE_KEY
and GPG_FINGERPRINT repository secrets were never configured. An unset
secret expands to the empty string, so goreleaser ran `gpg --local-user ""`
and died with:
gpg: skipped "": Invalid user ID
gpg: signing failed: Invalid user ID
release failed message=could not sign artifact cmd=gpg artifact=checksums.txt
Everything before signing succeeded — all 12 binaries, archives, and the
deb/rpm/apk packages — so the release died immediately before publishing.
The asymmetry that caused this: release.yml guards the GPG *import* step
with `if: env.GPG_PRIVATE_KEY != ''`, but nothing guarded the *signing*.
goreleaser v2 has no config-level conditional on a `signs` entry: the
config.Sign struct exposes only id/cmd/args/signature/artifacts/ids/
stdin/stdin_file/env/certificate/output — no `skip` and no `if` (verified
against both v2.17.1, the version the action resolves, and main). Adding a
`skip:` key is a hard parse error:
yaml: unmarshal errors:
line 334: field skip not found in type config.Sign
`signs[].artifacts` is matched as a literal string in a switch rather than
rendered as a template, so it cannot be toggled from the config either.
goreleaser's own mechanism for this is the `--skip=sign` flag, so the guard
goes in the workflow: pass `--skip=sign` when GPG_FINGERPRINT is empty.
The signing block itself is preserved unchanged, with a comment explaining
why it is conditional and how to enable it.
Adding the GPG_PRIVATE_KEY and GPG_FINGERPRINT secrets re-enables real
signing with no further config change.
Verified with goreleaser v2.17.1 (the version goreleaser-action@v7 resolves):
`goreleaser check` reports "configuration is valid" with a deprecation set
byte-identical to main; a snapshot release with GPG_FINGERPRINT empty
succeeds; and with a dummy fingerprint signing is attempted (gpg reports
"No secret key" for the dummy ID rather than "Invalid user ID"), proving the
guard is conditional and not permanently off.
Note: skipping sign unmasks a second, independent pre-existing blocker in
the `brews` section ("one tap can handle only one archive of an OS/Arch
combination"), reproducible on unmodified main. That is out of scope here
and needs its own fix.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent d3bcc2a commit 6a5a811
2 files changed
Lines changed: 25 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
68 | 73 | | |
69 | 74 | | |
70 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
332 | 351 | | |
333 | 352 | | |
334 | 353 | | |
| |||
0 commit comments