Skip to content

Commit

Permalink
Merge pull request #13 from firmai/last_commit_date
Browse files Browse the repository at this point in the history
added last commit date
  • Loading branch information
bin-yang-algotune authored Mar 30, 2021
2 parents a823636 + dca72cc commit b61e715
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion git_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@
from conf import PROJECT_ROOT_DIR
import re
import pandas as pd
from github import Github
from github import Github, Repository


def get_last_commit_date(input_repo: Repository):
"""
get latest commit from repo
:param input_repo:
:return:
"""
page = input_repo.get_commits().get_page(0)[0]
return page.commit.author.date


def get_repo_status():
Expand All @@ -19,6 +29,7 @@ def get_repo_status():
try:
repo = g.get_repo(url_format)
repo_df.loc[idx, 'created_at'] = repo.created_at
repo_df.loc[idx, 'last_commit'] = get_last_commit_date(repo)
repo_df.loc[idx, 'last_update'] = repo.updated_at
repo_df.loc[idx, 'star_count'] = repo.stargazers_count
repo_df.loc[idx, 'fork_count'] = repo.forks_count
Expand Down

0 comments on commit b61e715

Please sign in to comment.