diff --git a/source/Nuke.Common/ChangeLog/ChangeLogTasks.cs b/source/Nuke.Common/ChangeLog/ChangeLogTasks.cs index 145fbaa28..4200c9f1f 100644 --- a/source/Nuke.Common/ChangeLog/ChangeLogTasks.cs +++ b/source/Nuke.Common/ChangeLog/ChangeLogTasks.cs @@ -184,6 +184,9 @@ internal static IEnumerable GetReleaseSections(List cont { static bool IsReleaseHead(string str) => str.StartsWith("## "); + + static bool IsVersionSummary(string str) + => str.StartsWith("["); static string GetCaption(string str) => str @@ -206,7 +209,7 @@ static string GetCaption(string str) } var caption = GetCaption(line); - var nextReleaseHeadIndex = content.FindIndex(index + 1, IsReleaseHead); + var nextReleaseHeadIndex = content.FindIndex(index + 1, s => IsReleaseHead(s) || IsVersionSummary(s)); var releaseData = new ReleaseSection @@ -235,7 +238,6 @@ private static void UpdateVersionSummary(string tag, List content, [CanB content.RemoveRange(lastSection.EndIndex + 1, content.Count - lastSection.EndIndex - 1); - content.Add(string.Empty); content.Add($"[{firstSection.Caption}]: {repository.GetGitHubCompareTagToHeadUrl(tag)}"); for (var i = 1; i + 1 < sections.Count; i++) content.Add($"[{sections[i].Caption}]: {repository.GetGitHubCompareTagsUrl(sections[i].Caption, sections[i + 1].Caption)}");