diff --git a/eng/common/scripts/ChangeLog-Operations.ps1 b/eng/common/scripts/ChangeLog-Operations.ps1 index 32851d115b86..f072cd48e2a8 100644 --- a/eng/common/scripts/ChangeLog-Operations.ps1 +++ b/eng/common/scripts/ChangeLog-Operations.ps1 @@ -56,22 +56,19 @@ function Get-ChangeLogEntriesFromContent { } else { if ($changeLogEntry) { - if ($line.Trim() -match "###\s(?.*)") + if ($line.Trim() -match "^###\s(?.*)") { - $sectionName = $matches["sectionName"] + $sectionName = $matches["sectionName"].Trim() $changeLogEntry.ReleaseContent += $line continue } - if (-not [System.String]::IsNullOrEmpty($line)) + switch ($sectionName) { - switch ($sectionName) - { - "Features Added" { $changeLogEntry.FeaturesAdded += $line } - "Breaking Changes" { $changeLogEntry.BreakingChanges += $line } - "Key Bugs Fixed" { $changeLogEntry.KeyBugsFixed += $line } - "Fixed" { $changeLogEntry.Fixed += $line } - } + "Features Added" { $changeLogEntry.FeaturesAdded += $line } + "Breaking Changes" { $changeLogEntry.BreakingChanges += $line } + "Key Bugs Fixed" { $changeLogEntry.KeyBugsFixed += $line } + "Fixed" { $changeLogEntry.Fixed += $line } } $changeLogEntry.ReleaseContent += $line @@ -79,6 +76,10 @@ function Get-ChangeLogEntriesFromContent { } } } + catch { + Write-Host "Error parsing Changelog." + Write-Host $_.Exception.Message + } return $changeLogEntries }