我正在为项目编写更新脚本,其中远程代码应根据提供的版本号更新某些文件。
为此,在 github 中创建了标签(发布)。
现在我想下载这些文件,因为它们在提交带有版本名称的标签时。
>>> repo = github3.repository('Piletilevi', 'printsrv')
>>> for tag in repo.tags():
print(tag)
0.2.0
>>> for tag in repo.refs():
print(tag)
<Reference [refs/heads/master]>
<Reference [refs/heads/support-0.1]>
<Reference [refs/heads/1.0.0]>
<Reference [refs/tags/0.2.0]>
>>> for tag in repo.tags():
print(tag.as_dict()['commit']['sha'])
3322aa270ac921cd0d90cb7f543e8dd917fa3637