@@ -202,6 +202,7 @@ export interface ManifestOptions {
202
202
draft ?: boolean ;
203
203
prerelease ?: boolean ;
204
204
draftPullRequest ?: boolean ;
205
+ alwaysUpdate ?: boolean ;
205
206
groupPullRequestTitlePattern ?: string ;
206
207
releaseSearchDepth ?: number ;
207
208
commitSearchDepth ?: number ;
@@ -264,6 +265,7 @@ export interface ManifestConfig extends ReleaserConfigJson {
264
265
'release-search-depth' ?: number ;
265
266
'commit-search-depth' ?: number ;
266
267
'sequential-calls' ?: boolean ;
268
+ 'always-update' ?: boolean ;
267
269
}
268
270
// path => version
269
271
export type ReleasedVersions = Record < string , Version > ;
@@ -299,6 +301,7 @@ export class Manifest {
299
301
readonly releasedVersions : ReleasedVersions ;
300
302
private targetBranch : string ;
301
303
private separatePullRequests : boolean ;
304
+ private alwaysUpdate : boolean ;
302
305
readonly fork : boolean ;
303
306
private signoffUser ?: string ;
304
307
private labels : string [ ] ;
@@ -339,6 +342,8 @@ export class Manifest {
339
342
* @param {string } manifestOptions.goWorkFile Option for the go-workspace plugin
340
343
* @param {boolean } manifestOptions.separatePullRequests If true, create separate pull
341
344
* requests instead of a single manifest release pull request
345
+ * @param {boolean } manifestOptions.alwaysUpdate If true, always updates pull requests instead of
346
+ * only when the release notes change
342
347
* @param {PluginType[] } manifestOptions.plugins Any plugins to use for this repository
343
348
* @param {boolean } manifestOptions.fork If true, create pull requests from a fork. Defaults
344
349
* to `false`
@@ -366,6 +371,7 @@ export class Manifest {
366
371
this . separatePullRequests =
367
372
manifestOptions ?. separatePullRequests ??
368
373
Object . keys ( repositoryConfig ) . length === 1 ;
374
+ this . alwaysUpdate = manifestOptions ?. alwaysUpdate || false ;
369
375
this . fork = manifestOptions ?. fork || false ;
370
376
this . signoffUser = manifestOptions ?. signoff ;
371
377
this . releaseLabels =
@@ -1022,7 +1028,9 @@ export class Manifest {
1022
1028
openPullRequest . headBranchName === pullRequest . headRefName
1023
1029
) ;
1024
1030
if ( existing ) {
1025
- return await this . maybeUpdateExistingPullRequest ( existing , pullRequest ) ;
1031
+ return this . alwaysUpdate
1032
+ ? await this . updateExistingPullRequest ( existing , pullRequest )
1033
+ : await this . maybeUpdateExistingPullRequest ( existing , pullRequest ) ;
1026
1034
}
1027
1035
1028
1036
// look for closed, snoozed pull request
@@ -1031,7 +1039,9 @@ export class Manifest {
1031
1039
openPullRequest . headBranchName === pullRequest . headRefName
1032
1040
) ;
1033
1041
if ( snoozed ) {
1034
- return await this . maybeUpdateSnoozedPullRequest ( snoozed , pullRequest ) ;
1042
+ return this . alwaysUpdate
1043
+ ? await this . updateExistingPullRequest ( snoozed , pullRequest )
1044
+ : await this . maybeUpdateSnoozedPullRequest ( snoozed , pullRequest ) ;
1035
1045
}
1036
1046
1037
1047
const body = await this . pullRequestOverflowHandler . handleOverflow (
@@ -1074,20 +1084,10 @@ export class Manifest {
1074
1084
) ;
1075
1085
return undefined ;
1076
1086
}
1077
- const updatedPullRequest = await this . github . updatePullRequest (
1078
- existing . number ,
1079
- pullRequest ,
1080
- this . targetBranch ,
1081
- {
1082
- fork : this . fork ,
1083
- signoffUser : this . signoffUser ,
1084
- pullRequestOverflowHandler : this . pullRequestOverflowHandler ,
1085
- }
1086
- ) ;
1087
- return updatedPullRequest ;
1087
+ return await this . updateExistingPullRequest ( existing , pullRequest ) ;
1088
1088
}
1089
1089
1090
- /// only update an snoozed pull request if it has release note changes
1090
+ /// only update a snoozed pull request if it has release note changes
1091
1091
private async maybeUpdateSnoozedPullRequest (
1092
1092
snoozed : PullRequest ,
1093
1093
pullRequest : ReleasePullRequest
@@ -1099,8 +1099,22 @@ export class Manifest {
1099
1099
) ;
1100
1100
return undefined ;
1101
1101
}
1102
- const updatedPullRequest = await this . github . updatePullRequest (
1103
- snoozed . number ,
1102
+ const updatedPullRequest = await this . updateExistingPullRequest (
1103
+ snoozed ,
1104
+ pullRequest
1105
+ ) ;
1106
+ // TODO: consider leaving the snooze label
1107
+ await this . github . removeIssueLabels ( [ SNOOZE_LABEL ] , snoozed . number ) ;
1108
+ return updatedPullRequest ;
1109
+ }
1110
+
1111
+ /// force an update to an existing pull request
1112
+ private async updateExistingPullRequest (
1113
+ existing : PullRequest ,
1114
+ pullRequest : ReleasePullRequest
1115
+ ) : Promise < PullRequest > {
1116
+ return await this . github . updatePullRequest (
1117
+ existing . number ,
1104
1118
pullRequest ,
1105
1119
this . targetBranch ,
1106
1120
{
@@ -1109,9 +1123,6 @@ export class Manifest {
1109
1123
pullRequestOverflowHandler : this . pullRequestOverflowHandler ,
1110
1124
}
1111
1125
) ;
1112
- // TODO: consider leaving the snooze label
1113
- await this . github . removeIssueLabels ( [ SNOOZE_LABEL ] , snoozed . number ) ;
1114
- return updatedPullRequest ;
1115
1126
}
1116
1127
1117
1128
private async * findMergedReleasePullRequests ( ) {
@@ -1434,6 +1445,7 @@ async function parseConfig(
1434
1445
lastReleaseSha : config [ 'last-release-sha' ] ,
1435
1446
alwaysLinkLocal : config [ 'always-link-local' ] ,
1436
1447
separatePullRequests : config [ 'separate-pull-requests' ] ,
1448
+ alwaysUpdate : config [ 'always-update' ] ,
1437
1449
groupPullRequestTitlePattern : config [ 'group-pull-request-title-pattern' ] ,
1438
1450
plugins : config [ 'plugins' ] ,
1439
1451
signoff : config [ 'signoff' ] ,
0 commit comments