From 2f642db61a10825dccae2c300e095d251d0e6542 Mon Sep 17 00:00:00 2001 From: Stewie Date: Sun, 10 Apr 2022 17:37:01 -0400 Subject: [PATCH] Create functions for interacting with our Repos --- RepoFunctions.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 RepoFunctions.py diff --git a/RepoFunctions.py b/RepoFunctions.py new file mode 100644 index 0000000..2512716 --- /dev/null +++ b/RepoFunctions.py @@ -0,0 +1,19 @@ +import requests +import json + +def get_Releases(org, repo_name, latest=False): + + #git_url = "https://api.github.com/repos/SymphoniaLauren/Tales-of-Rebirth/releases" + git_url = "https://api.github.com/repos/{}/{}/releases".format(org, repo_name) + + if latest: + git_url = git_url+"/latest" + + header = { + "Accept":"application/vnd.github.v3+json" + } + + res = requests.get(git_url) + json_res = json.loads(res.text) + + return json_res \ No newline at end of file