steampipe-plugin-github icon indicating copy to clipboard operation
steampipe-plugin-github copied to clipboard

Add table `github_blob`

Open rmhartog opened this issue 2 months ago • 2 comments

Add the table github_blob

Allows the github blobs to be joined to a github tree to access a specific file's contents, for example to check for configuration files or README's.

Example query results

select
  tree_sha,
  truncated,
  path,
  mode,
  type,
  sha,
  decode(content, encoding) as content
from
  github_tree t
left outer join
  github_blob b on b.repository_full_name = t.repository_full_name and b.blob_sha = t.sha
where
  t.repository_full_name = 'turbot/steampipe'
  and tree_sha = '0f200416c44b8b85277d973bff933efa8ef7803a'
  and path = 'Makefile';
Results
+------------------------------------------+-----------+----------+--------+------+------------------------------------------+-------------------------------------------+
| tree_sha                                 | truncated | path     | mode   | type | sha                                      | content                                   |
+------------------------------------------+-----------+----------+--------+------+------------------------------------------+-------------------------------------------+
| 0f200416c44b8b85277d973bff933efa8ef7803a | false     | Makefile | 100644 | blob | 4650745ea73b4769919e29f3882a05d1351e2212 |                                           |
|                                          |           |          |        |      |                                          | steampipe:                                |
|                                          |           |          |        |      |                                          |     go build -o  /usr/local/bin/steampipe |
|                                          |           |          |        |      |                                          |                                           |
|                                          |           |          |        |      |                                          | dashboard_assets:                         |
|                                          |           |          |        |      |                                          |     $(MAKE) -C ui/dashboard               |
|                                          |           |          |        |      |                                          |                                           |
|                                          |           |          |        |      |                                          | all:                                      |
|                                          |           |          |        |      |                                          |     $(MAKE) -C pluginmanager              |
|                                          |           |          |        |      |                                          |     $(MAKE) -C ui/dashboard               |
|                                          |           |          |        |      |                                          |     go build -o  /usr/local/bin/steampipe |
|                                          |           |          |        |      |                                          |                                           |
+------------------------------------------+-----------+----------+--------+------+------------------------------------------+-------------------------------------------+

rmhartog avatar Apr 30 '24 07:04 rmhartog