The following accesses the data from a text file on git hub.
repoName = 'repo_url'
filePath = 'file.txt'
from github import Github
g = Github(TOKEN)
repo = g.get_repo(repoName)
file = repo.get_contents(filePath)
data = file.decoded_content.decode("utf-8")
I want to add a new line to the data
and push that to the file github repo.
data += "\n A new line"
I've been going through the api and googling, but I can't seem to find the best way to do this.