Table: github_my_team - Query GitHub Teams using SQL
GitHub Teams is a feature within GitHub that allows for easy collaboration and access management within repositories. Teams can have different access rights to repositories and can consist of any number of users. Teams are a convenient way to manage large groups of users, both for assigning access rights and for mentioning multiple users at once.
Table Usage Guide
The github_my_team
table provides insights into Teams within GitHub. As a developer or project manager, explore team-specific details through this table, including access rights, team structure and associated repositories. Utilize it to uncover information about teams, such as those with admin access to repositories, the distribution of access rights within a team, and the verification of team members.
Important Notes
- To view all teams you have visibility to across your organizations, use the
github_team
table.
Examples
Basic info
Discover the segments that make up your GitHub team, including the number of members and repositories, to gain insights into the team's structure and activities. This allows for better management and allocation of resources within the team.
select name, slug, description, organization, members_total_count, repositories_total_countfrom github_my_team;
select name, slug, description, organization, members_total_count, repositories_total_countfrom github_my_team;
Get organization permission for each team
Explore which permissions each team in your organization has on GitHub. This can help you manage access controls and ensure the right teams have the right permissions.
select name, organization, privacyfrom github_my_team;
select name, organization, privacyfrom github_my_team;
Get parent team details for child teams
Determine the hierarchical structure within your GitHub organization by identifying which sub-teams have a parent team. This can help in understanding the team dynamics and collaboration structure within your organization.
select slug, organization, parent_team ->> 'id' as parent_team_id, parent_team ->> 'slug' as parent_team_slugfrom github_my_teamwhere parent_team is not null;
select slug, organization, json_extract(parent_team, '$.id') as parent_team_id, json_extract(parent_team, '$.slug') as parent_team_slugfrom github_my_teamwhere parent_team is not null;
Schema for github_my_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_my_team