Skip to content

Commit b782a4f

Browse files
committed
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.
1 parent 110186f commit b782a4f

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

ng-dev/release/publish/actions.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)