@@ -11,7 +11,7 @@ import {targetLabels} from '../../../pr/common/labels/target.js';
11
11
* @param projectDir - The path to the project directory.
12
12
* @param newBranchName - The name of the new branch to add to the base branches list.
13
13
* @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.
15
15
*/
16
16
export async function updateRenovateConfig (
17
17
projectDir : string ,
@@ -25,17 +25,17 @@ export async function updateRenovateConfig(
25
25
26
26
const config = await readFile ( renovateConfigPath , 'utf-8' ) ;
27
27
const configJson = JSON . parse ( config ) as Record < string , unknown > ;
28
- const baseBranches = configJson [ 'baseBranches ' ] ;
28
+ const baseBranchPatterns = configJson [ 'baseBranchPatterns ' ] ;
29
29
30
- if ( ! Array . isArray ( baseBranches ) || baseBranches . length !== 2 ) {
30
+ if ( ! Array . isArray ( baseBranchPatterns ) || baseBranchPatterns . length !== 2 ) {
31
31
Log . warn (
32
- ` ✘ Skipped updating Renovate config: "baseBranches " must contain exactly 2 branches.` ,
32
+ ` ✘ Skipped updating Renovate config: "baseBranchPatterns " must contain exactly 2 branches.` ,
33
33
) ;
34
34
35
35
return null ;
36
36
}
37
37
38
- configJson [ 'baseBranches ' ] = [ 'main' , newBranchName ] ;
38
+ configJson [ 'baseBranchPatterns ' ] = [ 'main' , newBranchName ] ;
39
39
40
40
updateRenovateTargetLabel (
41
41
configJson ,
@@ -56,7 +56,7 @@ export async function updateRenovateConfig(
56
56
* @param fromLabel - The label name to be replaced.
57
57
* @param toLabel - The new label name to replace `fromLabel` with.
58
58
* @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.
60
60
*/
61
61
export async function updateRenovateConfigTargetLabels (
62
62
projectDir : string ,
@@ -73,11 +73,11 @@ export async function updateRenovateConfigTargetLabels(
73
73
const config = await readFile ( renovateConfigPath , 'utf-8' ) ;
74
74
const configJson = JSON . parse ( config ) as Record < string , unknown > ;
75
75
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 ) {
79
79
Log . warn (
80
- ` ✘ Skipped updating Renovate config: "baseBranches " must contain exactly 2 branches.` ,
80
+ ` ✘ Skipped updating Renovate config: "baseBranchPatterns " must contain exactly 2 branches.` ,
81
81
) ;
82
82
83
83
return null ;
0 commit comments