in pr2relnotes.py [0:0]
def get_org(repourl):
"""
Simple function to parse the organization out of a GitHub URL
"""
dprint("Current repourl to search: " + repourl)
# GitHub URLs can be:
# http[s]://www.github.com/org/repo
# or git@github.com:/org/repo
pattern = re.compile(r"github.com[/:]+(\w+)/")
m = re.search(pattern, repourl)
# Fail fast if this is wrong so we can add a pattern to the search
if m:
return m.group(1)
else:
raise Exception("Incorrect regex pattern finding repo org")