@@ -64,7 +64,7 @@ export const getGiteaRepoOwnerAsync = async ({
64
64
throw new Error ( "GitHub or Gitea config is required." ) ;
65
65
}
66
66
67
- if ( ! config . giteaConfig . username ) {
67
+ if ( ! config . giteaConfig . defaultOwner ) {
68
68
throw new Error ( "Gitea username is required." ) ;
69
69
}
70
70
@@ -96,11 +96,7 @@ export const getGiteaRepoOwnerAsync = async ({
96
96
}
97
97
}
98
98
99
- // Check for personal repos override (when it's user's repo, not an organization)
100
- if ( ! repository . organization && config . giteaConfig . personalReposOrg ) {
101
- console . log ( `Using personal repos override: ${ config . giteaConfig . personalReposOrg } ` ) ;
102
- return config . giteaConfig . personalReposOrg ;
103
- }
99
+ // For personal repos (not organization repos), fall back to the default strategy
104
100
105
101
// Fall back to existing strategy logic
106
102
return getGiteaRepoOwner ( { config, repository } ) ;
@@ -117,7 +113,7 @@ export const getGiteaRepoOwner = ({
117
113
throw new Error ( "GitHub or Gitea config is required." ) ;
118
114
}
119
115
120
- if ( ! config . giteaConfig . username ) {
116
+ if ( ! config . giteaConfig . defaultOwner ) {
121
117
throw new Error ( "Gitea username is required." ) ;
122
118
}
123
119
@@ -137,19 +133,19 @@ export const getGiteaRepoOwner = ({
137
133
return repository . organization ;
138
134
}
139
135
// Use personal repos override if configured, otherwise use username
140
- return config . giteaConfig . personalReposOrg || config . giteaConfig . username ;
136
+ return config . giteaConfig . defaultOwner ;
141
137
142
138
case "single-org" :
143
139
// All non-starred repos go to the destination organization
144
140
if ( config . giteaConfig . organization ) {
145
141
return config . giteaConfig . organization ;
146
142
}
147
143
// Fallback to username if no organization specified
148
- return config . giteaConfig . username ;
144
+ return config . giteaConfig . defaultOwner ;
149
145
150
146
case "flat-user" :
151
147
// All non-starred repos go under the user account
152
- return config . giteaConfig . username ;
148
+ return config . giteaConfig . defaultOwner ;
153
149
154
150
case "mixed" :
155
151
// Mixed mode: personal repos to single org, organization repos preserve structure
@@ -162,11 +158,11 @@ export const getGiteaRepoOwner = ({
162
158
return config . giteaConfig . organization ;
163
159
}
164
160
// Fallback to username if no organization specified
165
- return config . giteaConfig . username ;
161
+ return config . giteaConfig . defaultOwner ;
166
162
167
163
default :
168
164
// Default fallback
169
- return config . giteaConfig . username ;
165
+ return config . giteaConfig . defaultOwner ;
170
166
}
171
167
} ;
172
168
@@ -268,7 +264,7 @@ export const mirrorGithubRepoToGitea = async ({
268
264
throw new Error ( "github config and gitea config are required." ) ;
269
265
}
270
266
271
- if ( ! config . giteaConfig . username ) {
267
+ if ( ! config . giteaConfig . defaultOwner ) {
272
268
throw new Error ( "Gitea username is required." ) ;
273
269
}
274
270
@@ -357,7 +353,7 @@ export const mirrorGithubRepoToGitea = async ({
357
353
const apiUrl = `${ config . giteaConfig . url } /api/v1/repos/migrate` ;
358
354
359
355
// Handle organization creation if needed for single-org or preserve strategies
360
- if ( repoOwner !== config . giteaConfig . username && ! repository . isStarred ) {
356
+ if ( repoOwner !== config . giteaConfig . defaultOwner && ! repository . isStarred ) {
361
357
// Need to create the organization if it doesn't exist
362
358
await getOrCreateGiteaOrg ( {
363
359
orgName : repoOwner ,
@@ -383,11 +379,13 @@ export const mirrorGithubRepoToGitea = async ({
383
379
) ;
384
380
385
381
//mirror releases
386
- await mirrorGitHubReleasesToGitea ( {
387
- config,
388
- octokit,
389
- repository,
390
- } ) ;
382
+ if ( config . githubConfig ?. mirrorReleases ) {
383
+ await mirrorGitHubReleasesToGitea ( {
384
+ config,
385
+ octokit,
386
+ repository,
387
+ } ) ;
388
+ }
391
389
392
390
// clone issues
393
391
// Skip issues for starred repos if skipStarredIssues is enabled
@@ -738,11 +736,13 @@ export async function mirrorGitHubRepoToGiteaOrg({
738
736
) ;
739
737
740
738
//mirror releases
741
- await mirrorGitHubReleasesToGitea ( {
742
- config,
743
- octokit,
744
- repository,
745
- } ) ;
739
+ if ( config . githubConfig ?. mirrorReleases ) {
740
+ await mirrorGitHubReleasesToGitea ( {
741
+ config,
742
+ octokit,
743
+ repository,
744
+ } ) ;
745
+ }
746
746
747
747
// Clone issues
748
748
// Skip issues for starred repos if skipStarredIssues is enabled
@@ -906,7 +906,7 @@ export async function mirrorGitHubOrgToGitea({
906
906
// Determine the target organization based on strategy
907
907
if ( mirrorStrategy === "single-org" && config . giteaConfig ?. organization ) {
908
908
// For single-org strategy, use the configured destination organization
909
- targetOrgName = config . giteaConfig . organization ;
909
+ targetOrgName = config . giteaConfig . defaultOrg || config . giteaConfig . defaultOwner ;
910
910
giteaOrgId = await getOrCreateGiteaOrg ( {
911
911
orgId : organization . id ,
912
912
orgName : targetOrgName ,
@@ -925,7 +925,7 @@ export async function mirrorGitHubOrgToGitea({
925
925
// For flat-user strategy, we shouldn't create organizations at all
926
926
// Skip organization creation and let individual repos be handled by getGiteaRepoOwner
927
927
console . log ( `Using flat-user strategy: repos will be placed under user account` ) ;
928
- targetOrgName = config . giteaConfig ?. username || "" ;
928
+ targetOrgName = config . giteaConfig ?. defaultOwner || "" ;
929
929
}
930
930
931
931
//query the db with the org name and get the repos
@@ -1082,7 +1082,7 @@ export const syncGiteaRepo = async ({
1082
1082
! config . userId ||
1083
1083
! config . giteaConfig ?. url ||
1084
1084
! config . giteaConfig ?. token ||
1085
- ! config . giteaConfig ?. username
1085
+ ! config . giteaConfig ?. defaultOwner
1086
1086
) {
1087
1087
throw new Error ( "Gitea config is required." ) ;
1088
1088
}
@@ -1405,7 +1405,7 @@ export async function mirrorGitHubReleasesToGitea({
1405
1405
config : Partial < Config > ;
1406
1406
} ) {
1407
1407
if (
1408
- ! config . giteaConfig ?. username ||
1408
+ ! config . giteaConfig ?. defaultOwner ||
1409
1409
! config . giteaConfig ?. token ||
1410
1410
! config . giteaConfig ?. url
1411
1411
) {
0 commit comments