diff --git a/d3b_release_maker/release_maker.py b/d3b_release_maker/release_maker.py index 61a0280..f08a73b 100644 --- a/d3b_release_maker/release_maker.py +++ b/d3b_release_maker/release_maker.py @@ -159,11 +159,14 @@ def _get_merged_prs(self, after, prs_to_ignore=None): prs = [] prs_to_ignore = prs_to_ignore or {} for p in self.session.yield_paginated(endpoint, query_params): - if p["merged_at"]: - if p["merged_at"] < after: + if p["merged_at"]: # only the merged PRs + if p["updated_at"] < after: + # stop looking if last update was before the last release break - elif (p["number"] not in prs_to_ignore) and ( - regex.search(release_pattern, p["title"]) is None + elif ( + (p["merged_at"] > after) # ignore old PRs with updates + and (p["number"] not in prs_to_ignore) + and (regex.search(release_pattern, p["title"]) is None) ): prs.append(p) return prs