Refactored main.py into function files

This commit is contained in:
Kevin Veen-Birkenbach
2025-03-06 11:10:11 +01:00
parent 9f95d34b9c
commit fb9ea2e24b
23 changed files with 619 additions and 577 deletions

View File

@@ -0,0 +1,12 @@
def get_repo_identifier(repo, all_repos):
"""
Return a unique identifier for the repository.
If the repository name is unique among all_repos, return repository name;
otherwise, return 'provider/account/repository'.
"""
repo_name = repo.get("repository")
count = sum(1 for r in all_repos if r.get("repository") == repo_name)
if count == 1:
return repo_name
else:
return f'{repo.get("provider")}/{repo.get("account")}/{repo.get("repository")}'