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, descriptionfrom github_teamwhere organization = 'turbot';
select name, slug, privacy, descriptionfrom github_teamwhere 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, descriptionfrom github_teamwhere organization = 'turbot';
select name, slug, privacy, descriptionfrom github_teamwhere 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_countfrom github_teamwhere organization = 'my_org' and slug = 'my_team';
select name, slug, members_total_countfrom github_teamwhere 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_countfrom github_teamwhere organization = 'my_org' and slug = 'my_team';
select name, slug, repositories_total_countfrom github_teamwhere 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_slugfrom github_teamwhere 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_slugfrom github_teamwhere 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_countfrom github_teamwhere organization = 'turbot' and invitations_total_count > 0;
select name, slug, invitations_total_countfrom github_teamwhere organization = 'turbot' and invitations_total_count > 0;
Schema for github_team
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
ancestors_total_count | bigint | Count of ancestors this team has. | |
avatar_url | text | URL for teams avatar. | |
can_administer | boolean | If true, current user can administer the team. | |
can_subscribe | boolean | If true, current user can subscribe to the team. | |
child_teams_total_count | bigint | Count of children teams this team has. | |
combined_slug | text | The slug corresponding to the organization and the team. | |
created_at | timestamp with time zone | Timestamp when team was created. | |
description | text | The description of the team. | |
discussions_total_count | bigint | Count of team discussions. | |
discussions_url | text | URL for team discussions. | |
edit_team_url | text | URL for editing this team. | |
id | bigint | The ID of the team. | |
invitations_total_count | bigint | Count of outstanding team member invitations for the team. | |
login_id | text | =, !=, ~~, ~~*, !~~, !~~* | Unique identifier for the user login. |
members_total_count | bigint | Count of team members. | |
members_url | text | URL for team members. | |
name | text | The name of the team. | |
new_team_url | text | The HTTP URL creating a new team. | |
node_id | text | The node id of the team. | |
organization | text | = | The organization the team is associated with. |
parent_team | jsonb | The teams parent team. | |
privacy | text | The privacy setting of the team (VISIBLE or SECRET). | |
projects_v2_total_count | bigint | Count of the teams v2 projects. | |
repositories_total_count | bigint | Count of repositories the team has. | |
repositories_url | text | URL for team repositories. | |
slug | text | = | The team slug name. |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
subscription | text | Subscription status of the current user to the team. | |
teams_url | text | URL for this team's teams. | |
updated_at | timestamp with time zone | Timestamp when team was last updated. | |
url | text | URL 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