steampipe plugin install github

Table: github_my_organization - Query GitHub Organizations using SQL

GitHub Organizations are a shared workspace where businesses and open-source projects can collaborate across many projects at once. Owners and administrators can manage member access to the organization's data and projects with sophisticated security and administrative features. GitHub Organizations help streamline project management and boost productivity in your organization.

Table Usage Guide

The github_my_organization table provides insights into a user's primary organization on GitHub. As a project manager or team lead, explore organization-specific details through this table, including member access, repository details, and administrative features. Utilize it to manage and streamline your organization's projects and enhance team productivity.

Important Notes

  • The github_my_organization table will list the organization that you are a member of. To view details of ANY organization, use the github_organization table.

Examples

Basic info for the GitHub Organizations to which you belong

Determine the areas in which you hold membership across various GitHub organizations. This query is useful in understanding your involvement and role within these organizations, including details such as the number of private and public repositories, team counts, and member counts.

select
login as organization,
name,
twitter_username,
private_repositories_total_count as private_repos,
public_repositories_total_count as public_repos,
created_at,
updated_at,
is_verified,
teams_total_count as teams_count,
members_with_role_total_count as member_count,
url
from
github_my_organization;
select
login as organization,
name,
twitter_username,
private_repositories_total_count as private_repos,
public_repositories_total_count as public_repos,
created_at,
updated_at,
is_verified,
teams_total_count as teams_count,
members_with_role_total_count as member_count,
url
from
github_my_organization;

Show all members for the GitHub Organizations to which you belong

Determine the areas in which you are a member of a GitHub organization, offering insights into your collaborative coding environments and affiliations. This can be useful in managing and understanding your participation in various coding projects and teams.

select
o.login as organization,
m.login as member_login
from
github_my_organization o
join github_organization_member m on o.login = m.organization;
select
o.login as organization,
m.login as member_login
from
github_my_organization o
join github_organization_member m on o.login = m.organization;

Show your permissions on the Organization

Explore your access level and permissions within your GitHub organization. This can help in understanding what actions you are authorized to perform, such as administering the organization, changing pinned items, creating projects, repositories, or teams, and whether you are currently a member.

select
login as organization,
members_with_role_total_count as members_count,
can_administer,
can_changed_pinned_items,
can_create_projects,
can_create_repositories,
can_create_teams,
is_a_member as current_member
from
github_my_organization;
select
login as organization,
members_with_role_total_count as members_count,
can_administer,
can_changed_pinned_items,
can_create_projects,
can_create_repositories,
can_create_teams,
is_a_member as current_member
from
github_my_organization;

Show Organization security settings

Gain insights into your organization's security settings, such as member permissions and two-factor authentication requirements. This can help ensure your organization's GitHub repositories and pages are appropriately protected.

select
login as organization,
members_with_role_total_count as members_count,
members_allowed_repository_creation_type,
members_can_create_internal_repos,
members_can_create_pages,
members_can_create_private_repos,
members_can_create_public_repos,
members_can_create_repos,
default_repo_permission,
two_factor_requirement_enabled
from
github_my_organization;
select
login as organization,
members_with_role_total_count as members_count,
members_allowed_repository_creation_type,
members_can_create_internal_repos,
members_can_create_pages,
members_can_create_private_repos,
members_can_create_public_repos,
members_can_create_repos,
default_repo_permission,
two_factor_requirement_enabled
from
github_my_organization;

List organization hooks that are insecure

Explore which organization hooks are potentially insecure due to specific settings, such as lack of SSL security, absence of a secret, or non-HTTPS URLs. This is particularly useful in identifying and mitigating potential security vulnerabilities within your organization's GitHub configuration.

select
login as organization,
hook
from
github_my_organization,
jsonb_array_elements(hooks) as hook
where
hook -> 'config' ->> 'insecure_ssl' = '1'
or hook -> 'config' ->> 'secret' is null
or hook -> 'config' ->> 'url' not like '%https:%';
select
login as organization,
hook.value as hook
from
github_my_organization,
json_each(hooks) as hook
where
json_extract(hook.value, '$.config.insecure_ssl') = '1'
or json_extract(hook.value, '$.config.secret') is null
or json_extract(hook.value, '$.config.url') not like '%https:%';

