@@ -105,6 +105,7 @@ for ($i = 0; $i -lt $lines.Count; $i++)
105105$sectionEnd = $i
106106
107107$tagAnchor = $NewTag.Replace (' .' , ' ' )
108+ $oldTagNice = ($OldTag -match " ^[0-9]" ) ? " v$OldTag " : $OldTag
108109$newTagNice = ($NewTag -match " ^[0-9]" ) ? " v$NewTag " : $NewTag
109110
110111$PullRequestMD = " [#$ ( $PR | Split-Path - Leaf) ]($PR )"
@@ -113,7 +114,7 @@ $PullRequestMD = "[#$($PR | Split-Path -Leaf)]($PR)"
113114$updated = $false
114115for ($i = 0 ; $i -lt $sectionEnd ; $i ++ )
115116{
116- if (($lines [$i ] -match " ^- Bump $Name to" ) -and `
117+ if (($lines [$i ] -match " ^- Bump $Name .* to" ) -and `
117118 ($lines [$i + 1 ] -match " ^ - \[changelog\]\($RepoUrl " ) -and `
118119 ($lines [$i + 2 ] -match " ^ - \[diff\]\($RepoUrl " ))
119120 {
@@ -122,7 +123,7 @@ for ($i = 0; $i -lt $sectionEnd; $i++)
122123 Write-Host " " , $lines [$i + 1 ]
123124 Write-Host " " , $lines [$i + 2 ]
124125
125- $lines [$i ] = $lines [$i ] -replace " Bump $Name to .* \(" , " Bump $Name to $newTagNice ("
126+ $lines [$i ] = $lines [$i ] -replace " ( Bump $Name .*) to .* \(" , " `$ 1to $newTagNice ("
126127 $lines [$i ] = $lines [$i ] -replace " \)$" , " , $PullRequestMD )"
127128 $lines [$i + 1 ] = " - [changelog]($RepoUrl /blob/$MainBranch /CHANGELOG.md#$tagAnchor )"
128129 $lines [$i + 2 ] = $lines [$i + 2 ] -replace " \.\.\..*\)$" , " ...$NewTag )"
@@ -138,7 +139,7 @@ for ($i = 0; $i -lt $sectionEnd; $i++)
138139
139140if (! $updated )
140141{
141- $entry = @ (" - Bump $Name to $newTagNice ($PullRequestMD )" ,
142+ $entry = @ (" - Bump $Name from $oldTagNice to $newTagNice ($PullRequestMD )" ,
142143 " - [changelog]($RepoUrl /blob/$MainBranch /CHANGELOG.md#$tagAnchor )" ,
143144 " - [diff]($RepoUrl /compare/$OldTag ...$NewTag )" )
144145
0 commit comments