docs/changes/repo_url: handle PR refs
Signed-off-by: Unai Martinez-Corral <umartinezcorral@antmicro.com>
This commit is contained in:
parent
eb25aa6b2b
commit
1b15ba70bb
|
@ -28,11 +28,17 @@ ROOT = Path(__file__).resolve().parent
|
||||||
|
|
||||||
def repo_url(repo, value):
|
def repo_url(repo, value):
|
||||||
ref = value
|
ref = value
|
||||||
|
url = 'commit'
|
||||||
|
parts = None
|
||||||
if '@' in value:
|
if '@' in value:
|
||||||
parts = value.split('@')
|
parts = value.split('@')
|
||||||
repo = parts[0]
|
if '#' in value:
|
||||||
ref = parts[1]
|
parts = value.split('#')
|
||||||
return f'https://github.com/{repo}/commit/{ref}'
|
if parts is not None:
|
||||||
|
url = 'pull'
|
||||||
|
repo = parts[0]
|
||||||
|
ref = parts[1]
|
||||||
|
return f'https://github.com/{repo}/{url}/{ref}'
|
||||||
|
|
||||||
|
|
||||||
def generate_changes_inc():
|
def generate_changes_inc():
|
||||||
|
|
Loading…
Reference in New Issue