@@ -225,19 +225,6 @@ export abstract class ReleaseAction {
225
225
...this . getAspectLockFiles ( ) ,
226
226
] ;
227
227
228
- if ( newVersion . patch === 0 && ! newVersion . prerelease ) {
229
- // Switch the renovate labels for `target: rc` to `target: patch`
230
- const renovateConfigPath = await updateRenovateConfigTargetLabels (
231
- this . projectDir ,
232
- targetLabels [ 'TARGET_RC' ] . name ,
233
- targetLabels [ 'TARGET_PATCH' ] . name ,
234
- ) ;
235
-
236
- if ( renovateConfigPath ) {
237
- filesToCommit . push ( renovateConfigPath ) ;
238
- }
239
- }
240
-
241
228
const commitMessage = getCommitMessageForRelease ( newVersion ) ;
242
229
243
230
// Create a release staging commit including changelog and version bump.
@@ -595,8 +582,21 @@ export abstract class ReleaseAction {
595
582
596
583
await this . prependReleaseNotesToChangelog ( releaseNotes ) ;
597
584
598
- // Create a changelog cherry-pick commit.
599
- await this . createCommit ( commitMessage , [ workspaceRelativeChangelogPath ] ) ;
585
+ const filesToCommit : string [ ] = [ workspaceRelativeChangelogPath ] ;
586
+ if ( releaseNotes . version . patch === 0 && ! releaseNotes . version . prerelease ) {
587
+ // Switch the renovate labels for `target: rc` to `target: patch`
588
+ const renovateConfigPath = await updateRenovateConfigTargetLabels (
589
+ this . projectDir ,
590
+ targetLabels [ 'TARGET_RC' ] . name ,
591
+ targetLabels [ 'TARGET_PATCH' ] . name ,
592
+ ) ;
593
+
594
+ if ( renovateConfigPath ) {
595
+ filesToCommit . push ( renovateConfigPath ) ;
596
+ }
597
+ }
598
+
599
+ await this . createCommit ( commitMessage , filesToCommit ) ;
600
600
Log . info ( green ( ` ✓ Created changelog cherry-pick commit for: "${ releaseNotes . version } ".` ) ) ;
601
601
602
602
// Create a cherry-pick pull request that should be merged by the caretaker.
0 commit comments