mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-27 14:25:20 +02:00
Merge branch 'git_token' into 'mgx_ops'
update: git.py See merge request pub/MetaGPT!380
This commit is contained in:
commit
ba6264a5b5
1 changed files with 1 additions and 4 deletions
|
|
@ -64,11 +64,8 @@ async def git_create_pull(
|
|||
Returns:
|
||||
PullRequest: The created pull request.
|
||||
"""
|
||||
|
||||
from metagpt.tools.libs import get_env
|
||||
from metagpt.utils.git_repository import GitRepository
|
||||
|
||||
access_token = await get_env(key="access_token", app_name=app_name)
|
||||
git_credentials_path = Path.home() / ".git-credentials"
|
||||
with open(git_credentials_path, "r", encoding="utf-8") as f:
|
||||
lines = f.readlines()
|
||||
|
|
@ -78,7 +75,7 @@ async def git_create_pull(
|
|||
if not line:
|
||||
continue
|
||||
parsed_url = urllib.parse.urlparse(line)
|
||||
if parsed_url.hostname == app_name:
|
||||
if app_name in parsed_url.hostname:
|
||||
colon_index = parsed_url.netloc.find(":")
|
||||
at_index = parsed_url.netloc.find("@")
|
||||
access_token = parsed_url.netloc[colon_index + 1 : at_index]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue