INNER CODE UNIT · Python
extract_project_path
phasehq/console · backend/api/utils/syncing/gitlab/main.py:164
def extract_project_path(repo_url):
"""
Extract the project or group path from the repository URL.
This function uses a regular expression to parse the GitLab project or group path from a given URL.
"""
repo_url = repo_url.rstrip("/")
domain_match = re.search(r"https?://[^/]+/(.+)", repo_url)
if not domain_match:
return None
return domain_match.group(1)
def sync_gitlab_secrets(
secrets,
credential_id,
destination_url,
is_group=False,
is_masked=False,