Is there any way to find PRs in github by it's merge date? Actually the PRs that were merged in the range of the dates.
Didn't find any and it feels weird, so asking the community. Thanks
Is there any way to find PRs in github by it's merge date? Actually the PRs that were merged in the range of the dates.
Didn't find any and it feels weird, so asking the community. Thanks
There does not seem to be a way to query by date, by "merge_at" field date on a PR using the PR GitHub API.
You can see how a script like file-suggest_backports-py-L333
(python) does it in order to get and sort PR by date.
# Now get all PRs and filter by whether or not they belong to the
# milestone; requesting them all at once is still faster than
# requesting one at a time. This would also be easier if the API
# supported sorting on PR lists
for pr in self.iter_pull_requests(state='closed'):
if (pr['number'] not in milestone_issues or not pr['merged_at']):
continue
merge_commit = self.get_pull_request_merge_commit(pr['number'])
# Ignore commits that were merged before the last tag date
if merge_commit['commit']['committer']['date'] < last_tag_date:
continue
if not self.find_merged_commit(merge_commit,
since=last_tag_date):
yield pr, merge_commit['sha']
But in short, you need to script it:
You can also use github website to do the search by merge time according to the docs: https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests#search-by-when-a-pull-request-was-merged
You can filter pull requests based on when they were merged, using the merged qualifier.
This qualifier takes a date as its parameter. Date formatting must follow the ISO8601 standard, which is YYYY-MM-DD (year-month-day). You can also add optional time information THH:MM:SS+00:00 after the date, to search by the hour, minute, and second. That's T, followed by HH:MM:SS (hour-minutes-seconds), and a UTC offset (+00:00).
with an example as follows:
language:javascript merged:<2011-01-01
matches pull requests in JavaScript repositories that were merged before 2011.