forked from cms-sw/cms-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget-pr-branch
More file actions
executable file
·26 lines (23 loc) · 783 Bytes
/
Copy pathget-pr-branch
File metadata and controls
executable file
·26 lines (23 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env python
from sys import exit, argv
from os.path import expanduser
from github import Github
from socket import setdefaulttimeout
setdefaulttimeout(120)
if __name__ == "__main__":
prId = int(argv[1])
gh = Github(login_or_token=open(expanduser("~/.github-token")).read().strip())
try:
pr = gh.get_repo( 'cms-sw/cmssw' ).get_pull(prId)
except Exception as ex:
print "Could not find pull request %s. Maybe this is an issue" % prId
print ex
exit(1)
if pr.base.ref == "master":
from releases import CMSSW_DEVEL_BRANCH
from commands import getstatusoutput
e, o = getstatusoutput("curl -s -L https://cmssdt.cern.ch/SDT/BaselineDevRelease | grep '^CMSSW_'")
if not o: o = CMSSW_DEVEL_BRANCH
print o
else:
print pr.base.ref