@@ -202,8 +202,7 @@ function Update-Changelog {
202202 Where-Object { -not $_.user.UserName.EndsWith (" [bot]" ) } |
203203 Where-Object { " Ignore" -notin $_.labels.LabelName } |
204204 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" ) } |
207206 Get-Bullets - RepositoryName $RepositoryName
208207
209208 $NewSection = switch ($RepositoryName ) {
@@ -242,6 +241,8 @@ function Update-Changelog {
242241 }
243242
244243 Pop-Location
244+
245+ Update-Version - RepositoryName $RepositoryName
245246}
246247
247248<#
@@ -328,6 +329,49 @@ function Update-Version {
328329 }
329330
330331 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
331375}
332376
333377<#
0 commit comments