Skip to content

Commit

Permalink
Get contributors from multiple linked issues/PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jericho committed Nov 13, 2023
1 parent 88c7b4c commit 2c7dd2c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/GitReleaseManager.Core/ReleaseNotes/ReleaseNotesBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,18 @@ private Dictionary<string, List<Issue>> GetIssuesDict(List<Issue> issues)
return issuesByLabel;
}

private static List<User> GetContributors(List<Issue> issues)
private static List<User> GetContributors(IEnumerable<Issue> issues)
{
var contributors = issues
.Select(i => i.User)
.Union(issues.Select(i => i.LinkedIssue?.User))
var contributors = issues.Select(i => i.User);
var linkedContributors = issues.SelectMany(i => i.LinkedIssues).Select(i => i.User);

var allContributors = contributors
.Union(linkedContributors)
.Where(u => u != null)
.DistinctBy(u => u.Login)
.ToList();

return contributors;
return allContributors;
}

private string GetValidLabel(string label, int issuesCount)
Expand Down

0 comments on commit 2c7dd2c

Please sign in to comment.