Compose release body locally and set via gh release edit#19
Merged
foadshafighi merged 1 commit intomainfrom Apr 27, 2026
Merged
Compose release body locally and set via gh release edit#19foadshafighi merged 1 commit intomainfrom
foadshafighi merged 1 commit intomainfrom
Conversation
Codex Automated Code ReviewCode Review SummaryPR: Updates release workflow to compose GitHub Release body from P0 - Critical Issues (Must Fix)None found. P1 - High Priority Issues (Should Fix)
P2 - Medium Priority Issues (Consider Fixing)
P3 - Low Priority Issues (Optional)None found. Positive Observations
Automated review by OpenAI Codex |
Comment on lines
+92
to
95
| if [ "$(wc -l < /tmp/release-body.md)" -lt 7 ]; then | ||
| echo "::error::Composed release body for ${TAG} is suspiciously short — CHANGELOG section may be empty." | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
wc -l threshold may block valid single-entry releases
The header contributes exactly 5 lines, so the check requires awk to emit at least 2 lines of CHANGELOG content. A section with a single bullet (e.g. - Patch typo.) produces only 6 lines total and would fail this guard even though the extraction worked correctly. Lowering the threshold to 6 (i.e., "header + at least 1 CHANGELOG line") keeps the safety net while allowing minimal-but-valid sections.
Suggested change
| if [ "$(wc -l < /tmp/release-body.md)" -lt 7 ]; then | |
| echo "::error::Composed release body for ${TAG} is suspiciously short — CHANGELOG section may be empty." | |
| exit 1 | |
| fi | |
| if [ "$(wc -l < /tmp/release-body.md)" -lt 6 ]; then |
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/release.yml
Line: 92-95
Comment:
**`wc -l` threshold may block valid single-entry releases**
The header contributes exactly 5 lines, so the check requires awk to emit at least 2 lines of CHANGELOG content. A section with a single bullet (e.g. `- Patch typo.`) produces only 6 lines total and would fail this guard even though the extraction worked correctly. Lowering the threshold to `6` (i.e., "header + at least 1 CHANGELOG line") keeps the safety net while allowing minimal-but-valid sections.
```suggestion
if [ "$(wc -l < /tmp/release-body.md)" -lt 6 ]; then
```
How can I resolve this? If you propose a fix, please make it concise.
4 tasks
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
Second iteration of the release-pipeline smoke test fix. The first fix (PR #18) solved goreleaser's "dirty git state" rejection by writing release notes to
/tmp. The release published successfully but with only the goreleaser header in the body — the CHANGELOG content from--release-notes /tmp/release-notes.mdwas silently dropped, likely because ofchangelog: disable: truein the goreleaser config.This PR takes ownership of the release body explicitly:
/tmp/release-body.md.--release-notesfrom goreleaser args since we override anyway.gh release edit ... --notes-file /tmp/release-body.mdafter goreleaser publishes, replacing whatever body goreleaser produced with our composed content.This pattern is robust regardless of goreleaser internals. It also bounds the dependency on goreleaser to "build and upload binaries"; the body presentation is now purely the workflow's responsibility.
What v0.5.1 looks like now
The v0.5.1 release body was patched manually with
gh release editimmediately after the smoke test. From v0.5.2 onward, this fix means the workflow does it automatically.Test plan
Callouts for reviewers
ulcCLI {{ .Tag }} / Download a single-file binary..." now appears in bothtools/validator/.goreleaser.yaml(the dead-code path goreleaser uses) and the workflow (the actual path). They must stay in sync. If you change one, change the other. Future cleanup: removerelease.headerfrom the goreleaser config since it's no longer rendered to users.wc -l < ... | -lt 7sanity check ensures the composed body has more than just the header — catches edge cases where the awk extraction fails silently.Greptile Summary
This PR takes ownership of the GitHub Release body by composing it directly in the workflow (header + awk-extracted CHANGELOG section written to
/tmp/release-body.md) and applying it withgh release edit --notes-fileafter goreleaser publishes, replacing whatever body goreleaser produced. The--release-notesflag is dropped from the goreleaser invocation since it was silently discarded anyway due tochangelog: disable: truein the goreleaser config.The approach is sound and the implementation is clean. One callout worth tracking:
release.headerintools/validator/.goreleaser.yamlis now dead code (goreleaser still writes it initially, butgh release editimmediately overwrites it); the PR description flags this for future cleanup.Confidence Score: 5/5
Safe to merge; no blocking issues — sole finding is a P2 threshold nit on the
wc -lguard.All findings are P2 or lower. The
wc -lthreshold of 7 could theoretically block a single-bullet CHANGELOG section, but given the project's section format this is extremely unlikely in practice and does not affect correctness of the release body. The overall approach (compose locally, apply viagh release edit) is robust and correct.No files require special attention, though
tools/validator/.goreleaser.yamlcarries a now-deadrelease.headerblock that can be removed in a follow-up.Important Files Changed
gh release edit; one minor concern with thewc -lthreshold that could silently block a valid very-short CHANGELOG section.Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "Compose release body locally and set via..." | Re-trigger Greptile