From ed1f08ba5b02d646932b65f75467c432d7fff13a Mon Sep 17 00:00:00 2001 From: Olivier Mehani Date: Tue, 4 Aug 2026 15:01:16 +1000 Subject: [PATCH] bug(auth): don't fail on missing `login` in app installation details Apps can be installed in enterprises, which don't have a `login`, but a `slug` field. By using `get` here, we protect against `KeyError`s in case some installations are for enterprises. This doesn't provide functional enterprise support (e.g., for https://github.com/mozilla-releng/simple-github/issues/196), but supports continuing operation for repos and orgs. --- src/simple_github/auth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/simple_github/auth.py b/src/simple_github/auth.py index 632e076..d2bc58e 100644 --- a/src/simple_github/auth.py +++ b/src/simple_github/auth.py @@ -144,7 +144,7 @@ async def _get_installation_id(self) -> str: assert isinstance(installations, list) for installation in installations: - if installation["account"]["login"] == self.owner: + if installation["account"].get("login") == self.owner: return installation["id"] raise Exception(