Skip to content

Commit 60f7124

Browse files
committed
Improve release notes detection
1 parent cbb1256 commit 60f7124

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

NuGetReleaseTool/NuGetReleaseTool/ValidateReleaseCommand/ValidateReleaseCommand.cs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,16 @@ private static void WriteResultLine(string section, (Status, string) result)
155155
var releaseNotesGHUrl = $"https://github.com/NuGet/docs.microsoft.com-nuget/blob/main/docs/release-notes/NuGet-{Options.Release}.md";
156156
if (await UrlExistsAsync(HttpClient, releaseNotesUrl))
157157
{
158-
return (Status.Completed, releaseNotesUrl);
158+
string content = await GetContentAsync(HttpClient, releaseNotesUrl);
159+
160+
if (content.Contains("Not yet released"))
161+
{
162+
return (Status.InProgress, $"A draft version of the notes is published, but it is missing content. {releaseNotesGHUrl}");
163+
}
164+
else
165+
{
166+
return (Status.Completed, releaseNotesUrl);
167+
}
159168
}
160169
else if (await UrlExistsAsync(HttpClient, releaseNotesGHUrl))
161170
{
@@ -195,5 +204,15 @@ private static async Task<bool> UrlExistsAsync(HttpClient httpClient, string url
195204
catch (Exception) { }
196205
return false;
197206
}
207+
208+
private static async Task<string> GetContentAsync(HttpClient httpClient, string url)
209+
{
210+
try
211+
{
212+
return await httpClient.GetStringAsync(url);
213+
}
214+
catch (Exception) { }
215+
return null;
216+
}
198217
}
199218
}

0 commit comments

Comments
 (0)