@@ -225,19 +225,6 @@ export abstract class ReleaseAction {
225225 ...this . getAspectLockFiles ( ) ,
226226 ] ;
227227
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-
241228 const commitMessage = getCommitMessageForRelease ( newVersion ) ;
242229
243230 // Create a release staging commit including changelog and version bump.
@@ -595,8 +582,21 @@ export abstract class ReleaseAction {
595582
596583 await this . prependReleaseNotesToChangelog ( releaseNotes ) ;
597584
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 ) ;
600600 Log . info ( green ( ` ✓ Created changelog cherry-pick commit for: "${ releaseNotes . version } ".` ) ) ;
601601
602602 // Create a cherry-pick pull request that should be merged by the caretaker.
0 commit comments