Update app.py
Browse files
app.py
CHANGED
|
@@ -88,7 +88,10 @@ def process_input(file, github_url, ssh_private_key, gemini_api_key):
|
|
| 88 |
if file is not None:
|
| 89 |
file_content = {file.name: file.read().decode('utf-8')}
|
| 90 |
elif github_url and ssh_private_key:
|
| 91 |
-
|
|
|
|
|
|
|
|
|
|
| 92 |
file_content = fetch_github_file(github_url, ssh_private_key)
|
| 93 |
if isinstance(file_content, str) and file_content.startswith("Error:"):
|
| 94 |
return file_content
|
|
|
|
| 88 |
if file is not None:
|
| 89 |
file_content = {file.name: file.read().decode('utf-8')}
|
| 90 |
elif github_url and ssh_private_key:
|
| 91 |
+
if not re.match(r'^git@github\.com:.+/.+\.git$', github_url):
|
| 92 |
+
return "Error: Invalid GitHub SSH URL. Please use the format: git@github.com:username/repository.git"
|
| 93 |
+
if not ssh_private_key.strip():
|
| 94 |
+
return "Error: SSH Private Key is empty. Please provide a valid key."
|
| 95 |
file_content = fetch_github_file(github_url, ssh_private_key)
|
| 96 |
if isinstance(file_content, str) and file_content.startswith("Error:"):
|
| 97 |
return file_content
|