From e732a2a56a9a4901d27b3a145eb1dbce4321cd67 Mon Sep 17 00:00:00 2001
From: MartijnLeijssen-TomTom
 <46988880+MartijnLeijssen-TomTom@users.noreply.github.com>
Date: Mon, 19 Jun 2023 11:43:23 +0200
Subject: [PATCH] fix(changelog): always print dependency name (#22868)

---
 .../update/pr/body/changelogs.spec.ts          |  2 +-
 .../repository/update/pr/body/changelogs.ts    | 18 +++---------------
 2 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/lib/workers/repository/update/pr/body/changelogs.spec.ts b/lib/workers/repository/update/pr/body/changelogs.spec.ts
index 01ffa96c20..44c6134a36 100644
--- a/lib/workers/repository/update/pr/body/changelogs.spec.ts
+++ b/lib/workers/repository/update/pr/body/changelogs.spec.ts
@@ -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)
 
       "
     `);
diff --git a/lib/workers/repository/update/pr/body/changelogs.ts b/lib/workers/repository/update/pr/body/changelogs.ts
index 7f918dff59..125a528634 100644
--- a/lib/workers/repository/update/pr/body/changelogs.ts
+++ b/lib/workers/repository/update/pr/body/changelogs.ts
@@ -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!})`;
     }
   }
 
-- 
GitLab