使用 github3.py,我想检索与拉取请求关联的评论列表中的最后一条评论,然后在其中搜索字符串。我已经尝试了下面的代码,但我得到了错误TypeError: 'GitHubIterator' object does not support indexing
(没有索引,我可以检索评论列表)。
for comments in list(GitAuth.repo.issue(prs.number).comments()[-1]):
if sign_off_regex_search_string.search(comments.body) and comments.user.login == githubID:
sign_off_by_author_search_string_found = 'True'
break