Skip to content

Commit

Permalink
fix(onboarding): use default preset only if truthy (#16596)
Browse files Browse the repository at this point in the history
Closes #16526
  • Loading branch information
rarkins committed Jul 15, 2022
1 parent badccaf commit cf4fcce
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions lib/workers/repository/onboarding/branch/config.ts
Expand Up @@ -26,8 +26,9 @@ async function getOnboardingConfig(
// Check for org/renovate-config
try {
const repo = `${orgName}/renovate-config`;
await getPreset({ repo });
orgPreset = `local>${repo}`;
if (await getPreset({ repo })) {
orgPreset = `local>${repo}`;
}
} catch (err) {
if (
err.message !== PRESET_DEP_NOT_FOUND &&
Expand All @@ -43,11 +44,14 @@ async function getOnboardingConfig(
try {
const repo = `${orgName}/.${platform}`;
const presetName = 'renovate-config';
await getPreset({
repo,
presetName,
});
orgPreset = `local>${repo}:${presetName}`;
if (
await getPreset({
repo,
presetName,
})
) {
orgPreset = `local>${repo}:${presetName}`;
}
} catch (err) {
if (
err.message !== PRESET_DEP_NOT_FOUND &&
Expand All @@ -59,6 +63,9 @@ async function getOnboardingConfig(
}

if (orgPreset) {
logger.debug(
`Found org preset ${orgPreset} - using it in onboarding config`
);
onboardingConfig = {
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
extends: [orgPreset],
Expand Down

0 comments on commit cf4fcce

Please sign in to comment.