This commit is contained in:
Kayou 2021-01-22 10:44:10 +01:00 committed by GitHub
parent e3d2dc3046
commit 0136788358
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

2
run.py
View file

@ -1037,7 +1037,7 @@ async def github(request):
async def is_user_in_organization(user):
token = open("./github_bot_token").read().strip()
async with aiohttp.ClientSession(headers={"Authorization": f"token {token}", "Accept": "application/vnd.github.v3+json"}) as session:
await resp = session.get(f"https://api.github.com/orgs/YunoHost-Apps/members/{user}")
resp = await session.get(f"https://api.github.com/orgs/YunoHost-Apps/members/{user}")
return resp.status == 204
if not await is_user_in_organization(hook_infos["comment"]["user"]["login"]):