turbot/github_insights
GitHub
default_branch_protection_disabled_unverifiable_countdefault_branch_protection_enabled_countdefault_branch_protection_tableopen_issue_1_year_countopen_issue_24_hours_countopen_issue_30_90_days_countopen_issue_30_days_countopen_issue_90_365_days_countopen_issue_countopen_issue_tableopen_pull_request_1_year_countopen_pull_request_24_hours_countopen_pull_request_30_90_days_countopen_pull_request_30_days_countopen_pull_request_90_365_days_countopen_pull_request_countopen_pull_request_tableorganization_2fa_disabled_countorganization_2fa_enabled_countorganization_2fa_tableorganization_2fa_unknown_countorganization_countorganization_member_privileges_tableorganization_paid_plan_seat_unused_countorganization_plan_seat_tableorganization_security_advisory_countorganization_security_advisory_critical_countorganization_security_advisory_high_countorganization_security_advisory_low_countorganization_security_advisory_medium_countorganization_security_advisory_tablerepository_101_500_stars_countrepository_1_100_stars_countrepository_501_1000_stars_countrepository_countrepository_license_tablerepository_other_license_countrepository_over_1000_stars_countrepository_permissive_license_countrepository_popular_copyleft_license_countrepository_private_countrepository_public_countrepository_security_advisory_countrepository_security_advisory_critical_countrepository_security_advisory_high_countrepository_security_advisory_low_countrepository_security_advisory_medium_countrepository_security_advisory_tablerepository_stargazer_tablerepository_unstarred_countrepository_visibility_tablerepository_weak_copyleft_license_countrepository_without_license_count

Query: default_branch_protection_table

Usage

steampipe query github_insights.query.default_branch_protection_table

Plugins & Tables

SQL

select
name_with_owner as "Repository",
(default_branch_ref ->> 'name') as "Default Branch",
case
when (default_branch_ref -> 'branch_protection_rule') is null then 'Unknown - manual check required'
else 'Protected'
end as "Protection Status",
(
default_branch_ref -> 'branch_protection_rule' ->> 'restricts_pushes'
) :: bool as "Restricts Pushes",
(
default_branch_ref -> 'branch_protection_rule' ->> 'allows_force_pushes'
) :: bool as "Allows Force Pushes",
(
default_branch_ref -> 'branch_protection_rule' ->> 'allows_deletions'
) :: bool as "Allows Deletions",
(
default_branch_ref -> 'branch_protection_rule' ->> 'requires_approving_reviews'
) :: bool as "Requires Approvals",
(
default_branch_ref -> 'branch_protection_rule' ->> 'requires_conversation_resolution'
) :: bool as "Requires Conversation Resolution",
(
default_branch_ref -> 'branch_protection_rule' ->> 'requires_commit_signatures'
) :: bool as "Requires Signed Commits",
(
default_branch_ref -> 'branch_protection_rule' ->> 'requires_linear_history'
) :: bool as "Requires Linear History",
(
default_branch_ref -> 'branch_protection_rule' ->> 'is_admin_enforced'
) :: bool as "Applies to Admins",
url
from
github_my_repository
order by
name_with_owner;

Dashboards

The query is used in the dashboards: