Accept api.github.com URLs as well
On https://github.com/kata-containers/tests/pull/1165, for some reason the URL passed to our WIP-check was from api.github.com instead of the expected github.com, triggering a regexp extraction error. From now on, accept any hostname and just extract repository and pull request number at the end of the URL. Change-Id: I79b4d96a84273a97f64b3350e3bd58e8646f0f0f Closes: https://github.com/kata-containers/ci/issues/111
This commit is contained in:
parent
36355d4f93
commit
23ac8e6201
|
@ -26,7 +26,7 @@ import urllib.request
|
|||
|
||||
|
||||
def get_github_PR(change_url):
|
||||
match = re.search('https://github.com/(.+)/pull/(\d+)', change_url)
|
||||
match = re.search(r".*/([^/]+/[^/]+)/pulls?/(\d+)", change_url)
|
||||
repository = match.group(1)
|
||||
prnumber = match.group(2)
|
||||
|
||||
|
|
Loading…
Reference in New Issue