fix(tools): say "Maintenance release." in titled notes without listed changes

The fallback tested the builder's length, which the title line already made
non-zero, so release.yml (always --title) published notes that were only a
heading when a release held chore, ci, test or refactor commits alone. The
fallback now depends on whether a section or breaking entry was written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-12 10:28:55 +00:00
1 parent c11c996bc6
commit 81f10379c8
2 files changed
+38 -1

No files matched your search

@@ -60,11 +60,14 @@ internal sealed partial class ChangelogCommand : ICommand
var sb = new StringBuilder();
if (title is not null) sb.Append("# ").AppendLine(title).AppendLine();
// The title alone says nothing about the release: the fallback depends on the entries written, not on the text.
var written = false;
if (breaking.Count > 0)
{
sb.AppendLine("### Breaking changes");
foreach (var e in breaking) sb.AppendLine(e);
sb.AppendLine();
written = true;
}
foreach (var (type, heading) in Sections)
{
@@ -72,8 +75,9 @@ internal sealed partial class ChangelogCommand : ICommand
sb.Append("### ").AppendLine(heading);
foreach (var e in entries) sb.AppendLine(e);
sb.AppendLine();
written = true;
}
if (sb.Length == 0) sb.AppendLine("Maintenance release.");
if (!written) sb.AppendLine("Maintenance release.");
return sb.ToString();
}