Skip to content

Commit

Permalink
fix: use ref param instead of branch for get_required_deps (GitHub co…
Browse files Browse the repository at this point in the history
…ntents API) (frappe#1362)

* fix: use ref param instead of branch

* fix: use ref param instead of branch

* chore: unintentional changes from web editor

Co-authored-by: Ankush Menat <ankush@frappe.io>
  • Loading branch information
FHenry and ankush authored Aug 28, 2022
1 parent 589f7a4 commit 9131ba0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bench/utils/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@ def get_required_deps(org, name, branch, deps="hooks.py"):
import base64

git_api_url = f"https://api.github.com/repos/{org}/{name}/contents/{name}/{deps}"
params = {"branch": branch or "develop"}
params = {"ref": branch or "develop"}
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']}/{name}/{deps}"
git_url = f"https://raw.githubusercontent.com/{org}/{name}/{params['ref']}/{name}/{deps}"
return requests.get(git_url).text

return base64.decodebytes(res["content"].encode()).decode()
Expand Down

0 comments on commit 9131ba0

Please sign in to comment.