Skip to content

Commit 73d4283

Browse files
committed
Get contributors from multiple linked issues/PRs
1 parent 65ae437 commit 73d4283

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/GitReleaseManager.Core/ReleaseNotes/ReleaseNotesBuilder.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,18 @@ private Dictionary<string, List<Issue>> GetIssuesDict(List<Issue> issues)
133133
return issuesByLabel;
134134
}
135135

136-
private static List<User> GetContributors(List<Issue> issues)
136+
private static List<User> GetContributors(IEnumerable<Issue> issues)
137137
{
138-
var contributors = issues
139-
.Select(i => i.User)
140-
.Union(issues.Select(i => i.LinkedIssue?.User))
138+
var contributors = issues.Select(i => i.User);
139+
var linkedContributors = issues.SelectMany(i => i.LinkedIssues).Select(i => i.User);
140+
141+
var allContributors = contributors
142+
.Union(linkedContributors)
141143
.Where(u => u != null)
142144
.DistinctBy(u => u.Login)
143145
.ToList();
144146

145-
return contributors;
147+
return allContributors;
146148
}
147149

148150
private string GetValidLabel(string label, int issuesCount)

0 commit comments

Comments
 (0)