steampipe plugin install github

Table: github_team - Query GitHub Teams using SQL

GitHub Teams is a feature within GitHub that allows organizations to create teams, manage permissions, and simplify @mentions. Teams are groups of organization members that reflect the company or project's structure. They can be used to create nested teams, mentionable as a single unit, and provide a social graph of an organization's repo permissions.

Table Usage Guide

The github_team table provides insights into the teams within GitHub organizations. As a project manager or team lead, you can explore team-specific details through this table, including team ID, name, description, and privacy level. Utilize it to manage permissions, simplify @mentions, and understand the social graph of your organization's repo permissions.

Examples

List all visible teams

Explore which teams are visible on your GitHub account, including details like their privacy settings and descriptions, to better manage your collaborations and understand team dynamics.

select
name,
slug,
privacy,
description
from
github_team
where
organization = 'turbot';
select
name,
slug,
privacy,
description
from
github_team
where
organization = 'turbot';

List all visible teams in an organization

Explore which teams are publicly visible within a specific organization on GitHub. This is useful for understanding the structure and privacy settings of your organization's teams.

select
name,
slug,
privacy,
description
from
github_team
where
organization = 'turbot';
select
name,
slug,
privacy,
description
from
github_team
where
organization = 'turbot';

Get the number of members for a single team

Explore the size of a specific team within your organization on Github. This can be useful for resource allocation and understanding team dynamics.

select
name,
slug,
members_total_count
from
github_team
where
organization = 'my_org'
and slug = 'my_team';
select
name,
slug,
members_total_count
from
github_team
where
organization = 'my_org'
and slug = 'my_team';

Get the number of repositories for a single team

Determine the total number of repositories associated with a specific team within your organization. This can be useful for understanding the team's workload or for assessing the distribution of resources within the organization.

select
name,
slug,
repositories_total_count
from
github_team
where
organization = 'my_org'
and slug = 'my_team';
select
name,
slug,
repositories_total_count
from
github_team
where
organization = 'my_org'
and slug = 'my_team';

Get parent team details for child teams

Determine the hierarchical relationships within your organization's teams on Github. This query is useful for understanding team structures and identifying which teams are sub-teams of larger, parent teams.

select
slug,
organization,
parent_team ->> 'id' as parent_team_id,
parent_team ->> 'node_id' as parent_team_node_id,
parent_team ->> 'slug' as parent_team_slug
from
github_team
where
organization = 'turbot'
and parent_team is not null;
select
slug,
organization,
parent_team ->> 'id' as parent_team_id,
parent_team ->> 'node_id' as parent_team_node_id,
parent_team ->> 'slug' as parent_team_slug
from
github_team
where
organization = 'turbot'
and parent_team is not null;

List teams with pending user invitations

Identify teams that have outstanding invitations to users. This can help manage and expedite the onboarding process by pinpointing where follow-ups may be needed.

select
name,
slug,
invitations_total_count
from
github_team
where
organization = 'turbot'
and invitations_total_count > 0;
select
name,
slug,
invitations_total_count
from
github_team
where
organization = 'turbot'
and invitations_total_count > 0;

Schema for github_team

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
ancestors_total_countbigintCount of ancestors this team has.
avatar_urltextURL for teams avatar.
can_administerbooleanIf true, current user can administer the team.
can_subscribebooleanIf true, current user can subscribe to the team.
child_teams_total_countbigintCount of children teams this team has.
combined_slugtextThe slug corresponding to the organization and the team.
created_attimestamp with time zoneTimestamp when team was created.
descriptiontextThe description of the team.
discussions_total_countbigintCount of team discussions.
discussions_urltextURL for team discussions.
edit_team_urltextURL for editing this team.
idbigintThe ID of the team.
invitations_total_countbigintCount of outstanding team member invitations for the team.
members_total_countbigintCount of team members.
members_urltextURL for team members.
nametextThe name of the team.
new_team_urltextThe HTTP URL creating a new team.
node_idtextThe node id of the team.
organizationtext=The organization the team is associated with.
parent_teamjsonbThe teams parent team.
privacytextThe privacy setting of the team (VISIBLE or SECRET).
projects_v2_total_countbigintCount of the teams v2 projects.
repositories_total_countbigintCount of repositories the team has.
repositories_urltextURL for team repositories.
slugtext=The team slug name.
subscriptiontextSubscription status of the current user to the team.
teams_urltextURL for this team's teams.
updated_attimestamp with time zoneTimestamp when team was last updated.
urltextURL for the team page in GitHub.

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_team