fix: Use github.com when github api rate is crossed
This commit is contained in:
parent
549d1bb02d
commit
112593fb5f
1 changed files with 4 additions and 2 deletions
|
|
@ -142,8 +142,10 @@ def find_org(org_repo: str) -> Tuple[str, str]:
|
|||
import requests
|
||||
|
||||
for org in ["frappe", "erpnext"]:
|
||||
res = requests.head(f"https://api.github.com/repos/{org}/{org_repo}")
|
||||
if res.ok:
|
||||
response = requests.head(f"https://api.github.com/repos/{org}/{org_repo}")
|
||||
if response.status_code == 400:
|
||||
response = requests.head(f"https://github.com/{org}/{org_repo}")
|
||||
if response.ok:
|
||||
return org, org_repo
|
||||
|
||||
raise InvalidRemoteException
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue