Table: github_repository_deployment - Query GitHub Repositories using SQL
GitHub Repositories are a fundamental resource in GitHub that allow users to manage and store revisions of projects. Repositories contain all of the project files and revision history. Users can work together within a repository to edit and manage the project.
Table Usage Guide
The github_repository_deployment
table offers insights into GitHub repositories' deployment details. As a developer or project manager, you can use this table to retrieve deployment status, environment, and related metadata for each repository. This can be particularly useful for monitoring deployment progress, identifying deployment patterns, and troubleshooting deployment issues.
Important Notes
- You must specify the
repository_full_name
(repository including org/user prefix) column in thewhere
orjoin
clause to query the table.
Examples
List deployments for a repository
Explore the deployment history of a specific repository to understand its version updates and changes made by different contributors. This is useful in tracking the evolution of a project and assessing its progress over time.
select id, node_id, commit_sha, created_at, creator ->> 'login' as creator_login, description, environment, latest_status, payload, ref ->> 'prefix' as ref_prefix, ref ->> 'name' as ref_name, state, task, updated_atfrom github_repository_deploymentwhere repository_full_name = 'turbot/steampipe';
select id, node_id, commit_sha, created_at, json_extract(creator, '$.login') as creator_login, description, environment, latest_status, payload, json_extract(ref, '$.prefix') as ref_prefix, json_extract(ref, '$.name') as ref_name, state, task, updated_atfrom github_repository_deploymentwhere repository_full_name = 'turbot/steampipe';
List deployments for all your repositories
Explore the deployment history across all your GitHub repositories. This query helps you assess the details of each deployment such as its creator, status, environment, and more, providing a comprehensive view of your repositories' deployment activities.
select id, node_id, created_at, creator ->> 'login' as creator_login, commit_sha, description, environment, latest_status, payload, ref ->> 'prefix' as ref_prefix, ref ->> 'name' as ref_name, state, task, updated_atfrom github_repository_deploymentwhere repository_full_name in ( select name_with_owner from github_my_repository );
select id, node_id, created_at, json_extract(creator, '$.login') as creator_login, commit_sha, description, environment, latest_status, payload, json_extract(ref, '$.prefix') as ref_prefix, json_extract(ref, '$.name') as ref_name, state, task, updated_atfrom github_repository_deploymentwhere repository_full_name in ( select name_with_owner from github_my_repository );
Schema for github_repository_deployment
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
commit_sha | text | SHA of the commit the deployment is using. | |
created_at | timestamp with time zone | Timestamp when the deployment was created. | |
creator | jsonb | The deployment creator. | |
description | text | The description of the deployment. | |
environment | text | The name of the environment to which the deployment was made. | |
id | bigint | The ID of the deployment. | |
latest_environment | text | The name of the latest environment to which the deployment was made. | |
latest_status | jsonb | The latest status of the deployment. | |
login_id | text | =, !=, ~~, ~~*, !~~, !~~* | Unique identifier for the user login. |
node_id | text | The node ID of the deployment. | |
original_environment | text | The original environment to which this deployment was made. | |
payload | text | Extra information that a deployment system might need. | |
ref | jsonb | Identifies the Ref of the deployment, if the deployment was created by ref. | |
repository_full_name | text | = | The full name of the repository (login/repo-name). |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
state | text | The current state of the deployment. | |
task | text | The deployment task. | |
updated_at | timestamp with time zone | Timestamp when the deployment was last updated. |
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_repository_deployment