steampipe plugin install github

Table: github_commit - Query GitHub Commits using SQL

GitHub Commits are an integral part of the GitHub service, which provides a collaborative platform for software development. Each commit represents a single point in the git history, storing the changes made to the codebase along with metadata such as the author, timestamp, and associated comments. Commits serve as a record of what changes were made, when, and by whom, providing a comprehensive history of a project's development.

Table Usage Guide

The github_commit table provides insights into individual commits within a GitHub repository. As a developer or project manager, explore commit-specific details through this table, including author information, commit messages, and timestamps. Utilize it to understand the development history, track code changes, and analyze development patterns within your projects.

Important Notes

  • You must specify the repository_full_name column in where or join clause to query the table.

Examples

Recent commits

Explore the latest updates made to a specific GitHub repository. This allows you to track changes and progress over time, providing valuable insights into the development process.

select
sha,
author_login,
authored_date,
message
from
github_commit
where
repository_full_name = 'turbot/steampipe'
order by
authored_date desc;
select
sha,
author_login,
authored_date,
message
from
github_commit
where
repository_full_name = 'turbot/steampipe'
order by
authored_date desc;

Commits by a given author

Explore which contributions have been made by a specific user to a particular GitHub repository, sorted by most recent. This can be useful for tracking individual productivity or reviewing the history of changes made by a particular developer.

select
sha,
authored_date,
message
from
github_commit
where
repository_full_name = 'turbot/steampipe'
and author_login = 'e-gineer'
order by
authored_date desc;
select
sha,
authored_date,
message
from
github_commit
where
repository_full_name = 'turbot/steampipe'
and author_login = 'e-gineer'
order by
authored_date desc;

Contributions by author

Discover the segments that feature the most activity by tracking the frequency of contributions from individual authors in a specific GitHub repository. This is useful for understanding who are the most active contributors in a project.

select
author_login,
count(*)
from
github_commit
where
repository_full_name = 'turbot/steampipe'
group by
author_login
order by
count desc;
select
author_login,
count(*)
from
github_commit
where
repository_full_name = 'turbot/steampipe'
group by
author_login
order by
count(*) desc;

Commits that were not verified

Discover the segments that include unverified commits in the Steampipe repository. This can be particularly useful for tracking and improving security by identifying potentially malicious or unauthorised changes to the codebase.

select
sha,
author_login,
authored_date
from
github_commit
where
repository_full_name = 'turbot/steampipe'
and signature is null
order by
authored_date desc;
select
sha,
author_login,
authored_date
from
github_commit
where
repository_full_name = 'turbot/steampipe'
and signature is null
order by
authored_date desc;

Commits with most file changes

Explore which commits have resulted in the most file changes within a specific GitHub repository. This can help identify instances where significant modifications have been made, providing insights into the evolution and maintenance of the project.

select
sha,
message,
author_login,
changed_files,
additions,
deletions
from
github_commit
where
repository_full_name = 'turbot/steampipe'
order by
changed_files desc;
select
sha,
message,
author_login,
changed_files,
additions,
deletions
from
github_commit
where
repository_full_name = 'turbot/steampipe'
order by
changed_files desc;

Schema for github_commit

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
additionsbigintNumber of additions in the commit.
authorjsonbThe commit author.
author_logintextThe login name of the author of the commit.
authored_by_committerbooleanCheck if the committer and the author match.
authored_datetimestamp with time zone>, >=, =, <, <=Timestamp when the author made this commit.
can_subscribebooleanIf true, user can subscribe to this commit.
changed_filesbigintCount of files changed in the commit.
commit_urltextURL of the commit.
committed_datetimestamp with time zoneTimestamp when commit was committed.
committed_via_webbooleanIf true, commit was made via GitHub web ui.
committerjsonbThe committer.
committer_logintextThe login name of the committer.
deletionsbigintNumber of deletions in the commit.
login_idtext=, !=, ~~, ~~*, !~~, !~~*Unique identifier for the user login.
messagetextCommit message.
message_headlinetextThe Git commit message headline.
node_idtextThe node ID of the commit.
repository_full_nametext=Full name of the repository that contains the commit.
shatext=SHA of the commit.
short_shatextShort SHA of the commit.
signaturejsonbThe signature of commit.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
statusjsonbStatus of the commit.
subscriptiontextUsers subscription state of the commit.
tarball_urltextURL to download a tar of commit.
tree_urltextURL to tree of the commit.
urltextURL of the commit.
zipball_urltextURL to download a zip of commit.

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_commit