Skip to content

Commit

Permalink
fix(changelog): always print dependency name (#22868)
Browse files Browse the repository at this point in the history
  • Loading branch information
MartijnLeijssen-TomTom authored Jun 19, 2023
1 parent b52d725 commit e732a2a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
2 changes: 1 addition & 1 deletion lib/workers/repository/update/pr/body/changelogs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ describe('workers/repository/update/pr/body/changelogs', () => {
some/repo (dep-1)
some/repo (dep-2)
some/repo (dep-3)
other/repo
other/repo (dep-4)
"
`);
Expand Down
18 changes: 3 additions & 15 deletions lib/workers/repository/update/pr/body/changelogs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,11 @@ export function getChangelogs(config: BranchConfig): string {
return releaseNotes;
}

const countReleaseNodesByRepoName: Record<string, number> = {};

for (const upgrade of config.upgrades) {
if (upgrade.hasReleaseNotes && upgrade.repoName) {
countReleaseNodesByRepoName[upgrade.repoName] =
(countReleaseNodesByRepoName[upgrade.repoName] || 0) + 1;
}
}

for (const upgrade of config.upgrades) {
if (upgrade.hasReleaseNotes && upgrade.repoName) {
// TODO: types (#7154)
upgrade.releaseNotesSummaryTitle = `${upgrade.repoName}${
countReleaseNodesByRepoName[upgrade.repoName] > 1
? ` (${upgrade.depName!})`
: ''
}`;
upgrade.releaseNotesSummaryTitle = `${
upgrade.repoName
} (${upgrade.depName!})`;
}
}

Expand Down

0 comments on commit e732a2a

Please sign in to comment.