feat: add mixed strategy for repository mirroring, enhancing organization handling for personal and organizational repos

This commit is contained in:
Arunavo Ray
2025-06-24 13:51:43 +05:30
parent 4d8d75c8a6
commit b660d2dd9a
7 changed files with 131 additions and 9 deletions

View File

@@ -136,6 +136,19 @@ export const getGiteaRepoOwner = ({
// All non-starred repos go under the user account
return config.giteaConfig.username;
case "mixed":
// Mixed mode: personal repos to single org, organization repos preserve structure
if (repository.organization) {
// Organization repos preserve their structure
return repository.organization;
}
// Personal repos go to configured organization (same as single-org)
if (config.giteaConfig.organization) {
return config.giteaConfig.organization;
}
// Fallback to username if no organization specified
return config.giteaConfig.username;
default:
// Default fallback
return config.giteaConfig.username;