Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions gh_org_mgr/_gh_org.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,16 @@ def _check_configured_org_owners(self) -> bool:
return True

def _is_user_authenticated_user(self, user: NamedUser) -> bool:
"""Check if a given NamedUser is the authenticated user"""
if user.login == self.gh.get_user().login:
return True
"""Check if a given NamedUser is the authenticated user. If logging in via App, this will
always return False, as the authenticated user is the App itself"""
try:
if user.login == self.gh.get_user().login:
return True
except GithubException as e:
if e.status == 403 and "Resource not accessible by integration" in str(e):
logging.debug("Cannot check if user is authenticated, as this is an App login")
return False
raise
return False

def sync_org_owners(self, dry: bool = False, force: bool = False) -> None:
Expand Down
Loading