PyGithub 不更新文件 完整代码:

问题描述

我正在尝试更新存储在 GitHub 存储库中的个人资料图片。我按照指南在 PyGithub 中找到了 update_file()。我这样使用 update_file()repo.update_file("filename","commit_message",content,sha)。我没有收到任何错误或任何错误,当我查看 GitHub 页面时,我可以看到它没有更新。我错过了什么?

完整代码

g = Github(token)
Pfp_Database = g.get_user().get_repo("AccountPfps")
pfp_file = Pfp_Database.get_contents(f"/{user}.png")
Pfp_Database.update_file(path=u.path,content=content,message="Profile Picture Updated",sha=pfp_file.sha)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)