@@ -36,7 +36,6 @@ def initialize
36
36
37
37
if @options [ :pulls ]
38
38
@pull_requests = self . get_filtered_pull_requests
39
- self . fetch_merged_at_pull_requests
40
39
else
41
40
@pull_requests = [ ]
42
41
end
@@ -138,12 +137,12 @@ def fetch_merged_at_pull_requests
138
137
139
138
def get_filtered_pull_requests
140
139
141
- pull_requests = @pull_requests
142
- filtered_pull_requests = pull_requests
140
+ self . fetch_merged_at_pull_requests
143
141
142
+ filtered_pull_requests = @pull_requests . select { |pr | pr [ :merged_at ] != nil }
144
143
145
144
unless @options [ :include_labels ] . nil?
146
- filtered_pull_requests = pull_requests . select { |issue |
145
+ filtered_pull_requests = @ pull_requests. select { |issue |
147
146
#add all labels from @options[:incluse_labels] array
148
147
( issue . labels . map { |label | label . name } & @options [ :include_labels ] ) . any?
149
148
}
@@ -157,7 +156,7 @@ def get_filtered_pull_requests
157
156
end
158
157
159
158
if @options [ :add_issues_wo_labels ]
160
- issues_wo_labels = pull_requests . select {
159
+ issues_wo_labels = @ pull_requests. select {
161
160
# add issues without any labels
162
161
|issue | !issue . labels . map { |label | label . name } . any?
163
162
}
@@ -332,7 +331,7 @@ def generate_log_between_tags(older_tag, newer_tag)
332
331
333
332
if filtered_issues . empty? && filtered_pull_requests . empty? && newer_tag . nil?
334
333
# do not generate empty unreleased section
335
- return nil
334
+ return ''
336
335
end
337
336
338
337
self . create_log ( filtered_pull_requests , filtered_issues , newer_tag , older_tag_name )
0 commit comments