From 2a5a5ade148cfa18ac733373c9fd49b9a2ccda29 Mon Sep 17 00:00:00 2001 From: Julian Blacher Date: Sat, 24 Oct 2026 16:56:51 -0300 Subject: [PATCH] Fix empty release notes and fail the release when notes are missing GoReleaser reads --release-notes in its changelog pipe, so disabling the changelog also dropped the notes: v0.1.0 was created with an empty body. Enable the pipe (given a notes file it does not generate a Git log), and check the published release has notes, since CI snapshot builds skip this pipe and could not catch it. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/release.yml | 11 +++++++++++ .goreleaser.yaml | 9 ++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a19e904..939e63d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,3 +38,14 @@ jobs: args: release --clean --release-notes ${{ runner.temp }}/release-notes.md env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # Snapshot builds in CI skip the release notes, so check the real release. + - name: Check the release has notes + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + body="$(gh release view "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --json body --jq .body)" + if [ -z "$(printf '%s' "$body" | tr -d '[:space:]')" ]; then + echo "::error::release $GITHUB_REF_NAME has empty notes" + exit 1 + fi diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 5bc223f..f59b4f0 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -49,10 +49,13 @@ checksum: snapshot: version_template: "{{ incpatch .Version }}-next" -# Release notes come from CHANGELOG.md (scripts/release-notes.sh), so the -# changelog stays the single place where changes are described. +# Release notes come from CHANGELOG.md (scripts/release-notes.sh, passed with +# --release-notes), so the changelog stays the single place where changes are +# described. The changelog pipe must stay enabled: it is the pipe that reads +# --release-notes, and disabling it publishes a release with empty notes. Given +# a notes file, it does not generate a changelog from the Git history. changelog: - disable: true + disable: false release: github: