Skip to content

fix(ops-release): stop prepending an empty "### Changed" to --notes - #950

Merged
Aurora Capital (auroracapital) merged 4 commits into
mainfrom
fix/ops-release-changelog-heading
Sep 9, 2026
Merged

fix(ops-release): stop prepending an empty "### Changed" to --notes#950
Aurora Capital (auroracapital) merged 4 commits into
mainfrom
fix/ops-release-changelog-heading

Conversation

@auroracapital

Copy link
Copy Markdown
Collaborator

Wat er stuk was

ops-release --notes "$BODY" prepended ### Changed to the CHANGELOG section unconditionally. Notes written by hand usually carry their own heading, so v3.10.10 was cut with:

## [3.10.10] - 2026-09-09

### Changed
### Fixed
- …

The GitHub release workflow awk-parses that section verbatim, so the published release notes opened with an empty ### Changed. It had to be patched on the release branch by hand before the merge.

De fix

claude-ops/bin/ops-release now checks whether the body already starts a ### Added|Changed|Fixed|Removed section and only adds the heading when it does not. This mirrors the test the AI path already applies to its own output one branch above. Written as an if block rather than cmd && var=1 because the script runs under set -euo pipefail.

Test

claude-ops/tests/test-ops-release-changelog-heading.sh lifts the heading block straight out of bin/ops-release with awk and evaluates it, so the test cannot drift away from the shipped code. Five cases: own ### Fixed untouched, own ### Added untouched, bare bullets still get a heading, the AI path unchanged, version header first.

Verified both ways:

  • against this branch — 8 passed, 0 failed
  • against v3.10.10 — fails at "heading guard block not found", exit 1

Registered in tests/run-all.sh.

🤖 Generated with Claude Code

Notes passed with --notes often already carry their own "### Fixed" or
"### Added" heading. The old code added "### Changed" unconditionally on
that path, so the generated GitHub release notes opened with an empty
section. Only add the heading when the body has none.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Lifts the heading block out of bin/ops-release and exercises it directly,
so the test cannot drift away from the shipped code.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@auroracapital
Aurora Capital (auroracapital) merged commit 5aa04c9 into main Sep 9, 2026
12 checks passed
@auroracapital
Aurora Capital (auroracapital) deleted the fix/ops-release-changelog-heading branch September 9, 2026 13:14
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