Skip to content

Commit 131e059

Browse files
committed
refactor: update git clone commands inside docker
1 parent c3e370d commit 131e059

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

packaging_automation/common_tool_methods.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,8 +679,11 @@ def remove_suffix(initial_str: str, suffix: str) -> str:
679679

680680
def initialize_env(exec_path: str, project_name: str, checkout_dir: str):
681681
remove_cloned_code(f"{exec_path}/{checkout_dir}")
682+
gh_token = os.getenv("GH_TOKEN")
683+
if not gh_token:
684+
raise ValueError("GH_TOKEN environment variable is required")
682685
if not os.path.exists(checkout_dir):
683-
run(f"git clone https://github.com/citusdata/{project_name}.git {checkout_dir}")
686+
run(f"git clone https://x-access-token:{gh_token}@github.com/citusdata/{project_name}.git {checkout_dir}")
684687

685688

686689
def create_pr(

packaging_automation/tests/test_prepare_release.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def initialize_env() -> str:
4040
test_base_path_major = f"{BASE_PATH}/{uuid.uuid4()}"
4141
remove_cloned_code(test_base_path_major)
4242
if not os.path.exists(test_base_path_major):
43-
run(f"git clone https://github.com/citusdata/citus.git {test_base_path_major}")
43+
run(f"git clone https://x-access-token:{GH_TOKEN}@github.com/citusdata/citus.git {test_base_path_major}")
4444
return test_base_path_major
4545

4646

0 commit comments

Comments
 (0)