@@ -28,7 +28,11 @@ func GetAllRepositoriesCollaborators(ctx context.Context, githubClient model.Git
2828 if org != nil && org .ID != nil {
2929 orgId = * org .ID
3030 }
31- repoValues , err := GetRepositoryCollaborators (ctx , githubClient , stream , organizationName , orgId , repositoryName )
31+ repo , err := getRepositoryDetails (ctx , githubClient .RestClient , organizationName , repositoryName )
32+ if err != nil {
33+ return nil , err
34+ }
35+ repoValues , err := GetRepositoryCollaborators (ctx , githubClient , stream , organizationName , orgId , repositoryName , repo .GetID ())
3236 if err != nil {
3337 return nil , err
3438 }
@@ -50,7 +54,7 @@ func GetAllRepositoriesCollaborators(ctx context.Context, githubClient model.Git
5054 if org != nil && org .ID != nil {
5155 orgId = * org .ID
5256 }
53- repoValues , err := GetRepositoryCollaborators (ctx , githubClient , stream , organizationName , orgId , repo .GetName ())
57+ repoValues , err := GetRepositoryCollaborators (ctx , githubClient , stream , organizationName , orgId , repo .GetName (), repo . GetID () )
5458 if err != nil {
5559 return nil , err
5660 }
@@ -60,7 +64,7 @@ func GetAllRepositoriesCollaborators(ctx context.Context, githubClient model.Git
6064 return values , nil
6165}
6266
63- func GetRepositoryCollaborators (ctx context.Context , githubClient model.GitHubClient , stream * models.StreamSender , owner string , orgId int64 , repo string ) ([]models.Resource , error ) {
67+ func GetRepositoryCollaborators (ctx context.Context , githubClient model.GitHubClient , stream * models.StreamSender , owner string , orgId int64 , repo string , repoId int64 ) ([]models.Resource , error ) {
6468 client := githubClient .GraphQLClient
6569 affiliation := githubv4 .CollaboratorAffiliationAll
6670 var query struct {
@@ -97,6 +101,7 @@ func GetRepositoryCollaborators(ctx context.Context, githubClient model.GitHubCl
97101 ID : id ,
98102 Name : collaborator .Node .Name ,
99103 Description : model.RepoCollaboratorsDescription {
104+ RepositoryID : repoId ,
100105 RepositoryName : repo ,
101106 RepoFullName : repoFullName ,
102107 CollaboratorID : collaborator .Node .Login ,
0 commit comments