turbot / steampipe-plugin-github

Use SQL to instantly query repositories, users, gists and more from GitHub. Open source CLI. No DB required.
https://hub.steampipe.io/plugins/turbot/github
Apache License 2.0
73 stars 29 forks source link

Expose repository custom properties. #456

Open christophla opened 3 weeks ago

christophla commented 3 weeks ago

Is your feature request related to a problem? Please describe.

Repository custom properties are not currently included in the github_repository table. These would be very useful for displaying additional metadata within Steampipe/Powerpipe dashboards.

From the Github API Schema (2022-11-18)

"custom_properties": {
  "type": "object",
  "description": "The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values.",
  "additionalProperties": true
 }

Describe the solution you'd like

I would like to be able to query against the custom properties for a repository. I'm not sure what the syntax would be, but it could be based off of the current json approach. (https://steampipe.io/docs/sql/querying-json)

SELECT * FROM github_repository WHERE custom_properties ->> 'project' = 'my-project'
SELECT custom_properties["project"] FROM github_repository WHERE repository_full_name = 'my-repo'

If this isn't feasible, adding a github_repository_properties table may be beneficial.

SELECT project, data_class, component FROM github_repository_properties WHERE repository_full_name = 'my-repo'

Describe alternatives you've considered I have not been able to query for custom properties within the steampipe environment.

Additional context None

priyavratamohan commented 4 days ago

Hi @christophla @ParthaI, I'd like to work on this issue under Hacktoberfest '24, can you please assign this to me with the appropriate labels? Thanks!