我看到github3.py仍然没有像Repository.create_issue()那样在Repository.create_pull()上有属性标签。但是在ShortPullRequest上创建了属性标签。所以我试着:
created_pr = repo.create_pull(
title=pr.title,
body=pr.body,
head=pr.head,
base=pr.base,
)
if pr.labels:
created_pr.labels = pr.labels
created_pr.update()问题是,在我检查了GitHub之后,创建的PR没有标签。使用这个组件有什么解决方案吗?
注:我不能使用pygithub,因为他们使用LGPL许可证,而我想做麻省理工学院的许可证代码。
发布于 2020-10-06 22:42:49
实际上,这样做的方法是:
if pr.labels:
issue = created_pr.issue()
issue.add_labels(*pr.labels)在Github上感谢@sigmavirus24。
https://stackoverflow.com/questions/64225366
复制相似问题