docs/changes/repo_url: handle PR refs

Signed-off-by: Unai Martinez-Corral <umartinezcorral@antmicro.com>
This commit is contained in:
Unai Martinez-Corral 2022-08-20 12:33:04 +02:00
parent eb25aa6b2b
commit 1b15ba70bb
1 changed files with 10 additions and 4 deletions

View File

@ -28,11 +28,17 @@ ROOT = Path(__file__).resolve().parent
def repo_url(repo, value):
ref = value
url = 'commit'
parts = None
if '@' in value:
parts = value.split('@')
repo = parts[0]
ref = parts[1]
return f'https://github.com/{repo}/commit/{ref}'
parts = value.split('@')
if '#' in value:
parts = value.split('#')
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():