From 738041439acc9530865a8cfa5a39de40ef97edb2 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 15 Jun 2021 17:17:16 -0700 Subject: [PATCH] Sync eng/common directory with azure-sdk-tools for PR 1688 (#19272) * Add verification of changelog sections * Update eng/common/scripts/ChangeLog-Operations.ps1 Co-authored-by: Wes Haggard Co-authored-by: Chidozie Ononiwu Co-authored-by: Chidozie Ononiwu <31145988+chidozieononiwu@users.noreply.github.com> Co-authored-by: Wes Haggard --- eng/common/scripts/ChangeLog-Operations.ps1 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/eng/common/scripts/ChangeLog-Operations.ps1 b/eng/common/scripts/ChangeLog-Operations.ps1 index 96866ba8f210..6a161c1b4df9 100644 --- a/eng/common/scripts/ChangeLog-Operations.ps1 +++ b/eng/common/scripts/ChangeLog-Operations.ps1 @@ -175,6 +175,21 @@ function Confirm-ChangeLogEntry { LogError "Entry has no content. Please ensure to provide some content of what changed in this version." return $false } + + $emptySections = @() + foreach ($key in $changeLogEntry.Sections.Keys) + { + $sectionContent = $changeLogEntry.Sections[$key] + if ([System.String]::IsNullOrWhiteSpace(($sectionContent | Out-String))) + { + $emptySections += $key + } + } + if ($emptySections.Count -gt 0) + { + LogError "The changelog entry has the following sections with no content ($($emptySections -join ', ')). Please ensure to either remove the empty sections or add content to the section." + return $false + } } return $true }