Github按合并日期搜索PRS

me1*_*111 5 github

有没有办法在合并日期之前在github中找到PR?实际上是在日期范围内合并的PR。

找不到任何东西,感觉很奇怪,所以请向社区询问。谢谢

Von*_*onC 3

似乎没有办法使用 PR GitHub API 按日期、通过 PR 上的“merge_at”字段日期进行查询。

您可以看到像 (python) 这样的脚本如何file-suggest_backports-py-L333执行此操作,以便按日期获取 PR 并对其进行排序。

    # 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']
Run Code Online (Sandbox Code Playgroud)

但简而言之,您需要编写脚本: