mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-20 23:44:19 +01:00
move git operations
This commit is contained in:
13
autogpt/git_operations.py
Normal file
13
autogpt/git_operations.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import git
|
||||
from config import Config
|
||||
|
||||
cfg = Config()
|
||||
|
||||
def clone_repository(repo_url, clone_path):
|
||||
"""Clone a github repository locally"""
|
||||
split_url = repo_url.split("//")
|
||||
auth_repo_url = f"//{cfg.github_username}:{cfg.github_api_key}@".join(split_url)
|
||||
git.Repo.clone_from(auth_repo_url, clone_path)
|
||||
result = f"""Cloned {repo_url} to {clone_path}"""
|
||||
|
||||
return result
|
||||
Reference in New Issue
Block a user