Skip to content

Commit 240ca1f

Browse files
committed
Fix to point to correct commit not just branch
1 parent 5813d39 commit 240ca1f

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

auto_doc.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -181,16 +181,22 @@
181181
}
182182

183183
hw_dir = pathlib.Path(__file__).resolve().parents[0]
184-
if "GITHUB_BASE_REF" in os.environ:
185-
branch_name = os.environ["GITHUB_BASE_REF"]
184+
if "GITHUB_SHA" in os.environ:
185+
commit_sha = os.environ["GITHUB_SHA"]
186+
project_url = (
187+
f"https://github.com/logicalclocks/feature-store-api/tree/{commit_sha}/python"
188+
)
186189
else:
187-
branch_name = "master"
190+
branch_name = os.environ.get("GITHUB_BASE_REF", "master")
191+
project_url = (
192+
f"https://github.com/logicalclocks/feature-store-api/blob/{branch_name}/python"
193+
)
188194

189195

190196
def generate(dest_dir):
191197
doc_generator = keras_autodoc.DocumentationGenerator(
192198
PAGES,
193-
project_url=f"https://github.com/logicalclocks/hopsworks-api/blob/{branch_name}/python",
199+
project_url=project_url,
194200
template_dir="./docs/templates",
195201
titles_size="###",
196202
extra_aliases={},

0 commit comments

Comments
 (0)