ci: publish contributor credits in GitHub release notes (#1787)

release-please stores the release notes in the Release PR body when it opens
that PR, and builds the GitHub Release from that stored body at merge time.
The contributor credit step runs afterwards and only rewrites CHANGELOG.md on
the branch, so credits reached the changelog but never the published notes.
Everything that reads release bodies, including the releases page and the
website changelog, showed uncredited text.

Add a step that re-publishes the notes from CHANGELOG.md after a release is
created. The two are otherwise byte-identical, so the edit is a no-op when
there is nothing to credit.

It runs before the credit step on purpose: a single run can both publish a
release and open the next Release PR, and the credit step checks out that new
branch, which would leave the wrong CHANGELOG.md in the working tree.
This commit is contained in:
Anso
2026-08-06 21:27:39 -04:00
committed by GitHub
parent 55392d412e
commit da94599411
4 changed files with 256 additions and 2 deletions
+6 -2
View File
@@ -246,7 +246,11 @@ jobs:
args: .github/workflows/release-please.yml .github/workflows/ci.yml
- name: Syntax check
run: node --check scripts/credit-changelog-contributors.mjs
run: |
node --check scripts/credit-changelog-contributors.mjs
node --check scripts/release-notes-from-changelog.mjs
- name: Unit tests
run: node --test scripts/credit-changelog-contributors.test.mjs
run: |
node --test scripts/credit-changelog-contributors.test.mjs
node --test scripts/release-notes-from-changelog.test.mjs
+15
View File
@@ -58,6 +58,21 @@ jobs:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
# release-please stores the release notes in the release PR body when it
# opens that PR, and builds the GitHub Release from that stored body at
# merge time. The credit step below runs afterwards and only rewrites
# CHANGELOG.md on the branch, so credits never reach the published notes.
# Re-publish them from CHANGELOG.md, which by now carries the credits.
# Runs before the credit step, which checks out the next release branch
# and would otherwise leave the wrong CHANGELOG.md in the working tree.
- name: Sync published release notes with credited changelog
if: ${{ steps.release.outputs.releases_created == 'true' }}
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
TAG="$(node scripts/release-notes-from-changelog.mjs "$RUNNER_TEMP/release-notes.md")"
gh release edit "$TAG" --notes-file "$RUNNER_TEMP/release-notes.md"
- name: Credit external contributors in changelog
if: ${{ steps.release.outputs.prs_created == 'true' }}
env: