@@ -101,7 +101,10 @@ public async Task<string> BuildReleaseNotesAsync(string user, string repository,
101
101
private Dictionary < string , List < Issue > > GetIssuesDict ( List < Issue > issues )
102
102
{
103
103
var issueLabels = _configuration . IssueLabelsInclude ;
104
+ var excludedIssueLabels = _configuration . IssueLabelsExclude ;
105
+
104
106
var issuesByLabel = issues
107
+ . Where ( o => ! o . Labels . Any ( l => excludedIssueLabels . Any ( eil => string . Equals ( eil , l . Name , StringComparison . OrdinalIgnoreCase ) ) ) )
105
108
. SelectMany ( o => o . Labels , ( issue , label ) => new { Label = label . Name , Issue = issue } )
106
109
. Where ( o => issueLabels . Any ( il => string . Equals ( il , o . Label , StringComparison . OrdinalIgnoreCase ) ) )
107
110
. GroupBy ( o => o . Label , o => o . Issue )
@@ -136,16 +139,21 @@ private string GetValidLabel(string label, int issuesCount)
136
139
foreach ( var issue in issues )
137
140
{
138
141
var includedIssuesCount = 0 ;
139
- var excludedIssuesCount = 0 ;
142
+ var isExcluded = false ;
140
143
141
144
foreach ( var issueLabel in issue . Labels )
142
145
{
143
146
includedIssuesCount += _configuration . IssueLabelsInclude . Count ( issueToInclude => issueLabel . Name . ToUpperInvariant ( ) == issueToInclude . ToUpperInvariant ( ) ) ;
144
147
145
- excludedIssuesCount += _configuration . IssueLabelsExclude . Count ( issueToExclude => issueLabel . Name . ToUpperInvariant ( ) == issueToExclude . ToUpperInvariant ( ) ) ;
148
+ isExcluded = isExcluded || _configuration . IssueLabelsExclude . Any ( issueToExclude => issueLabel . Name . ToUpperInvariant ( ) == issueToExclude . ToUpperInvariant ( ) ) ;
149
+ }
150
+
151
+ if ( isExcluded )
152
+ {
153
+ continue ;
146
154
}
147
155
148
- if ( includedIssuesCount + excludedIssuesCount != 1 )
156
+ if ( includedIssuesCount != 1 )
149
157
{
150
158
var allIssueLabels = _configuration . IssueLabelsInclude . Union ( _configuration . IssueLabelsExclude ) . ToList ( ) ;
151
159
var allIssuesExceptLast = allIssueLabels . Take ( allIssueLabels . Count - 1 ) ;
0 commit comments