Return the number of recent commits by the author, up to max_count.
(pr_author, repo, token, since_days, max_count)
| 108 | |
| 109 | |
| 110 | def get_recent_commit_count(pr_author, repo, token, since_days, max_count): |
| 111 | """Return the number of recent commits by the author, up to max_count.""" |
| 112 | if not pr_author: |
| 113 | return 0 |
| 114 | |
| 115 | since = (datetime.now(timezone.utc) - timedelta(days=since_days)).strftime( |
| 116 | "%Y-%m-%dT%H:%M:%SZ" |
| 117 | ) |
| 118 | results = github_request( |
| 119 | "GET", |
| 120 | "/commits", |
| 121 | token, |
| 122 | repo, |
| 123 | params={"author": pr_author, "since": since, "per_page": max_count}, |
| 124 | ) |
| 125 | return len(results) |
| 126 | |
| 127 | |
| 128 | def get_pr_total_changes(pr_number, repo, token): |
no test coverage detected