Lines of Code committer

It worked for the README, so let's see if it works for the charts.
This commit is contained in:
Aaron Meese
2020-08-10 08:16:13 -05:00
parent 8376e63791
commit 7566684749

5
loc.py
View File

@@ -81,10 +81,11 @@ class LinesOfCode:
def pushChart(self): def pushChart(self):
repo = self.g.get_repo(f"{self.username}/{self.username}") repo = self.g.get_repo(f"{self.username}/{self.username}")
committer = InputGitAuthor('readme-bot', 'readme-bot@example.com')
with open('bar_graph.png', 'rb') as input_file: with open('bar_graph.png', 'rb') as input_file:
data = input_file.read() data = input_file.read()
try: try:
contents = repo.get_contents("charts/bar_graph.png") contents = repo.get_contents("charts/bar_graph.png")
repo.update_file(contents.path, "Charts Added", data, contents.sha) repo.update_file(contents.path, "Charts Updated", data, contents.sha, committer)
except Exception as e: except Exception as e:
repo.create_file("charts/bar_graph.png", "Initial Commit", data) repo.create_file("charts/bar_graph.png", "Charts Added", data, committer)