Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(devchat): correct update_custom_workflows return statements #414

Merged
merged 3 commits into from
Sep 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions devchat/_service/route/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,12 @@ def update_custom_workflows():
updated_any = True
update_messages = []

for url in custom_git_urls:
repo_name = url.split("/")[-1].replace(".git", "") # 提取repo名称
for item in custom_git_urls:
git_url = item["git_url"]
branch = item["branch"]
repo_name = git_url.split("/")[-1].replace(".git", "") # 提取repo名称
repo_path: Path = base_path / repo_name # 拼接出clone路径
candidates_git_urls = [(url, "main")]
candidates_git_urls = [(git_url, branch)]

if repo_path.exists():
logger.info(f"Repo path not empty {repo_path}, removing it.")
Expand Down Expand Up @@ -132,7 +134,7 @@ def update_custom_workflows():
return response.UpdateWorkflows(updated=updated_any, message=message_summary)
else:
return response.UpdateWorkflows(
False, "No custom_git_urls found in .chat/config.yaml"
updated=False, message="No custom_git_urls found in .chat/config.yaml"
)
else:
return response.UpdateWorkflows(False, "No .chat config found")
return response.UpdateWorkflows(updated=False, message="No .chat config found")
Loading