Skip to content

Commit

Permalink
Allow for no date constraints
Browse files Browse the repository at this point in the history
Signed-off-by: Zack Koppert <[email protected]>
  • Loading branch information
zkoppert committed Oct 5, 2023
1 parent 8ad7077 commit 24a88b4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion commits.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ def get_commits(
author: str, repo: object, github_connection: object, start_date: str, end_date: str
) -> github3.search.commit.CommitSearchResult:
"""Get commit information for a single author from the repository"""
search_dates = ""
if start_date and end_date:
search_dates = f" committer-date:{start_date}..{end_date}"

commits = github_connection.search_commits(
f"repo:{repo.full_name} author:{author} merge:false committer-date:{start_date}..{end_date}"
f"repo:{repo.full_name} author:{author} merge:false {search_dates}"
)
return commits

0 comments on commit 24a88b4

Please sign in to comment.