@@ -80,15 +80,8 @@ def update_module_hash(build_dir: Path, sentinel_files: list[Path]) -> None:
8080 parser .add_argument (
8181 "--debug" , help = "Enable Debugging via debugpy" , action = "store_true"
8282 )
83- # optional GitHub user forwarded from the Bazel CLI
84- parser .add_argument (
85- "--github_user" ,
86- help = "GitHub username to embed in the Sphinx build" ,
87- )
88- parser .add_argument (
89- "--github_repo" ,
90- help = "GitHub repository to embed in the Sphinx build" ,
91- )
83+ parser .add_argument ("--github_user" , help = argparse .SUPPRESS )
84+ parser .add_argument ("--github_repo" , help = argparse .SUPPRESS )
9285 parser .add_argument (
9386 "--port" ,
9487 type = int ,
@@ -140,12 +133,16 @@ def update_module_hash(build_dir: Path, sentinel_files: list[Path]) -> None:
140133 metamodel_yaml = os .path .abspath (metamodel_yaml )
141134 base_arguments .append (f"--define=score_metamodel_yaml={ metamodel_yaml } " )
142135
143- # configure sphinx build with GitHub user and repo from CLI
144- if args .github_user and args .github_repo :
145- base_arguments .append (f"-A=github_user={ args .github_user } " )
146- base_arguments .append (f"-A=github_repo={ args .github_repo } " )
136+ if github_repository := os .getenv ("GITHUB_REPOSITORY" ):
137+ # GITHUB_REPOSITORY is expected as "owner/repo"; partition("/") splits
138+ # once into (owner, separator, repo), so we can ignore the separator.
139+ github_user , _ , github_repo = github_repository .partition ("/" )
140+
141+ base_arguments .append (f"-A=github_user={ github_user } " )
142+ base_arguments .append (f"-A=github_repo={ github_repo } " )
147143 base_arguments .append ("-A=github_version=main" )
148144 base_arguments .append (f"-A=doc_path={ get_env ('SOURCE_DIRECTORY' )} " )
145+
149146 if os .getenv ("KNOWN_GOOD_JSON" ):
150147 base_arguments .append (f"--define=KNOWN_GOOD_JSON={ get_env ('KNOWN_GOOD_JSON' )} " )
151148
0 commit comments