You've already forked wakapi-readme-stats
Lines of Code committer
It worked for the README, so let's see if it works for the charts.
This commit is contained in:
5
loc.py
5
loc.py
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user