diff --git a/steampipe-plugin-github/github/plugin.go b/steampipe-plugin-github/github/plugin.go index 27e257f7..9cdc8e56 100644 --- a/steampipe-plugin-github/github/plugin.go +++ b/steampipe-plugin-github/github/plugin.go @@ -64,5 +64,35 @@ func Plugin(ctx context.Context) *plugin.Plugin { "github_workflow": tableGitHubWorkflow(), }, } + for key, table := range p.TableMap { + if table == nil { + continue + } + if table.Get != nil && table.Get.Hydrate == nil { + delete(p.TableMap, key) + continue + } + if table.List != nil && table.List.Hydrate == nil { + delete(p.TableMap, key) + continue + } + + opengovernanceTable := false + for _, col := range table.Columns { + if col != nil && col.Name == "og_account_id" { + opengovernanceTable = true + } + } + + if opengovernanceTable { + if table.Get != nil { + table.Get.KeyColumns = append(table.Get.KeyColumns, plugin.OptionalColumns([]string{"og_account_id", "og_resource_id"})...) + } + + if table.List != nil { + table.List.KeyColumns = append(table.List.KeyColumns, plugin.OptionalColumns([]string{"og_account_id", "og_resource_id"})...) + } + } + } return p }