From 30aa832e3cfc709199454e72a8d2680b312ab839 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Sat, 21 Jul 2018 08:20:00 +0200 Subject: [PATCH] [fix] don't fail on not managing to get master commit --- run.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/run.py b/run.py index 10f5948..bc103cd 100644 --- a/run.py +++ b/run.py @@ -77,6 +77,11 @@ async def monitor_apps_lists(): async with session.get(f"https://api.github.com/repos/{organization}/{app_id}_ynh/branches/master", headers={"Authorization": f"token {app.config.github_token}"}) as response: data = await response.json() try: + if "commit" not in data and data['message'] == 'Not Found': + # XXX sucks + task_logger.warning(f"Application {app_id} is not available on github at https://github.com/yunohost-apps/{app_id}_ynh") + return None + commit_sha = data["commit"]["sha"] except Exception as e: import traceback