I am developing a script which requires me to get a list of all commits for a particular repository, as well as the date and time of commit. The Commit Class in the PyGithub API:
https://github.com/jacquev6/PyGithub/blob/master/doc/ReferenceOfClasses.md#class-commit
does not have any member for date-of-commit and time-of-commit. Any ideas on how to get the date and time of a commit using the API?
I think you need to call
commit.getStatuses()
and in each satsus there is attributes created_at and updated_at
from here: https://github.com/jacquev6/PyGithub/blob/master/doc/ReferenceOfClasses.md#class-commitstatus
Class CommitStatus
Attributes:
from github import Github
gh = Github(base_url="", login_or_token="")
repo = gh.get_repo(repo_name)
#returned commits in a paginated list
commits = repo.get_commits()
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.