6
6
using module ..\GitHubTools.psm1
7
7
using module ..\ChangelogTools.psm1
8
8
9
+ <#
10
+ . EXAMPLE
11
+ .\updateChangelog.ps1 -GitHubToken $ghTok -PSExtensionSinceRef v2.0.0-preview.3 -PsesSinceRef v2.0.0-preview.3 -PSExtensionVersion 2019.5.0 -PsesVersion 1.12.2 -PSExtensionUntilRef legacy/1.x -PsesUntilRef legacy/1.x -Verbose
12
+ #>
9
13
[CmdletBinding ()]
10
14
param (
11
15
[Parameter (Mandatory )]
@@ -44,6 +48,14 @@ param(
44
48
[string ]
45
49
$PsesUntilRef = ' HEAD' ,
46
50
51
+ [Parameter ()]
52
+ [string ]
53
+ $PSExtensionBaseBranch , # Default is master if HEAD, otherwise $PSExtensionSinceRef
54
+
55
+ [Parameter ()]
56
+ [string ]
57
+ $PsesBaseBranch , # Default is master if HEAD, otherwise $PsesSinceRef
58
+
47
59
[Parameter ()]
48
60
[string ]
49
61
$Organization = ' PowerShell' ,
@@ -98,6 +110,30 @@ if (-not $PsesReleaseName)
98
110
$PsesReleaseName = " v$PsesVersion "
99
111
}
100
112
113
+ if (-not $PSExtensionBaseBranch )
114
+ {
115
+ $PSExtensionBaseBranch = if ($PSExtensionUntilRef -eq ' HEAD' )
116
+ {
117
+ ' master'
118
+ }
119
+ else
120
+ {
121
+ $PSExtensionUntilRef
122
+ }
123
+ }
124
+
125
+ if (-not $PsesBaseBranch )
126
+ {
127
+ $PsesBaseBranch = if ($PsesUntilRef -eq ' HEAD' )
128
+ {
129
+ ' master'
130
+ }
131
+ else
132
+ {
133
+ $PsesUntilRef
134
+ }
135
+ }
136
+
101
137
function UpdateChangelogFile
102
138
{
103
139
param (
@@ -213,6 +249,7 @@ $cloneParams = @{
213
249
OriginRemote = " https://github.com/$FromFork /$psesRepoName "
214
250
Destination = $cloneLocation
215
251
CheckoutBranch = $branchName
252
+ CloneBranch = $PsesBaseBranch
216
253
Clobber = $true
217
254
Remotes = @ { ' upstream' = " https://github.com/$TargetFork /$vscodeRepoName " }
218
255
}
@@ -241,7 +278,7 @@ $psextChangelogSection = Get-GitCommit @psExtGetCommitParams |
241
278
Get-ChangeInfoFromCommit - GitHubToken $GitHubToken - Verbose:$VerbosePreference |
242
279
Skip-IgnoredChange @ignore - Verbose:$VerbosePreference |
243
280
New-ChangelogEntry @clEntryParams |
244
- New-ChangelogSection @clSectionParams - Preamble " #### [$vscodeRepoName ](https://github.com/$Organization /$vscodeRepoName )" - Postamble $psesChangelogPostamble
281
+ New-ChangelogSection @clSectionParams - Preamble " #### [$vscodeRepoName ](https://github.com/$Organization /$vscodeRepoName )" - Postamble $psesChangelogPostamble - ReleaseName $PSExtensionReleaseName
245
282
246
283
Write-Host " vscode-PowerShell CHANGELOG:`n`n $psextChangelogSection `n`n "
247
284
@@ -251,6 +288,7 @@ $cloneParams = @{
251
288
OriginRemote = " https://github.com/$FromFork /$vscodeRepoName "
252
289
Destination = $cloneLocation
253
290
CheckoutBranch = $branchName
291
+ CloneBranch = $PSExtensionBaseBranch
254
292
Clobber = $true
255
293
Remotes = @ { ' upstream' = " https://github.com/$TargetFork /$vscodeRepoName " }
256
294
PullUpstream = $true
@@ -273,6 +311,7 @@ $prParams = @{
273
311
Title = " Update CHANGELOG for $PsesReleaseName "
274
312
GitHubToken = $GitHubToken
275
313
FromOrg = $FromFork
314
+ TargetBranch = $PsesBaseBranch
276
315
}
277
316
New-GitHubPR @prParams - Verbose:$VerbosePreference
278
317
@@ -284,6 +323,7 @@ $prParams = @{
284
323
Title = " Update $extensionName CHANGELOG for $PSExtensionReleaseName "
285
324
GitHubToken = $GitHubToken
286
325
FromOrg = $FromFork
326
+ TargetBranch = $PSExtensionBaseBranch
287
327
}
288
328
New-GitHubPR @prParams - Verbose:$VerbosePreference
289
329
0 commit comments