1- import { configFileNames } from '../../../config/app-strings' ;
21import type { RenovateConfig } from '../../../config/types' ;
32import {
43 REPOSITORY_DISABLED_BY_CONFIG ,
@@ -7,18 +6,13 @@ import {
76import { logger } from '../../../logger' ;
87import type { RepoParams , RepoResult } from '../../../modules/platform' ;
98import { platform } from '../../../modules/platform' ;
9+ import { getDefaultConfigFileName } from '../onboarding/common' ;
1010
1111// TODO: fix types (#22198)
1212export type WorkerPlatformConfig = RepoResult &
1313 RenovateConfig &
1414 Record < string , any > ;
1515
16- // TODO #22198
17- const getDefaultConfigFile = ( config : RenovateConfig ) : string =>
18- configFileNames . includes ( config . onboardingConfigFileName ! )
19- ? config . onboardingConfigFileName !
20- : configFileNames [ 0 ] ;
21-
2216async function getJsonFile ( file : string ) : Promise < RenovateConfig | null > {
2317 try {
2418 return await platform . getJsonFile ( file ) ;
@@ -31,7 +25,7 @@ async function validateOptimizeForDisabled(
3125 config : RenovateConfig ,
3226) : Promise < void > {
3327 if ( config . optimizeForDisabled ) {
34- const renovateConfig = await getJsonFile ( getDefaultConfigFile ( config ) ) ;
28+ const renovateConfig = await getJsonFile ( getDefaultConfigFileName ( config ) ) ;
3529 if ( renovateConfig ?. enabled === false ) {
3630 throw new Error ( REPOSITORY_DISABLED_BY_CONFIG ) ;
3731 }
@@ -63,7 +57,7 @@ async function validateOptimizeForDisabled(
6357
6458async function validateIncludeForks ( config : RenovateConfig ) : Promise < void > {
6559 if ( config . forkProcessing !== 'enabled' && config . isFork ) {
66- const defaultConfigFile = getDefaultConfigFile ( config ) ;
60+ const defaultConfigFile = getDefaultConfigFileName ( config ) ;
6761 const repoConfig = await getJsonFile ( defaultConfigFile ) ;
6862 if ( ! repoConfig ) {
6963 logger . debug (
0 commit comments