ci(release): fail the release job when the changelog is empty - #241
Conversation
v0.14.0b2 was published with an empty body: `body_path` was commented out, so nothing generated release_notes.md and the release went out blank. ActivityWatch#238 wired up the generator; this makes the failure loud if it ever regresses, instead of shipping a release with no changelog. Part of ActivityWatch#236.
Greptile SummaryThis PR prevents a GitHub release from being created when generated release notes are missing or zero-length.
Confidence Score: 5/5The PR appears safe to merge, with the new guard preventing zero-length release notes from reaching the publication step. The check runs directly after changelog generation and exits the job before the release action when the generated file is absent or empty, without altering the successful release path. Important Files Changed
Reviews (1): Last reviewed commit: "ci(release): fail the release job when t..." | Re-trigger Greptile |
|
CI-green and mergeable (Greptile 5/5) — waiting only on a maintainer click. This PR is ready to merge, but the bot has pull-only access to this repo and can't self-merge — surfacing it here so it isn't lost. The monitoring loop will stop re-flagging it now that this note is posted. |
Follow-up to #238, covering the "don't ship a release with no changelog" half of @ErikBjare's question on #236.
What actually went wrong with v0.14.0b2
It was not stuck in draft —
gh release view v0.14.0b2 --json isDraft,bodyreportsisDraft: false,body: "". It was published, with a blank body, becausebody_pathwas commented out and nothing generatedrelease_notes.md. #238 fixed the generation; nothing yet fails when generation silently produces nothing.Fix
Assert
release_notes.mdis non-empty beforesoftprops/action-gh-releaseruns. A blank changelog now fails the release job with a GitHub error annotation instead of shipping.Deliberately at the generation site rather than as a post-release check: here the failure is still recoverable by re-running the workflow, whereas an empty published release body is effectively permanent.
Note on the
draft:change discussed in #236This PR doesn't touch
draft:— the two are orthogonal, and drafts weren't what caused the b2 problem. But one gotcha for whoever implements the prerelease-linked version suggested in the issue thread: theis_prerelease/is_stableoutput can't be used directly in this repo.The
release-ghjob's step id isversion, notcheck_version, and there's an existing comment at line 503 explaining why its output is untrustworthy here:The job already works around this by computing stability itself with a regex, and
prerelease:on line 540 usessteps.version.outputs.is_stable— which by that comment's own logic is wrong for everyv0.14.0-style stable release. So adraft:change probably wants to reuse the locally-computedIS_STABLE(promoted to a step output), and it's worth checking whetherprerelease:has the same latent bug.