diff --git a/scripts/pr_link_docs.py b/scripts/pr_link_docs.py index d7c38bb183a0..be669ad8490a 100755 --- a/scripts/pr_link_docs.py +++ b/scripts/pr_link_docs.py @@ -17,7 +17,10 @@ LINK_START = "" LINK_END = "" -LINK_TEMPLATE = "\nDocs preview: {{ link }}\n" +LINK_TEMPLATE = """ +Docs preview: {{ docs-link }} +Examples preview: {{ examples-link }} +""" def main() -> None: @@ -34,8 +37,10 @@ def main() -> None: latest_commit = pr.get_commits().reversed[0] print(f"Latest commit: {latest_commit.sha}") + short_sha = latest_commit.sha[:7] - link = LINK_TEMPLATE.replace("{{ link }}", f"https://rerun.io/preview/{latest_commit.sha[:7]}/docs") + link = LINK_TEMPLATE.replace("{{ docs-link }}", f"https://rerun.io/preview/{short_sha}/docs") + link = link.replace("{{ examples-link }}", f"https://rerun.io/preview/{short_sha}/examples") if EMPTY_LINK in pr.body: print("Empty link found, updating it") new_body = pr.body.replace(EMPTY_LINK, link)