Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions pkg/github/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,19 @@ func (a *Adapter) RequestPageFromDatasource(
return framework.NewGetPageResponseError(err)
}

// Get entity-specific filter and ordering from config
var filter, orderBy *string
if request.Config.Filters != nil {
if filterValue, exists := request.Config.Filters[request.Entity.ExternalId]; exists && filterValue != "" {
filter = &filterValue
}
}
if request.Config.OrderBy != nil {
if orderByValue, exists := request.Config.OrderBy[request.Entity.ExternalId]; exists && orderByValue != "" {
orderBy = &orderByValue
}
}

githubReq := &Request{
BaseURL: request.Address,
Token: request.Auth.HTTPAuthorization,
Expand All @@ -70,6 +83,8 @@ func (a *Adapter) RequestPageFromDatasource(
PageSize: request.PageSize,
Organizations: request.Config.Organizations,
RequestTimeoutSeconds: *commonConfig.RequestTimeoutSeconds,
Filter: filter,
OrderBy: orderBy,
}

resp, err := a.GithubClient.GetPage(ctx, githubReq)
Expand Down
Loading
Loading