@@ -18,8 +18,13 @@ func GetAllRepositoriesDependabotAlerts(ctx context.Context, githubClient model.
1818 repositoryName = value .(string )
1919 }
2020
21+ organization , err := GetOrganizationAdditionalData (ctx , githubClient .RestClient , organizationName )
22+ if err != nil {
23+ return nil , err
24+ }
25+
2126 if repositoryName != "" {
22- repoValues , err := GetRepositoryDependabotAlerts (ctx , githubClient , stream , organizationName , repositoryName )
27+ repoValues , err := GetRepositoryDependabotAlerts (ctx , githubClient , stream , organizationName , repositoryName , organization . GetID () )
2328 if err != nil {
2429 return nil , err
2530 }
@@ -32,7 +37,7 @@ func GetAllRepositoriesDependabotAlerts(ctx context.Context, githubClient model.
3237 }
3338 var values []models.Resource
3439 for _ , repo := range repositories {
35- repoValues , err := GetRepositoryDependabotAlerts (ctx , githubClient , stream , organizationName , repo .GetName ())
40+ repoValues , err := GetRepositoryDependabotAlerts (ctx , githubClient , stream , organizationName , repo .GetName (), organization . GetID () )
3641 if err != nil {
3742 return nil , err
3843 }
@@ -41,7 +46,7 @@ func GetAllRepositoriesDependabotAlerts(ctx context.Context, githubClient model.
4146 return values , nil
4247}
4348
44- func GetRepositoryDependabotAlerts (ctx context.Context , githubClient model.GitHubClient , stream * models.StreamSender , owner , repo string ) ([]models.Resource , error ) {
49+ func GetRepositoryDependabotAlerts (ctx context.Context , githubClient model.GitHubClient , stream * models.StreamSender , owner , repo string , orgId int64 ) ([]models.Resource , error ) {
4550 client := githubClient .RestClient
4651 opt := & github.ListAlertsOptions {
4752 ListCursorOptions : github.ListCursorOptions {First : pageSize },
@@ -96,6 +101,7 @@ func GetRepositoryDependabotAlerts(ctx context.Context, githubClient model.GitHu
96101 DismissedComment : alert .GetDismissedComment (),
97102 FixedAt : alert .GetFixedAt (),
98103 Organization : owner ,
104+ OrganizationID : orgId ,
99105 RepositoryName : repo ,
100106 },
101107 }
0 commit comments