@@ -136,26 +136,21 @@ function Get-FirstChangelog {
136
136
137
137
<#
138
138
. SYNOPSIS
139
- Creates and checks out `release/v<version> ` if not already on it.
139
+ Creates and checks out `release` if not already on it.
140
140
#>
141
141
function Update-Branch {
142
142
[CmdletBinding (SupportsShouldProcess )]
143
- param (
144
- [Parameter (Mandatory )]
145
- [string ]$Version
146
- )
147
143
$Branch = git branch -- show-current
148
- $NewBranch = " release/v$Version "
149
- if ($Branch -ne $NewBranch ) {
150
- if ($PSCmdlet.ShouldProcess ($NewBranch , " git checkout -b" )) {
151
- git checkout - b $NewBranch
144
+ if ($Branch -ne " release" ) {
145
+ if ($PSCmdlet.ShouldProcess (" release" , " git checkout -b" )) {
146
+ git checkout - b " release"
152
147
}
153
148
}
154
149
}
155
150
156
151
<#
157
152
. SYNOPSIS
158
- Gets current version from changelog as [semver].
153
+ Gets current version from changelog as ` [semver]` .
159
154
#>
160
155
function Get-Version {
161
156
param (
@@ -176,10 +171,9 @@ function Get-Version {
176
171
. SYNOPSIS
177
172
Updates the CHANGELOG file with PRs merged since the last release.
178
173
. DESCRIPTION
179
- Uses the local Git repositories but does not pull, so ensure HEAD is where
180
- you want it. Creates a new branch at 'release/$Version' if not already
181
- checked out. Handles any merge option for PRs, but is a little slow as it
182
- queries all PRs.
174
+ Uses the local Git repositories but does not pull, so ensure HEAD is where you
175
+ want it. Creates the branch `release` if not already checked out. Handles any
176
+ merge option for PRs, but is a little slow as it queries all PRs.
183
177
#>
184
178
function Update-Changelog {
185
179
[CmdletBinding (SupportsShouldProcess )]
@@ -238,7 +232,7 @@ function Update-Changelog {
238
232
$CurrentChangelog [2 .. $CurrentChangelog.Length ]
239
233
) | Set-Content - Encoding utf8NoBOM - Path $ChangelogFile
240
234
241
- Update-Branch - Version $Version .Substring ( 1 ) # Has "v" prefix
235
+ Update-Branch
242
236
243
237
if ($PSCmdlet.ShouldProcess (" $RepositoryName /$ChangelogFile " , " git commit" )) {
244
238
git add $ChangelogFile
@@ -328,7 +322,7 @@ function Update-Version {
328
322
}
329
323
}
330
324
331
- Update-Branch - Version $Version
325
+ Update-Branch
332
326
333
327
if ($PSCmdlet.ShouldProcess (" $RepositoryName /v$Version " , " git commit" )) {
334
328
git commit - m " Bump version to `` v$Version `` "
@@ -409,7 +403,7 @@ function New-DraftRelease {
409
403
$ReleaseParams = @ {
410
404
# NOTE: We rely on GitHub to create the tag at that branch.
411
405
Tag = " v$Version "
412
- Committish = " release/v $Version "
406
+ Committish = " release"
413
407
Name = " v$Version "
414
408
Body = $ChangeLog
415
409
Draft = $true
0 commit comments