steampipe plugin install github

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 the where or join 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_at
from
github_repository_deployment
where
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_at
from
github_repository_deployment
where
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_at
from
github_repository_deployment
where
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_at
from
github_repository_deployment
where
repository_full_name in (
select
name_with_owner
from
github_my_repository
);

Schema for github_repository_deployment

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
commit_shatextSHA of the commit the deployment is using.
created_attimestamp with time zoneTimestamp when the deployment was created.
creatorjsonbThe deployment creator.
descriptiontextThe description of the deployment.
environmenttextThe name of the environment to which the deployment was made.
idbigintThe ID of the deployment.
latest_environmenttextThe name of the latest environment to which the deployment was made.
latest_statusjsonbThe latest status of the deployment.
login_idtext=, !=, ~~, ~~*, !~~, !~~*Unique identifier for the user login.
node_idtextThe node ID of the deployment.
original_environmenttextThe original environment to which this deployment was made.
payloadtextExtra information that a deployment system might need.
refjsonbIdentifies the Ref of the deployment, if the deployment was created by ref.
repository_full_nametext=The full name of the repository (login/repo-name).
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
statetextThe current state of the deployment.
tasktextThe deployment task.
updated_attimestamp with time zoneTimestamp 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