diff --git a/lib/github_changelog_generator.rb b/lib/github_changelog_generator.rb index 9e37a75..718438c 100755 --- a/lib/github_changelog_generator.rb +++ b/lib/github_changelog_generator.rb @@ -243,6 +243,29 @@ module GitHubChangelogGenerator filtered_issues = delete_by_time(@issues, :closed_at, newer_tag_time, older_tag_time) end + + #delete excess irrelevant issues (according milestones) + filtered_issues.select!{ |issue| + if issue.milestone.nil? + true + else + #check, that this milestone in tag list: + milestone_is_tag = @all_tags.find{|tag| + tag.name == issue.milestone.title + } + + if milestone_is_tag.nil? + true + else + issue.milestone.title == newer_tag_name + end + end + + } + + #add missed issues (according milestones) + + self.create_log(filtered_pull_requests, filtered_issues, newer_tag_name, newer_tag_time) end @@ -395,7 +418,7 @@ module GitHubChangelogGenerator if @options[:add_issues_wo_labels] issues_wo_labels = issues.select { # add issues without any labels - |issue| !issue.labels.map { |label| label.name }.any? + |issue| !issue.labels.map { |label| label.name }.any? } filtered_issues.concat(issues_wo_labels) end diff --git a/lib/github_changelog_generator/generator.rb b/lib/github_changelog_generator/generator.rb index 5680f41..0c08a3d 100644 --- a/lib/github_changelog_generator/generator.rb +++ b/lib/github_changelog_generator/generator.rb @@ -10,10 +10,10 @@ module GitHubChangelogGenerator merge = "#{@options[:merge_prefix]}#{encapsulated_title} [\\##{pull_request[:number]}](#{pull_request.html_url})" if @options[:author] - if !pull_request.user.nil? - merge += " ([#{pull_request.user.login}](#{pull_request.user.html_url}))\n\n" - else + if pull_request.user.nil? merge += " ({Null user})\n\n" + else + merge += " ([#{pull_request.user.login}](#{pull_request.user.html_url}))\n\n" end else merge += "\n\n"