Skip to content

Commit

Permalink
temporary workaround for github issues (#4822)
Browse files Browse the repository at this point in the history
  • Loading branch information
cubismod authored Jan 23, 2025
1 parent a3765b0 commit dde29ad
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
13 changes: 8 additions & 5 deletions reconcile/utils/github_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
from types import TracebackType
from urllib.parse import urlparse

from github import (
Commit,
Github,
UnknownObjectException,
)
from github import Commit, Github, GithubException, UnknownObjectException
from sretoolbox.utils import retry

GH_BASE_URL = os.environ.get("GITHUB_API", "https://api.github.com")
Expand Down Expand Up @@ -75,6 +71,13 @@ def get_file(self, path: str, ref: str = "master") -> bytes | None:
# -> for now staying backwards compatible
return None
return content.decoded_content
except GithubException as e:
# handling a bug in the upstream GH library
# https://github.com/PyGithub/PyGithub/issues/3179
if e.status == 404:
return None
else:
raise e
except UnknownObjectException:
return None

Expand Down
6 changes: 3 additions & 3 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dde29ad

Please sign in to comment.