gpt4 book ai didi

python - 是否有可能通过 pyGithub 获得发布

转载 作者:太空宇宙 更新时间:2023-11-03 14:58:36 24 4
gpt4 key购买 nike

我还没有使用过 PyGithub,但我很好奇是否有可能从存储库中获取发布列表(例如 https://github.com/{username}/{repo-name}/发布)。我在文档中看不到任何相关信息 here .

最佳答案

这个问题有点老了,但似乎没有人按照 OP 的要求回答。

PyGithub 确实有办法返回 repo 的发布,这里是一个工作示例:

from github import Github

G = Github('') # Put your GitHub token here
repo = G.get_repo('justintime50/github-archive')
releases = repo.get_releases()

for release in releases:
print(release.title)

以上将返回以下内容:

v4.3.0
v4.2.2
v4.2.1
v4.2.0
v4.1.1
...

希望对您有所帮助!

关于python - 是否有可能通过 pyGithub 获得发布,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40462632/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com