@@ -95,28 +95,36 @@ jobs:
9595 fi
9696 echo "codeanalyzer JAR present in wheel and sdist ✓"
9797
98- - name : Read Changelog Entry
99- id : changelog_reader
100- uses : mindsers/changelog-reader-action@v2
101- with :
102- validation_level : warn
103- version : ${{ steps.tag_name.outputs.current_version }}
104- path : ./CHANGELOG.md
105-
106- - name : Build Changelog
107- id : gen_changelog
108- uses : mikepenz/release-changelog-builder-action@v5
109- with :
110- failOnError : " true"
111- configuration : .github/workflows/release_config.json
112- env :
113- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
98+ - name : Extract release notes from CHANGELOG.md
99+ id : notes
100+ # Source the release body from the hand-written CHANGELOG.md section for this tag —
101+ # deterministic and independent of PR labels — and refuse to publish/announce a blank
102+ # body. The previous label-based changelog scraper emitted nothing for unlabeled PRs,
103+ # which blanked the release and crashed the org announcement. See issue #289.
104+ run : |
105+ set -euo pipefail
106+ version="${GITHUB_REF#refs/tags/}" # e.g. v1.4.4 — matches the "## [v1.4.4]" heading
107+ notes=$(awk -v h="## [$version]" '
108+ !seen && index($0, h) == 1 { seen = 1; next }
109+ seen && index($0, "## [") == 1 { exit }
110+ seen { print }
111+ ' CHANGELOG.md | sed '/./,$!d' | tac | sed '/./,$!d' | tac) # strip blank edges
112+ if [ -z "$notes" ]; then
113+ echo "::error::No CHANGELOG.md entry for $version — refusing to publish a blank release."
114+ exit 1
115+ fi
116+ {
117+ echo "notes<<__CHANGELOG_EOF__"
118+ echo "$notes"
119+ echo "__CHANGELOG_EOF__"
120+ } >> "$GITHUB_OUTPUT"
121+ echo "Release notes for $version:"; echo "$notes"
114122
115123 - name : Publish Release on GitHub
116124 uses : softprops/action-gh-release@v2
117125 with :
118126 files : dist/*
119- body : ${{ steps.gen_changelog .outputs.changelog }}
127+ body : ${{ steps.notes .outputs.notes }}
120128 # Auto-open a repo-level Discussion linked to this release, seeded with
121129 # the same notes. Requires Discussions enabled and this category to exist.
122130 discussion_category_name : Announcements
@@ -126,13 +134,13 @@ jobs:
126134 # Mirror the release announcement into the ORG-level discussions, which are
127135 # backed by codellm-devkit/.github. GITHUB_TOKEN can't write cross-repo, so
128136 # this uses a PAT (ORG_DISCUSSIONS_TOKEN) with repo scope, and posts via the
129- # createDiscussion GraphQL mutation. The body (the generated changelog ) is
137+ # createDiscussion GraphQL mutation. The body (the CHANGELOG.md notes ) is
130138 # passed via env to avoid shell-injection, matching the repo-level post.
131139 - name : Announce in org-level discussions (codellm-devkit/.github)
132140 continue-on-error : true # a failed org post must not fail an otherwise-good release
133141 env :
134142 GH_TOKEN : ${{ secrets.ORG_DISCUSSIONS_TOKEN }}
135- BODY : ${{ steps.gen_changelog .outputs.changelog }}
143+ BODY : ${{ steps.notes .outputs.notes }}
136144 run : |
137145 set -uo pipefail
138146 VERSION="${GITHUB_REF#refs/tags/v}"
0 commit comments