Skip to content

Commit

Permalink
Plugin for GitHub
Browse files Browse the repository at this point in the history
Signed-off-by: ganeshhubale <[email protected]>
  • Loading branch information
ganeshhubale committed Aug 29, 2018
1 parent 0da4429 commit ecb5139
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions plugins/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
import os


list_of_pull_requests=[]
list_of_pull_requests = []


def get_pull_requests(username, repository):

def get_pull_requests(username,repository):
github_url = "https://api.github.com"
r = requests.get(os.path.join(github_url, "repos", repository, "pulls"))
js = json.loads(r.content)
for i in range(0, len(js)):
if username == js[i]['user']['login']:
if 'title' in js[i].keys():
list_of_pull_requests.append(js[i]['title'])
for pull in js:
if username == pull['user']['login']:
if 'title' in pull.keys():
list_of_pull_requests.append(pull['title'])
return list_of_pull_requests

0 comments on commit ecb5139

Please sign in to comment.