@@ -105,6 +105,7 @@ for ($i = 0; $i -lt $lines.Count; $i++)
105
105
$sectionEnd = $i
106
106
107
107
$tagAnchor = $NewTag.Replace (' .' , ' ' )
108
+ $oldTagNice = ($OldTag -match " ^[0-9]" ) ? " v$OldTag " : $OldTag
108
109
$newTagNice = ($NewTag -match " ^[0-9]" ) ? " v$NewTag " : $NewTag
109
110
110
111
$PullRequestMD = " [#$ ( $PR | Split-Path - Leaf) ]($PR )"
@@ -113,7 +114,7 @@ $PullRequestMD = "[#$($PR | Split-Path -Leaf)]($PR)"
113
114
$updated = $false
114
115
for ($i = 0 ; $i -lt $sectionEnd ; $i ++ )
115
116
{
116
- if (($lines [$i ] -match " ^- Bump $Name to" ) -and `
117
+ if (($lines [$i ] -match " ^- Bump $Name .* to" ) -and `
117
118
($lines [$i + 1 ] -match " ^ - \[changelog\]\($RepoUrl " ) -and `
118
119
($lines [$i + 2 ] -match " ^ - \[diff\]\($RepoUrl " ))
119
120
{
@@ -122,7 +123,7 @@ for ($i = 0; $i -lt $sectionEnd; $i++)
122
123
Write-Host " " , $lines [$i + 1 ]
123
124
Write-Host " " , $lines [$i + 2 ]
124
125
125
- $lines [$i ] = $lines [$i ] -replace " Bump $Name to .* \(" , " Bump $Name to $newTagNice ("
126
+ $lines [$i ] = $lines [$i ] -replace " ( Bump $Name .*) to .* \(" , " `$ 1to $newTagNice ("
126
127
$lines [$i ] = $lines [$i ] -replace " \)$" , " , $PullRequestMD )"
127
128
$lines [$i + 1 ] = " - [changelog]($RepoUrl /blob/$MainBranch /CHANGELOG.md#$tagAnchor )"
128
129
$lines [$i + 2 ] = $lines [$i + 2 ] -replace " \.\.\..*\)$" , " ...$NewTag )"
@@ -138,7 +139,7 @@ for ($i = 0; $i -lt $sectionEnd; $i++)
138
139
139
140
if (! $updated )
140
141
{
141
- $entry = @ (" - Bump $Name to $newTagNice ($PullRequestMD )" ,
142
+ $entry = @ (" - Bump $Name from $oldTagNice to $newTagNice ($PullRequestMD )" ,
142
143
" - [changelog]($RepoUrl /blob/$MainBranch /CHANGELOG.md#$tagAnchor )" ,
143
144
" - [diff]($RepoUrl /compare/$OldTag ...$NewTag )" )
144
145
0 commit comments