From 61f9b2eb5fe6613f4e8e47e79916bf0458093819 Mon Sep 17 00:00:00 2001 From: nikitamalinov Date: Thu, 22 Feb 2024 22:54:30 -0800 Subject: [PATCH] . --- services/github/labeled_issue.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/services/github/labeled_issue.py b/services/github/labeled_issue.py index f1870cd3..2ad29ec8 100644 --- a/services/github/labeled_issue.py +++ b/services/github/labeled_issue.py @@ -8,6 +8,7 @@ import git import jwt import openai +import subprocess # Local imports from agent.coders import Coder @@ -18,8 +19,6 @@ from .github_manager import github_access_token - - async def handle_issue_labeled(payload: GitHubLabeledPayload): label: str = payload["label"]["name"] model = '' @@ -37,6 +36,12 @@ async def handle_issue_labeled(payload: GitHubLabeledPayload): new_uuid = uuid.uuid4() + repo_dir = '/tmp/repo' + os.makedirs(repo_dir, exist_ok=True) + print('make dir') + subprocess.run(['git', 'clone', f' https://x-access-token:{token}@github.com/nikitamalinov/lalager.git', repo_dir], check=True) + print('FINISHED') + return # Create and get into tmp folder original_path: str = os.getcwd() tmp_folder = '/tmp' @@ -47,11 +52,9 @@ async def handle_issue_labeled(payload: GitHubLabeledPayload): os.chdir(tmp_folder) try: - print('listing: ') - os.system(f'ls') - print('current dir: ') - os.system(f'pwd') - print("created folder") + repo_dir = '/tmp/repo' + os.makedirs(repo_dir, exist_ok=True) + subprocess.run(['git', 'clone', f' https://x-access-token:{token}@github.com/nikitamalinov/lalager.git', repo_dir], check=True) print(f'git clone https://x-access-token:{token}@github.com/nikitamalinov/lalager.git') print('listing: ')