如何解决PyGitHub - 评估操作结果
我想在执行 GitHub 操作时生成关于通过和失败测试的统计信息。基于 parents
计数我打算区分合并操作和单个提交。小代码片段工作正常,但在确定作者姓名后崩溃:
import github
g = github.Github()
repo_ref = "TUBAF-IfI-LiaScript/VL_EingebetteteSysteme"
repo = g.get_repo(repo_ref)
workflow_runs = repo.get_workflow_runs()
for run in workflow_runs:
print(run.head_commit.author.name)
print(len(run.head_commit.parents))
显然,该信息不可用。
Traceback (most recent call last):
File "/home/zug/Desktop/DiP-iT/xAPI_for_GitHubData/checkActionState.py",line 33,in <module>
print(len(run.head_commit.parents))
File "/home/zug/.local/share/virtualenvs/xAPI_for_GitHubData-shkqPS1V/lib/python3.8/site-packages/github/GitCommit.py",line 81,in parents
self._completeIfNotSet(self._parents)
File "/home/zug/.local/share/virtualenvs/xAPI_for_GitHubData-shkqPS1V/lib/python3.8/site-packages/github/GithubObject.py",line 294,in _completeIfNotSet
self._completeIfNeeded()
File "/home/zug/.local/share/virtualenvs/xAPI_for_GitHubData-shkqPS1V/lib/python3.8/site-packages/github/GithubObject.py",line 298,in _completeIfNeeded
self.__complete()
File "/home/zug/.local/share/virtualenvs/xAPI_for_GitHubData-shkqPS1V/lib/python3.8/site-packages/github/GithubObject.py",line 302,in __complete
raise GithubException.IncompletableObject(
github.GithubException.IncompletableObject: 400 "Returned object contains no URL"
我是否误解了 PyGitHub-API?
祝您身体健康!
塞巴斯蒂安
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。