我试图获取存储库中的问题数量,但下面的代码返回问题和请求。我怎样才能得到问题?我想我错过了一些简单的东西。我阅读了api文档,其中说明GitHub将所有pull请求视为问题
repo = g.get_repo("someRepo")
label = repo.get_label('someLabel')
myIssues = repo.get_issues(state='open',labels=[label])
count = 0
for issue in myIssues:
count = count + 1
print(count)
对于只是问题的问题,
pull_request
是None
因此,您只能计算issue.pull_请求为
None
的问题您还可以按如下方式替换计数逻辑:
相关问题 更多 >
编程相关推荐