fix(release): remove top-level after: hook (unblocks goreleaser v2)#57
Merged
fix(release): remove top-level after: hook (unblocks goreleaser v2)#57
Conversation
PR #41 added a top-level `after:` hook to .goreleaser.yaml. goreleaser v2 has no top-level `after:` field — only `before:` exists. The release workflow for v0.9.0 (run 25274816649) failed instantly with `yaml: unmarshal errors: line 12: field after not found in type config.Project`. The previous `mv plugin.json.orig plugin.json` was theatre anyway: the GH Actions runner is ephemeral, so the in-place sed mutations to plugin.json are discarded when the runner shuts down. No need to restore plugin.json on the runner. Removed the matching `cp plugin.json plugin.json.orig` from the before block as well — it was preserving state nothing else reads. Validated with goreleaser/goreleaser:v2.15.4 check. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR unblocks the release pipeline by updating the GoReleaser configuration to be compatible with GoReleaser v2, removing an invalid top-level after: hook that caused release workflow failure.
Changes:
- Removed the unsupported top-level
after:hook from.goreleaser.yaml. - Removed the corresponding
cp plugin.json plugin.json.origstep frombefore.hooks. - Added an explanatory comment documenting why the
after:hook was removed.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+14
to
+19
| # config.Project`. The previous `mv plugin.json.orig plugin.json` was | ||
| # theatre — the GH Actions runner is ephemeral, so the in-place sed | ||
| # mutations to plugin.json are discarded the moment the runner shuts | ||
| # down. There is no need to restore plugin.json on the runner. Removed | ||
| # the matching `cp plugin.json plugin.json.orig` from the before block | ||
| # too — it was preserving state nothing else reads. |
Comment on lines
+12
to
+19
| # v2 has no top-level `after:` hook — it failed v0.9.0's release at | ||
| # `yaml: unmarshal errors: line 12: field after not found in type | ||
| # config.Project`. The previous `mv plugin.json.orig plugin.json` was | ||
| # theatre — the GH Actions runner is ephemeral, so the in-place sed | ||
| # mutations to plugin.json are discarded the moment the runner shuts | ||
| # down. There is no need to restore plugin.json on the runner. Removed | ||
| # the matching `cp plugin.json plugin.json.orig` from the before block | ||
| # too — it was preserving state nothing else reads. |
intel352
added a commit
that referenced
this pull request
May 3, 2026
… URL colons) (#58) * fix(release): wrap before.hooks in sh -c for shell builtins/operators goreleaser v2 exec's each hook string via shlex.Split rather than passing it to a shell, so shell builtins (export), operators (&&, ;), and command substitution ($(...)) only work when wrapped in `sh -c "<...>"`. The wfctl strict-contracts hook used `export` and failed v0.9.0's release-r2 (run 25274980854) with `exec: "export": executable file not found in $PATH`. The two sed hooks above only worked accidentally: goreleaser passed everything past the first whitespace as positional args to `sed`, which silently absorbs `&&` and `rm` as positional args. The mutations to plugin.json may not actually have been happening as intended in releases — wrapping all three in `sh -c` makes the behaviour match the apparent intent. Pair with #57 — both unblock the v0.9.0 release pipeline. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(release): YAML-quote sh -c hooks (URL colons confuse YAML mapping) The prior commit's `sh -c "..."` form was a plain (non-quoted) YAML scalar, so the embedded `:` inside URLs (e.g. https://...) was parsed as YAML mapping syntax. yaml errored: `mapping values are not allowed in this context`. Wrap each hook in YAML double-quotes with proper backslash-escaping of the inner shell double-quotes. Validated locally with `goreleaser/goreleaser:v2.15.4 check`. --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR #41 added a top-level
after:hook to.goreleaser.yaml. goreleaser v2 has no top-levelafter:field — onlybefore:exists. The v0.9.0 release workflow (run 25274816649) failed instantly with:Removed the
after:block. Themv plugin.json.orig plugin.jsonit ran was theatre: the GH Actions runner is ephemeral, so the in-place sed mutations to plugin.json are discarded when the runner shuts down. There's nothing on the runner to restore. Also removed the matchingcp plugin.json plugin.json.origfrombefore:— it was preserving state nothing else reads.Verification
Config is valid (the deprecation is non-blocking + pre-existing).
After merge
The v0.9.0 tag will need to be force-moved to the new fix-included commit so the release workflow re-runs. The tag has existed for ~5 minutes with no successful release artifacts (the goreleaser failure is what we're fixing), so no consumers have pulled it.
Test plan
🤖 Generated with Claude Code