From d63f84d3f7c5d439a8b3eb93cd93deacd0ee576c Mon Sep 17 00:00:00 2001 From: Imani Manyara Date: Mon, 5 Oct 2026 06:02:30 -0400 Subject: [PATCH] Take the GitHub release body from the CHANGELOG The release job published generated notes only. The family convention is a body from the tagged version's CHANGELOG section, with generated notes kept for the PR list; the job now fails if that section is missing. --- .github/workflows/release.yml | 24 ++++++++++++++++++++++++ CHANGELOG.md | 3 +++ 2 files changed, 27 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b8399a5..2210ad5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -123,14 +123,38 @@ jobs: needs: build runs-on: ubuntu-latest steps: + - uses: actions/checkout@v7 + with: + persist-credentials: false - uses: actions/download-artifact@v8 with: name: dist path: dist/ + # A release without a real description is incomplete, so the body comes from this + # version's CHANGELOG section; generated notes still add the PR and contributor list. + - name: Extract this version's CHANGELOG section + id: changelog + run: | + version="${GITHUB_REF_NAME#v}" + body=$(awk -v v="$version" ' + index($0, "## [" v "]") == 1 { found = 1; next } + found && /^## / { exit } + found { print } + ' CHANGELOG.md) + if [ -z "$body" ]; then + echo "::error::CHANGELOG.md has no section for $version" + exit 1 + fi + { + echo 'body<> "$GITHUB_OUTPUT" - name: Create release uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3 with: generate_release_notes: true + body: ${{ steps.changelog.outputs.body }} files: | dist/*.whl dist/*.tar.gz diff --git a/CHANGELOG.md b/CHANGELOG.md index dd43415..3b15f8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ### Changed +- The GitHub release body now comes from the tagged version's CHANGELOG section (generated notes + still add the PR list), and the release fails if that section is missing. + - CI runs on `pull_request` and `workflow_dispatch` only; the `push: branches: [main]` trigger is gone. A new `coverage-baseline.yml` refreshes the Codecov baseline for `main`