私はどのメソッドを呼び出すべきか(そしてどのオブジェクトで)、どのメソッドを呼び出すべきか(必要なパラメータとその意味)を知りたい。PyGithubを使ってファイルを更新するには?
ありがとうございます!
私はどのメソッドを呼び出すべきか(そしてどのオブジェクトで)、どのメソッドを呼び出すべきか(必要なパラメータとその意味)を知りたい。PyGithubを使ってファイルを更新するには?
ありがとうございます!
import github
g = github.Github(token)
# or g = github.Github(login, password)
repo = g.get_user().get_repo("repo_name")
file = repo.get_file_contents("/your_file.txt")
# update
repo.update_file("/your_file.txt", "your_commit_message", "your_new_file_content", file.sha)
あなたはトークンを使用している場合、あなたはあなたのトークンの範囲 レポ少なくともそれをしなければならないはずです。 https://developer.github.com/v3/oauth/#scopes
を参照してください:開始するhttps://developer.github.com/v3/repos/contents/とhttps://github.com/PyGithub/PyGithub
PyGithub docsにはこれに関するリファレンスがありませんので、ありがとう! –
2箇所:https://developer.github.com/v3/repos/contents/とhttps://github.com/PyGithub/ PyGithub/blob/master/github/InputFileContent.py –