From aa8d4e9c6da5eabcaf11e342526e59ad622eff67 Mon Sep 17 00:00:00 2001 From: Adeel Ahmad Date: Fri, 9 Oct 2026 11:52:28 +0000 Subject: [PATCH] fix(release): cut release notes that are over GitHub's 125,000 character limit The first release's notes (all of Unreleased since the start) were 132,954 characters, so publishing v0.4.0 failed. Keep whole entries up to 120,000 and link to CHANGELOG.md at the tag for the rest. The trimming lives in the workflow because the publish job runs release.py as it was at the tag. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01291QUFHs51wLhGQwp2DAh9 --- .github/workflows/release.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b3b06b7c1..0b43b7d1a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -111,6 +111,21 @@ jobs: run: | python3 .github/scripts/release.py notes "$TAG" > notes.md if [ -s notes.md ] && grep -q '[^[:space:]]' notes.md; then + # GitHub refuses notes over 125,000 characters: keep whole entries up to that and link the rest. This + # lives here, not in release.py, because this job runs the script as it was at the tag. + python3 - <<'EOF' + import os + from pathlib import Path + + notes = Path("notes.md") + text = notes.read_text() + limit = 120_000 + if len(text) > limit: + end = text.rfind("\n- ", 0, limit) + link = f"https://github.com/{os.environ['GH_REPO']}/blob/{os.environ['TAG']}/CHANGELOG.md" + notes.write_text(f"{text[: end if end > 0 else limit].rstrip()}\n\nThe rest is in [CHANGELOG.md]({link}).\n") + print(f"::notice::The notes were cut to fit; the rest is in {link}") + EOF echo "NOTES=--notes-file=notes.md" >> "$GITHUB_ENV" else echo "::warning::CHANGELOG.md has no ${TAG#v} section; the notes list the merged pull requests instead"