Schema for github_my_organization

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
announcementtextThe text of the announcement.
announcement_expires_attimestamp with time zoneThe expiration date of the announcement, if any.
announcement_user_dismissiblebooleanIf true, the announcement can be dismissed by the user.
any_pinnable_itemsbooleanIf true, this organization has items that can be pinned to their profile.
avatar_urltextURL pointing to the organization's public avatar.
billing_emailtextThe email address for billing.
can_administerbooleanIf true, you can administer the organization.
can_changed_pinned_itemsbooleanIf true, you can change the pinned items on the organization's profile.
can_create_projectsbooleanIf true, you can create projects for the organization.
can_create_repositoriesbooleanIf true, you can create repositories for the organization.
can_create_teamsbooleanIf true, you can create teams within the organization.
can_sponsorbooleanIf true, you can sponsor this organization.
collaboratorsbigintThe number of collaborators for the organization.
created_attimestamp with time zoneTimestamp when the organization was created.
default_repo_permissiontextThe default repository permissions for the organization.
descriptiontextThe description of the organization.
emailtextThe email address associated with the organization.
estimated_next_sponsors_payout_in_centsbigintThe estimated next GitHub Sponsors payout for this organization in cents (USD).
followersbigintThe number of users following the organization.
followingbigintThe number of users followed by the organization.
has_organization_projectsbooleanIf true, the organization can use organization projects.
has_repository_projectsbooleanIf true, the organization can use repository projects.
has_sponsors_listingbooleanIf true, this organization has a GitHub Sponsors listing.
hooksjsonbThe Hooks of the organization.
idbigintThe ID number of the organization.
interaction_abilityjsonbThe interaction ability settings for this organization.
is_a_memberbooleanIf true, you are an active member of the organization.
is_followingbooleanIf true, you are following the organization.
is_sponsoringbooleanIf true, you are sponsoring the organization.
is_sponsoring_youbooleanIf true, you are sponsored by this organization.
is_verifiedbooleanIf true, the organization has verified its profile email and website.
locationtextThe organization's public profile location.
logintextThe login name of the organization.
login_idtext=, !=, ~~, ~~*, !~~, !~~*Unique identifier for the user login.
members_allowed_repository_creation_typetextSpecifies which types of repositories non-admin organization members can create
members_can_create_internal_reposbooleanIf true, members can create internal repositories.
members_can_create_pagesbooleanIf true, members can create pages.
members_can_create_private_reposbooleanIf true, members can create private repositories.
members_can_create_public_reposbooleanIf true, members can create public repositories.
members_can_create_reposbooleanIf true, members can create repositories.
members_can_fork_private_reposbooleanIf true, members can fork private organization repositories.
members_with_role_total_countbigintCount of members with a role within the organization.
monthly_estimated_sponsors_income_in_centsbigintThe estimated monthly GitHub Sponsors income for this organization in cents (USD).
nametextThe display name of the organization.
new_team_urltextURL for creating a new team.
node_idtextThe node ID of the organization.
packages_total_countbigintCount of packages within the organization.
pinnable_items_total_countbigintCount of pinnable items within the organization.
pinned_items_remainingbigintReturns how many more items this organization can pin to their profile.
pinned_items_total_countbigintCount of itesm pinned to the organization's profile.
plan_filled_seatsbigintThe number of used seats for the plan.
plan_nametextThe name of the GitHub plan.
plan_private_reposbigintThe number of private repositories for the plan.
plan_seatsbigintThe number of available seats for the plan
plan_spacebigintThe total space allocated for the plan.
private_repositories_total_countbigintCount of private repositories within the organization.
projects_total_countbigintCount of projects within the organization.
projects_urltextURL listing organization's projects.
projects_v2_total_countbigintCount of V2 projects within the organization.
public_repositories_total_countbigintCount of public repositories within the organization.
repositories_total_countbigintCount of all repositories within the organization.
repositories_total_disk_usagebigintTotal disk usage for all repositories within the organization.
saml_identity_providerjsonbThe Organization's SAML identity provider. Visible to (1) organization owners, (2) organization owners' personal access tokens (classic) with read:org or admin:org scope, (3) GitHub App with an installation token with read or write access to members, else null.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
sponsoring_total_countbigintCount of users the organization is sponsoring.
sponsors_listingjsonbThe GitHub sponsors listing for this organization.
sponsors_total_countbigintCount of sponsors the organization has.
teams_total_countbigintCount of teams within the organization.
teams_urltextURL listing organization's teams.
total_sponsorship_amount_as_sponsor_in_centsbigintThe amount in United States cents (e.g., 500 = $5.00 USD) that this entity has spent on GitHub to fund sponsorships. Only returns a value when viewed by the user themselves or by a user who can manage sponsorships for the requested organization.
twitter_usernametextThe organization's Twitter username.
two_factor_requirement_enabledbooleanIf true, all members in the organization must have two factor authentication enabled.
updated_attimestamp with time zoneTimestamp when the organization was last updated.
urltextThe URL for this organization.
web_commit_signoff_requiredbooleanIf true, contributors are required to sign off on web-based commits for repositories in this organization.
website_urltextURL for the organization's public website.

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_organization