From 240ca1f6bb056059619b53fd2dc45203b40dabfd Mon Sep 17 00:00:00 2001 From: Victor Jouffrey Date: Fri, 5 Apr 2024 11:49:29 +0200 Subject: [PATCH] Fix to point to correct commit not just branch --- auto_doc.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/auto_doc.py b/auto_doc.py index 716909bcf..b5a42c1a1 100644 --- a/auto_doc.py +++ b/auto_doc.py @@ -181,16 +181,22 @@ } hw_dir = pathlib.Path(__file__).resolve().parents[0] -if "GITHUB_BASE_REF" in os.environ: - branch_name = os.environ["GITHUB_BASE_REF"] +if "GITHUB_SHA" in os.environ: + commit_sha = os.environ["GITHUB_SHA"] + project_url = ( + f"https://github.com/logicalclocks/feature-store-api/tree/{commit_sha}/python" + ) else: - branch_name = "master" + branch_name = os.environ.get("GITHUB_BASE_REF", "master") + project_url = ( + f"https://github.com/logicalclocks/feature-store-api/blob/{branch_name}/python" + ) def generate(dest_dir): doc_generator = keras_autodoc.DocumentationGenerator( PAGES, - project_url=f"https://github.com/logicalclocks/hopsworks-api/blob/{branch_name}/python", + project_url=project_url, template_dir="./docs/templates", titles_size="###", extra_aliases={},