File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1
1
import os
2
- from datetime import datetime
2
+ from datetime import datetime , timedelta
3
3
from github import Github
4
4
from sendgrid import SendGridAPIClient
5
5
from sendgrid .helpers .mail import Mail , Email , To , Content
@@ -10,7 +10,8 @@ def get_project_stats(repo):
10
10
closed_issues = repo .get_issues (state = 'closed' )
11
11
12
12
# Get recent activity
13
- recent_commits = list (repo .get_commits (since = datetime .now ().replace (hour = 0 , minute = 0 )))
13
+ twenty_four_hours_ago = datetime .now () - timedelta (days = 1 )
14
+ recent_commits = list (repo .get_commits (since = twenty_four_hours_ago ))
14
15
15
16
stats = {
16
17
'open_issues_count' : repo .open_issues_count ,
@@ -29,7 +30,7 @@ def create_email_body(repo_name, stats):
29
30
Project Statistics:
30
31
- Open Issues: { stats ['open_issues_count' ]}
31
32
- Closed Issues: { stats ['closed_issues_count' ]}
32
- - Commits Today : { stats ['recent_commits' ]}
33
+ - Commits (Last 24h) : { stats ['recent_commits' ]}
33
34
34
35
View project: https://github.com/{ repo_name }
35
36
"""
You can’t perform that action at this time.
0 commit comments