From ad4d9bf63ac631f6ab38a14912b858a9bd55e17f Mon Sep 17 00:00:00 2001 From: Alan Agius <17563226+alan-agius4@users.noreply.github.com> Date: Fri, 27 Jun 2025 09:36:24 +0000 Subject: [PATCH] fix(ng-dev): cherry-pick renovate config label changes Renovate uses the configuration file in the main branch, thus the label changes need to be commited to the `main` branch and not the release branch. --- ng-dev/release/publish/actions.ts | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/ng-dev/release/publish/actions.ts b/ng-dev/release/publish/actions.ts index d3077f1f0..d77c7bc4a 100644 --- a/ng-dev/release/publish/actions.ts +++ b/ng-dev/release/publish/actions.ts @@ -225,19 +225,6 @@ export abstract class ReleaseAction { ...this.getAspectLockFiles(), ]; - if (newVersion.patch === 0 && !newVersion.prerelease) { - // Switch the renovate labels for `target: rc` to `target: patch` - const renovateConfigPath = await updateRenovateConfigTargetLabels( - this.projectDir, - targetLabels['TARGET_RC'].name, - targetLabels['TARGET_PATCH'].name, - ); - - if (renovateConfigPath) { - filesToCommit.push(renovateConfigPath); - } - } - const commitMessage = getCommitMessageForRelease(newVersion); // Create a release staging commit including changelog and version bump. @@ -595,8 +582,21 @@ export abstract class ReleaseAction { await this.prependReleaseNotesToChangelog(releaseNotes); - // Create a changelog cherry-pick commit. - await this.createCommit(commitMessage, [workspaceRelativeChangelogPath]); + const filesToCommit: string[] = [workspaceRelativeChangelogPath]; + if (releaseNotes.version.patch === 0 && !releaseNotes.version.prerelease) { + // Switch the renovate labels for `target: rc` to `target: patch` + const renovateConfigPath = await updateRenovateConfigTargetLabels( + this.projectDir, + targetLabels['TARGET_RC'].name, + targetLabels['TARGET_PATCH'].name, + ); + + if (renovateConfigPath) { + filesToCommit.push(renovateConfigPath); + } + } + + await this.createCommit(commitMessage, filesToCommit); Log.info(green(` ✓ Created changelog cherry-pick commit for: "${releaseNotes.version}".`)); // Create a cherry-pick pull request that should be merged by the caretaker.