Remove duplicates of issues and pull-requests with same number

This commit is contained in:
Petr Korolev 2014-11-10 16:59:11 +02:00
parent 0046f344a9
commit cdc009b4ad

View File

@ -80,11 +80,6 @@ class ChangelogGenerator
log += self.generate_log_for_all_tags
end
if @options[:verbose]
puts log
end
log += "\n\n\\* *This changelog was generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*"
output_filename = "#{@options[:output]}"
@ -303,6 +298,7 @@ class ChangelogGenerator
issues_req = @github.issues.list user: @options[:user], repo: @options[:project], state: 'closed', filter: 'all', labels: nil
filtered_issues = issues_req.body.select { |issues|
#compare is there any labels from @options[:labels] array
(issues.labels.map { |issue| issue.name } & @options[:labels]).any?
}
@ -313,6 +309,11 @@ class ChangelogGenerator
filtered_issues.concat(issues_wo_labels)
end
# remove pull request from issues:
filtered_issues.select! { |x|
x.pull_request == nil
}
if @options[:verbose]
puts "Receive all closed issues with labels #{@options[:labels]}: #{all_issues.count} issues"
end