steampipe plugin install github

Table: github_blob - Query GitHub Repositories using SQL

GitHub Repositories are a fundamental resource in GitHub. They allow users to host and manage their codebase, track changes, and collaborate with other users. Each repository contains a tree structure that represents the file and directory hierarchy.

Table Usage Guide

The github_blob table provides the contents of files within GitHub Repositories. As a developer or project manager, explore each repository's contents. Utilize it to uncover information about specific files in the repository, such as configuration files.

Important Notes

  • You must specify the repository_full_name and blob_sha columns in where or join clause to query the table.

Examples

List blob contents for a specific file

Explore the specific elements within the 'turbot/steampipe' repository by pinpointing specific files using a unique identifier. This helps understand the contents of the repository and makes it easy to access and analyze the file's content.

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';
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';

Schema for github_blob

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
blob_shatext=SHA1 of the blob.
contenttextThe encoded content of the blob.
encodingtextThe encoding of the blob.
node_idtextThe node ID of the blob.
repository_full_nametext=Full name of the repository that contains the blob.
sizebigintSize of the blob.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
urltextURL of the blob.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- github

You can pass the configuration to the command with the --config argument:

steampipe_export_github --config '<your_config>' github_blob