Don't show untagged issues when desired
When `add_issues_wo_labels` is false, do not include issues that do not have any labels in the CHANGELOG (per documentation). Signed-off-by: Tom Duffield <tom@chef.io>
This commit is contained in:
parent
b91609283e
commit
726f8f79fb
|
@ -126,19 +126,17 @@ module GitHubChangelogGenerator
|
|||
# @return [Array] filtered array of issues
|
||||
def include_issues_by_labels(issues)
|
||||
filtered_issues = filter_by_include_labels(issues)
|
||||
filtered_issues |= filter_wo_labels(issues)
|
||||
filtered_issues = filter_wo_labels(filtered_issues)
|
||||
filtered_issues
|
||||
end
|
||||
|
||||
# @return [Array] issues without labels or empty array if add_issues_wo_labels is false
|
||||
def filter_wo_labels(issues)
|
||||
if options[:add_issues_wo_labels]
|
||||
issues_wo_labels = issues.reject do |issue|
|
||||
issue["labels"].map { |l| l["name"] }.none?
|
||||
issues
|
||||
else
|
||||
issues.reject { |issue| !issue["labels"].map { |l| l["name"] }.any? }
|
||||
end
|
||||
return issues_wo_labels
|
||||
end
|
||||
[]
|
||||
end
|
||||
|
||||
def filter_by_include_labels(issues)
|
||||
|
|
Loading…
Reference in New Issue
Block a user