diff --git a/bench/utils/app.py b/bench/utils/app.py index eedd2400..434af655 100644 --- a/bench/utils/app.py +++ b/bench/utils/app.py @@ -171,9 +171,14 @@ def get_required_deps(org, name, branch, deps="hooks.py"): import requests import base64 - url = f"https://api.github.com/repos/{org}/{name}/contents/{name}/{deps}" + git_api_url = f"https://api.github.com/repos/{org}/{name}/contents/{name}/{deps}" params = {"branch": branch or "develop"} - res = requests.get(url=url, params=params).json() + res = requests.get(url=git_api_url, params=params).json() + + if "message" in res: + git_url = f"https://raw.githubusercontent.com/{org}/{name}/{params['branch']}/{deps}" + return requests.get(git_url).text + return base64.decodebytes(res["content"].encode()).decode()