Skip to content

Commit

Permalink
fix(github): update namespace and repo on 301
Browse files Browse the repository at this point in the history
Related to #781

Signed-off-by: Matej Focko <[email protected]>
  • Loading branch information
mfocko committed Dec 11, 2024
1 parent 809d63a commit cf2bb46
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ogr/services/github/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ def github_repo(self):
self._github_repo = self.github_instance.get_repo(
full_name_or_id=f"{self.namespace}/{self.repo}",
)

# Handle possible 301
if (
self._github_repo.owner.login != self.namespace
or self._github_repo.name != self.repo
):
(self.namespace, self.repo) = (
self._github_repo.owner.login,
self._github_repo.name,
)
return self._github_repo

def __str__(self) -> str:
Expand Down

0 comments on commit cf2bb46

Please sign in to comment.