From 882a3f29e204656b226e83efaf30d1589c53a0cc Mon Sep 17 00:00:00 2001 From: Sandro Figo Date: Thu, 5 Jan 2023 11:57:35 +0100 Subject: [PATCH] Remove empty lines from changelog before parsing --- source/Nuke.Common/ChangeLog/ChangeLogTasks.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/Nuke.Common/ChangeLog/ChangeLogTasks.cs b/source/Nuke.Common/ChangeLog/ChangeLogTasks.cs index 74f1ea69c..136ff5169 100644 --- a/source/Nuke.Common/ChangeLog/ChangeLogTasks.cs +++ b/source/Nuke.Common/ChangeLog/ChangeLogTasks.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.IO; using System.Linq; using JetBrains.Annotations; using NuGet.Versioning; @@ -46,7 +47,7 @@ public static string GetNuGetReleaseNotes(string changelogFile, GitRepository re [Pure] public static IReadOnlyList ReadReleaseNotes(string changelogFile) { - var lines = TextTasks.ReadAllLines(changelogFile).ToList(); + var lines = File.ReadAllLines(changelogFile).Where(x => !x.IsNullOrWhiteSpace()).ToList(); var releaseSections = GetReleaseSections(lines).ToList(); Assert.True(releaseSections.Any(), "Changelog should have at least one release note section");