File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -201,9 +201,16 @@ def _check_configured_org_owners(self) -> bool:
201201 return True
202202
203203 def _is_user_authenticated_user (self , user : NamedUser ) -> bool :
204- """Check if a given NamedUser is the authenticated user"""
205- if user .login == self .gh .get_user ().login :
206- return True
204+ """Check if a given NamedUser is the authenticated user. If logging in via App, this will
205+ always return False, as the authenticated user is the App itself"""
206+ try :
207+ if user .login == self .gh .get_user ().login :
208+ return True
209+ except GithubException as e :
210+ if e .status == 403 and "Resource not accessible by integration" in str (e ):
211+ logging .debug ("Cannot check if user is authenticated, as this is an App login" )
212+ return False
213+ raise
207214 return False
208215
209216 def sync_org_owners (self , dry : bool = False , force : bool = False ) -> None :
You can’t perform that action at this time.
0 commit comments