Skip to content

Commit

Permalink
Update ChangeLog Logic
Browse files Browse the repository at this point in the history
  • Loading branch information
chidozieononiwu committed Jun 4, 2021
1 parent 9f63951 commit 7cbb900
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions eng/common/scripts/ChangeLog-Operations.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -56,29 +56,30 @@ function Get-ChangeLogEntriesFromContent {
}
else {
if ($changeLogEntry) {
if ($line.Trim() -match "###\s(?<sectionName>.*)")
if ($line.Trim() -match "^###\s(?<sectionName>.*)")
{
$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
}
}
}
}
catch {
Write-Host "Error parsing Changelog."
Write-Host $_.Exception.Message
}
return $changeLogEntries
}

Expand Down

0 comments on commit 7cbb900

Please sign in to comment.