turbot/github_sherlock

Control: Default branch requires pull request reviews before merging in each public repository

Description

Pull request reviews help improve quality of commits into the default branch.

Usage

steampipe check github_sherlock.control.public_repo_default_branch_requires_pull_request_reviews

Plugins & Tables

SQL

select
r.full_name as resource,
case
when b.required_pull_request_reviews is not null then 'ok'
else 'alarm'
end as status,
r.full_name || ' default branch ' || b.name || case when(b.required_pull_request_reviews is not null) then ' requires ' else ' does not require ' end || 'pull request reviews.' as reason,
r.full_name
from
github_my_repository as r
left join github_branch_protection as b on r.full_name = b.repository_full_name
where
visibility = 'public' and r.fork = false and b.name in ('main', 'master')