Skip to content

Commit 5b4e513

Browse files
ci: remove changelog rollover from release workflow (#97)
The changelog-rollover job committed a "roll [Unreleased] over to vX.Y.Z" change directly back to main after publishing. Branch protection rejects that push (required workflow not satisfied, changes must go through a PR, commits must be signed), so the job failed every release without adding value. Remove the job and its scripts/rollover-changelog.sh helper. Maintainers now rename `## [Unreleased]` to `## [X.Y.Z] — DATE` by hand in the version-bump PR. The version job's CHANGELOG check is simplified to require an explicit `## [X.Y.Z]` heading (it no longer accepts a non-empty [Unreleased] section as a stand-in for the post-publish stamp). Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 5c30c8c commit 5b4e513

2 files changed

Lines changed: 3 additions & 132 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 3 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -43,27 +43,14 @@ jobs:
4343
echo "::error::CHANGELOG.md does not exist at the repository root."
4444
exit 1
4545
fi
46-
# A release is valid two ways:
47-
# 1. An explicit `## [X.Y.Z]` / `## X.Y.Z` heading already exists
48-
# (notes written by hand), OR
49-
# 2. The `## [Unreleased]` section is non-empty — the
50-
# post-publish `changelog-rollover` job stamps it as
51-
# `## [X.Y.Z] — DATE` after publishing.
46+
# A release requires an explicit `## [X.Y.Z]` / `## X.Y.Z` heading
47+
# (notes written by hand in the version-bump PR).
5248
if grep -qE "^## \[?${VERSION}\]?( |$)" CHANGELOG.md; then
5349
echo "Found explicit CHANGELOG heading for ${VERSION}."
5450
exit 0
5551
fi
56-
unreleased_content=$(awk '
57-
/^## \[Unreleased\]/ { inblock=1; next }
58-
inblock && /^## / { inblock=0 }
59-
inblock && NF { print }
60-
' CHANGELOG.md)
61-
if [ -n "$unreleased_content" ]; then
62-
echo "No explicit ${VERSION} heading, but [Unreleased] has content — it will be rolled over after publish."
63-
exit 0
64-
fi
6552
echo "::error::CHANGELOG.md has no release notes for ${VERSION}."
66-
echo "::error::Add entries under \`## [Unreleased]\` (preferred — they roll over automatically), or a \`## [${VERSION}] — $(date +%Y-%m-%d)\` heading, before re-running."
53+
echo "::error::Add a \`## [${VERSION}] — $(date +%Y-%m-%d)\` heading with release notes before re-running."
6754
exit 1
6855
6956
build:
@@ -443,46 +430,3 @@ jobs:
443430
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
444431
with:
445432
packages-dir: dist/
446-
447-
# After every artifact has published, stamp the CHANGELOG: promote the
448-
# `## [Unreleased]` section to `## [<version>] — <date>` and leave a fresh
449-
# empty `[Unreleased]` for the next cycle, then commit it back to the
450-
# release branch. Idempotent — a no-op when a `## [<version>]` heading was
451-
# written by hand. Runs last so a failed publish never rewrites history.
452-
changelog-rollover:
453-
needs: [version, github-release, cargo-publish, npm-publish, pypi-publish]
454-
if: ${{ !inputs.dry-run }}
455-
runs-on: ubuntu-latest
456-
permissions:
457-
contents: write
458-
steps:
459-
- name: Checkout release branch
460-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
461-
with:
462-
ref: ${{ github.ref_name }}
463-
# persist-credentials defaults to true so the rollover commit can
464-
# be pushed back to the branch below.
465-
466-
- name: Roll [Unreleased] over to the released version
467-
env:
468-
VERSION: ${{ needs.version.outputs.version }}
469-
run: bash scripts/rollover-changelog.sh "$VERSION"
470-
471-
- name: Commit and push if changed
472-
# Pass workflow contexts through env vars (never interpolate
473-
# `${{ }}` directly into the shell) so a branch name can't inject
474-
# code into this run block — see zizmor's template-injection audit.
475-
env:
476-
VERSION: ${{ needs.version.outputs.version }}
477-
REF_NAME: ${{ github.ref_name }}
478-
run: |
479-
if git diff --quiet -- CHANGELOG.md; then
480-
echo "CHANGELOG.md unchanged (heading already present); nothing to commit."
481-
exit 0
482-
fi
483-
git config user.name "github-actions[bot]"
484-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
485-
git add CHANGELOG.md
486-
# [skip ci] so this housekeeping commit doesn't retrigger CI.
487-
git commit -m "chore(changelog): roll [Unreleased] over to v${VERSION} [skip ci]"
488-
git push origin "HEAD:${REF_NAME}"

‎scripts/rollover-changelog.sh‎

Lines changed: 0 additions & 73 deletions
This file was deleted.

0 commit comments

Comments
 (0)