Skip to content

Commit

Permalink
Attempt to fix datetime error in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
uubk committed Nov 11, 2023
1 parent f159452 commit 4d41529
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gitsync/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from gitsync.api import GitProvider, GitProject
from github import Github, Repository
from urllib.parse import urlparse
from datetime import datetime, timedelta
from datetime import datetime, timedelta, timezone


class GitHubProject(GitProject):
Expand Down Expand Up @@ -44,7 +44,7 @@ def get_active_branches(self, active_time=timedelta(days=40)) -> List[str]:

for branch in self.__branches__:
last_commit = branch.commit.commit.committer.date
if datetime.now() - last_commit <= active_time:
if datetime.now(timezone.utc) - last_commit <= active_time:
branches.add(branch.name)
elif branch.protected:
branches.add(branch.name)
Expand Down

0 comments on commit 4d41529

Please sign in to comment.