Skip to content

Commit

Permalink
fix: fix plugin schema
Browse files Browse the repository at this point in the history
  • Loading branch information
artaasadi committed Nov 20, 2024
1 parent ff1626b commit 3599200
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions steampipe-plugin-github/github/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 3599200

Please sign in to comment.