33
44EMPTY_FIELD = 'Empty field'
55
6-
76def login (token ):
87 client = Github (login_or_token = token )
98 try :
@@ -32,7 +31,7 @@ def get_next_repo(client: Github, repositories):
3231
3332
3433def log_commit_to_csv (info , csv_name ):
35- fieldnames = ['repository name' , 'author name' , 'author login' , 'author email' , 'date and time' , 'changed files' ]
34+ fieldnames = ['repository name' , 'commit id' , ' author name' , 'author login' , 'author email' , 'date and time' , 'changed files' ]
3635 with open (csv_name , 'a' , newline = '' ) as file :
3736 writer = csv .DictWriter (file , fieldnames = fieldnames )
3837 writer .writerow (info )
@@ -46,6 +45,7 @@ def log_repository_commits(repository: Repository, csv_name):
4645 for commit in repository .get_commits ():
4746 if commit .commit is not None :
4847 info = {'repository name' : repository .full_name ,
48+ 'commit id' : commit .commit .sha ,
4949 'author name' : commit .commit .author .name ,
5050 'author login' : EMPTY_FIELD ,
5151 'author email' : EMPTY_FIELD ,
@@ -244,6 +244,7 @@ def log_commits(client: Github, repositories, csv_name):
244244 writer .writerow (
245245 (
246246 'repository name' ,
247+ 'commit id' ,
247248 'author name' ,
248249 'author login' ,
249250 'author email' ,
0 commit comments