Skip to content

Commit 27acaa6

Browse files
committed
fix(ng-dev): replace deprecated baseBranches with baseBranchPatterns
See: https://github.com/angular/angular/pull/62955/files
1 parent 3d09246 commit 27acaa6

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

ng-dev/release/publish/actions/renovate-config-updates.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {targetLabels} from '../../../pr/common/labels/target.js';
1111
* @param projectDir - The path to the project directory.
1212
* @param newBranchName - The name of the new branch to add to the base branches list.
1313
* @returns A promise that resolves to the path of the modified `renovate.json` file if updated,
14-
* or `null` if the file was not found or the `baseBranches` array has an unexpected format.
14+
* or `null` if the file was not found or the `baseBranchPatterns` array has an unexpected format.
1515
*/
1616
export async function updateRenovateConfig(
1717
projectDir: string,
@@ -25,17 +25,17 @@ export async function updateRenovateConfig(
2525

2626
const config = await readFile(renovateConfigPath, 'utf-8');
2727
const configJson = JSON.parse(config) as Record<string, unknown>;
28-
const baseBranches = configJson['baseBranches'];
28+
const baseBranchPatterns = configJson['baseBranchPatterns'];
2929

30-
if (!Array.isArray(baseBranches) || baseBranches.length !== 2) {
30+
if (!Array.isArray(baseBranchPatterns) || baseBranchPatterns.length !== 2) {
3131
Log.warn(
32-
` ✘ Skipped updating Renovate config: "baseBranches" must contain exactly 2 branches.`,
32+
` ✘ Skipped updating Renovate config: "baseBranchPatterns" must contain exactly 2 branches.`,
3333
);
3434

3535
return null;
3636
}
3737

38-
configJson['baseBranches'] = ['main', newBranchName];
38+
configJson['baseBranchPatterns'] = ['main', newBranchName];
3939

4040
updateRenovateTargetLabel(
4141
configJson,
@@ -56,7 +56,7 @@ export async function updateRenovateConfig(
5656
* @param fromLabel - The label name to be replaced.
5757
* @param toLabel - The new label name to replace `fromLabel` with.
5858
* @returns A promise that resolves to the path of the modified `renovate.json` file if updated,
59-
* or `null` if the file was not found or the `baseBranches` array has an unexpected format.
59+
* or `null` if the file was not found or the `baseBranchPatterns` array has an unexpected format.
6060
*/
6161
export async function updateRenovateConfigTargetLabels(
6262
projectDir: string,
@@ -73,11 +73,11 @@ export async function updateRenovateConfigTargetLabels(
7373
const config = await readFile(renovateConfigPath, 'utf-8');
7474
const configJson = JSON.parse(config) as Record<string, unknown>;
7575

76-
// Check baseBranches just in case, though this function's primary focus is labels
77-
const baseBranches = configJson['baseBranches'];
78-
if (!Array.isArray(baseBranches) || baseBranches.length !== 2) {
76+
// Check baseBranchPatterns just in case, though this function's primary focus is labels
77+
const baseBranchPatterns = configJson['baseBranchPatterns'];
78+
if (!Array.isArray(baseBranchPatterns) || baseBranchPatterns.length !== 2) {
7979
Log.warn(
80-
` ✘ Skipped updating Renovate config: "baseBranches" must contain exactly 2 branches.`,
80+
` ✘ Skipped updating Renovate config: "baseBranchPatterns" must contain exactly 2 branches.`,
8181
);
8282

8383
return null;

ng-dev/release/publish/test/common.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ describe('common release action logic', () => {
613613
writeFileSync(
614614
renovateConfigPath,
615615
JSON.stringify({
616-
'baseBranches': ['main', '20.1.x'],
616+
'baseBranchPatterns': ['main', '20.1.x'],
617617
'packageRules': [
618618
{
619619
'matchBaseBranches': ['main'],

0 commit comments

Comments
 (0)