Skip to content

Commit 3993e3d

Browse files
committed
fix: GitHub tracking failing on missing author in a commit.
1 parent ee7eb92 commit 3993e3d

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

fame/github_tracker.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -212,17 +212,19 @@ def _update_latest_commits(self, repo, avatars):
212212
# Chop 'Z' out of the timestamp.
213213
commit_date = c['commit']['author']['date'][:-1]
214214
author = c['author']['login']
215+
216+
if author in RepoTracker.KNOWN_BOTS:
217+
print('i Skipping bot commit %s by %s' % (sha, author))
218+
continue
219+
215220
avatars[author] = c['author']['avatar_url']
221+
222+
commit = pb.Commit(
223+
sha=sha, timestamp=commit_date, username=author)
224+
commits.append(commit)
216225
except:
217226
print('w Author, date, or avatar missing. Skipping %s' % sha)
218227

219-
if author in RepoTracker.KNOWN_BOTS:
220-
print('i Skipping bot commit %s by %s' % (sha, author))
221-
continue
222-
223-
commit = pb.Commit(sha=sha, timestamp=commit_date, username=author)
224-
commits.append(commit)
225-
226228
# We need to keep just last week's worth of commits.
227229
commits.extend(repo.recent_commits)
228230
while commits and dateparser.parse(commits[-1].timestamp) < since:

0 commit comments

Comments
 (0)