@@ -392,7 +392,7 @@ export const mirrorGithubRepoToGitea = async ({
392
392
config,
393
393
octokit,
394
394
repository,
395
- isRepoInOrg : false ,
395
+ giteaOwner : repoOwner ,
396
396
} ) ;
397
397
}
398
398
@@ -741,7 +741,7 @@ export async function mirrorGitHubRepoToGiteaOrg({
741
741
config,
742
742
octokit,
743
743
repository,
744
- isRepoInOrg : true ,
744
+ giteaOwner : orgName ,
745
745
} ) ;
746
746
}
747
747
@@ -1183,12 +1183,12 @@ export const mirrorGitRepoIssuesToGitea = async ({
1183
1183
config,
1184
1184
octokit,
1185
1185
repository,
1186
- isRepoInOrg ,
1186
+ giteaOwner ,
1187
1187
} : {
1188
1188
config : Partial < Config > ;
1189
1189
octokit : Octokit ;
1190
1190
repository : Repository ;
1191
- isRepoInOrg : boolean ;
1191
+ giteaOwner : string ;
1192
1192
} ) => {
1193
1193
//things covered here are- issue, title, body, labels, comments and assignees
1194
1194
if (
@@ -1200,10 +1200,6 @@ export const mirrorGitRepoIssuesToGitea = async ({
1200
1200
throw new Error ( "Missing GitHub or Gitea configuration." ) ;
1201
1201
}
1202
1202
1203
- const repoOrigin = isRepoInOrg
1204
- ? repository . organization
1205
- : config . githubConfig . username ;
1206
-
1207
1203
const [ owner , repo ] = repository . fullName . split ( "/" ) ;
1208
1204
1209
1205
// Fetch GitHub issues
@@ -1232,7 +1228,7 @@ export const mirrorGitRepoIssuesToGitea = async ({
1232
1228
1233
1229
// Get existing labels from Gitea
1234
1230
const giteaLabelsRes = await httpGet (
1235
- `${ config . giteaConfig . url } /api/v1/repos/${ repoOrigin } /${ repository . name } /labels` ,
1231
+ `${ config . giteaConfig . url } /api/v1/repos/${ giteaOwner } /${ repository . name } /labels` ,
1236
1232
{
1237
1233
Authorization : `token ${ config . giteaConfig . token } ` ,
1238
1234
}
@@ -1264,7 +1260,7 @@ export const mirrorGitRepoIssuesToGitea = async ({
1264
1260
} else {
1265
1261
try {
1266
1262
const created = await httpPost (
1267
- `${ config . giteaConfig ! . url } /api/v1/repos/${ repoOrigin } /${
1263
+ `${ config . giteaConfig ! . url } /api/v1/repos/${ giteaOwner } /${
1268
1264
repository . name
1269
1265
} /labels`,
1270
1266
{ name, color : "#ededed" } , // Default color
@@ -1301,7 +1297,7 @@ export const mirrorGitRepoIssuesToGitea = async ({
1301
1297
1302
1298
// Create the issue in Gitea
1303
1299
const createdIssue = await httpPost (
1304
- `${ config . giteaConfig ! . url } /api/v1/repos/${ repoOrigin } /${
1300
+ `${ config . giteaConfig ! . url } /api/v1/repos/${ giteaOwner } /${
1305
1301
repository . name
1306
1302
} /issues`,
1307
1303
issuePayload ,
@@ -1328,7 +1324,7 @@ export const mirrorGitRepoIssuesToGitea = async ({
1328
1324
comments ,
1329
1325
async ( comment ) => {
1330
1326
await httpPost (
1331
- `${ config . giteaConfig ! . url } /api/v1/repos/${ repoOrigin } /${
1327
+ `${ config . giteaConfig ! . url } /api/v1/repos/${ giteaOwner } /${
1332
1328
repository . name
1333
1329
} /issues/${ createdIssue . data . number } /comments`,
1334
1330
{
0 commit comments