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 inwhere
orjoin
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, messagefrom github_commitwhere repository_full_name = 'turbot/steampipe'order by authored_date desc;
select sha, author_login, authored_date, messagefrom github_commitwhere 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, messagefrom github_commitwhere repository_full_name = 'turbot/steampipe' and author_login = 'e-gineer'order by authored_date desc;
select sha, authored_date, messagefrom github_commitwhere 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_commitwhere repository_full_name = 'turbot/steampipe'group by author_loginorder by count desc;
select author_login, count(*)from github_commitwhere repository_full_name = 'turbot/steampipe'group by author_loginorder 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_datefrom github_commitwhere repository_full_name = 'turbot/steampipe' and signature is nullorder by authored_date desc;
select sha, author_login, authored_datefrom github_commitwhere repository_full_name = 'turbot/steampipe' and signature is nullorder 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, deletionsfrom github_commitwhere repository_full_name = 'turbot/steampipe'order by changed_files desc;
select sha, message, author_login, changed_files, additions, deletionsfrom github_commitwhere repository_full_name = 'turbot/steampipe'order by changed_files desc;
Control examples
Schema for github_commit
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
additions | bigint | Number of additions in the commit. | |
author | jsonb | The commit author. | |
author_login | text | The login name of the author of the commit. | |
authored_by_committer | boolean | Check if the committer and the author match. | |
authored_date | timestamp with time zone | >, >=, =, <, <= | Timestamp when the author made this commit. |
can_subscribe | boolean | If true, user can subscribe to this commit. | |
changed_files | bigint | Count of files changed in the commit. | |
commit_url | text | URL of the commit. | |
committed_date | timestamp with time zone | Timestamp when commit was committed. | |
committed_via_web | boolean | If true, commit was made via GitHub web ui. | |
committer | jsonb | The committer. | |
committer_login | text | The login name of the committer. | |
deletions | bigint | Number of deletions in the commit. | |
login_id | text | =, !=, ~~, ~~*, !~~, !~~* | Unique identifier for the user login. |
message | text | Commit message. | |
message_headline | text | The Git commit message headline. | |
node_id | text | The node ID of the commit. | |
repository_full_name | text | = | Full name of the repository that contains the commit. |
sha | text | = | SHA of the commit. |
short_sha | text | Short SHA of the commit. | |
signature | jsonb | The signature of commit. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
status | jsonb | Status of the commit. | |
subscription | text | Users subscription state of the commit. | |
tarball_url | text | URL to download a tar of commit. | |
tree_url | text | URL to tree of the commit. | |
url | text | URL of the commit. | |
zipball_url | text | URL 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