Skip to content

ci: seed changelog entry on regen version bump#51

Merged
zfarrell merged 2 commits into
mainfrom
ci/regen-seed-changelog
Jun 10, 2026
Merged

ci: seed changelog entry on regen version bump#51
zfarrell merged 2 commits into
mainfrom
ci/regen-seed-changelog

Conversation

@zfarrell

Copy link
Copy Markdown
Contributor

Regeneration bumps the patch version but never added a CHANGELOG entry, so check-release (which requires a ## [x.y.z] section matching the bump) failed on every regen PR — e.g. #50 had to be fixed by hand. Adds a step that seeds a stub entry (the spec-change title under ### Changed) after ## [Unreleased] right after the version bump. Idempotent, and the PR author refines the wording before merge.

Comment thread .github/workflows/regenerate.yml Outdated
raise SystemExit("CHANGELOG.md has no '## [Unreleased]' section to anchor the new entry")
insert_at = idx + len(marker)
entry = f"## [{version}] - {date}\n\n### Changed\n\n- {title}\n"
text = text[:insert_at] + "\n" + entry + "\n" + text[insert_at:].lstrip("\n")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super nit: the new section is inserted immediately after the ## [Unreleased] header, so any pre-existing entries under ## [Unreleased] would end up rendered below the new version header and get misattributed to it. Harmless today since [Unreleased] is kept empty between releases, but if someone ever adds a manual entry there, the next regen would orphan it. Anchoring the insert before the first ^## \[ version section instead would be robust to that. (not blocking)

claude[bot]
claude Bot previously approved these changes Jun 10, 2026

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified the seeded ## [version] header satisfies check-release.py, the insert is idempotent and shell-injection-safe (title via env), and create-pull-request commits CHANGELOG.md by default. One non-blocking super nit inline.

@zfarrell

Copy link
Copy Markdown
Contributor Author

Good catch — addressed in eadeb42. The insert now anchors before the first released ## [x.y.z] section instead of immediately after ## [Unreleased], so any pending entries under [Unreleased] stay attributed to it. Verified both the empty-[Unreleased] case (output unchanged) and the case where [Unreleased] has a manual entry (it's preserved above the new version).

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified the seeded ## [x.y.z] format matches check-release.py's required section regex, insertion anchors before the first released section (preserving [Unreleased] entries), idempotency check is correct, and TITLE/VERSION are passed safely via env. LGTM.

@zfarrell zfarrell merged commit b67403c into main Jun 10, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant