Skip to content

Commit 0da4429

Browse files
committed
List all open PRs made by particular user to particular repo. on GitHub
Signed-off-by: ganeshhubale <ganeshhubale03@gmail.com>
1 parent ff41eac commit 0da4429

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

plugins/github.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77

88
def get_pull_requests(username,repository):
99
github_url = "https://api.github.com"
10-
r = requests.get(os.path.join(github_url, "repos", username, repository, "pulls"))
10+
r = requests.get(os.path.join(github_url, "repos", repository, "pulls"))
1111
js = json.loads(r.content)
1212
for i in range(0, len(js)):
13-
if 'title' in js[i].keys():
14-
list_of_pull_requests.append(js[i]['title'])
13+
if username == js[i]['user']['login']:
14+
if 'title' in js[i].keys():
15+
list_of_pull_requests.append(js[i]['title'])
1516
return list_of_pull_requests

0 commit comments

Comments
 (0)