Skip to content

Commit

Permalink
fix(changelog): Revert platform dispatch changes (#23048)
Browse files Browse the repository at this point in the history
zharinov authored Jun 29, 2023
1 parent fd3d577 commit 492d313
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions lib/workers/repository/update/pr/changelog/index.ts
Original file line number Diff line number Diff line change
@@ -26,23 +26,29 @@ export async function getChangeLogJSON(
`Fetching changelog: ${sourceUrl} (${currentVersion} -> ${newVersion})`
);

let res: ChangeLogResult | null = null;

const platform = detectPlatform(sourceUrl);

if (platform === 'github') {
return await sourceGithub.getChangeLogJSON(config);
}
switch (platform) {
case 'gitlab':
res = await sourceGitlab.getChangeLogJSON(config);
break;
case 'github':
res = await sourceGithub.getChangeLogJSON(config);
break;

if (platform === 'gitlab') {
return await sourceGitlab.getChangeLogJSON(config);
default:
logger.info(
{ sourceUrl, hostType: platform },
'Unknown platform, skipping changelog fetching.'
);
break;
}

logger.info(
{ sourceUrl, hostType: platform },
'Unknown platform, skipping changelog fetching.'
);
return res;
} catch (err) /* istanbul ignore next */ {
logger.error({ config, err }, 'getChangeLogJSON error');
return null;
}

return null;
}

0 comments on commit 492d313

Please sign in to comment.