@@ -202,8 +202,7 @@ function Update-Changelog {
202
202
Where-Object { -not $_.user.UserName.EndsWith (" [bot]" ) } |
203
203
Where-Object { " Ignore" -notin $_.labels.LabelName } |
204
204
Where-Object { -not $_.title.StartsWith (" [Ignore]" ) } |
205
- Where-Object { -not $_.title.StartsWith (" Update CHANGELOG" ) } |
206
- Where-Object { -not $_.title.StartsWith (" Bump version" ) } |
205
+ Where-Object { -not $_.title.StartsWith (" Release `` v" ) } |
207
206
Get-Bullets - RepositoryName $RepositoryName
208
207
209
208
$NewSection = switch ($RepositoryName ) {
@@ -242,6 +241,8 @@ function Update-Changelog {
242
241
}
243
242
244
243
Pop-Location
244
+
245
+ Update-Version - RepositoryName $RepositoryName
245
246
}
246
247
247
248
<#
@@ -328,6 +329,49 @@ function Update-Version {
328
329
}
329
330
330
331
Pop-Location
332
+
333
+ New-ReleasePR - RepositoryName $RepositoryName
334
+ }
335
+
336
+ <#
337
+ . SYNOPSIS
338
+ Creates a new draft GitHub PR from the release branch.
339
+ . DESCRIPTION
340
+ Pushes the release branch to `origin` and then opens a draft PR.
341
+ #>
342
+ function New-ReleasePR {
343
+ param (
344
+ [Parameter (Mandatory )]
345
+ [ValidateSet ([RepoNames ])]
346
+ [string ]$RepositoryName
347
+ )
348
+ # NOTE: This a side effect neccesary for Git operations to work.
349
+ Push-Location - Path " $PSScriptRoot /../../$RepositoryName "
350
+
351
+ $Version = Get-Version - RepositoryName $RepositoryName
352
+ $Branch = " release/v$Version "
353
+ Update-Branch - Version $Version
354
+ Write-Output " Pushing branch `` $Branch `` ..."
355
+ git push origin $Branch
356
+
357
+ $LabelParams = @ {
358
+ OwnerName = " PowerShell"
359
+ RepositoryName = $RepositoryName
360
+ Label = " Ignore"
361
+ }
362
+
363
+ $PRParams = @ {
364
+ Head = $Branch
365
+ Base = " master"
366
+ Draft = $true
367
+ Title = " Release `` v$Version `` "
368
+ Body = " Automated PR for new release!"
369
+ }
370
+
371
+ $PR = Get-GitHubLabel @LabelParams | New-GitHubPullRequest @PRParams
372
+ Write-Output " Draft PR URL: $ ( $PR.html_url ) "
373
+
374
+ Pop-Location
331
375
}
332
376
333
377
<#
0 commit comments