Find all repositories with unprotected default branches in GitHub
SELECT
repo.full_name,
pushed_at,
private,
branch.protected,
archived
FROM github_repositories repo
LEFT JOIN
github_repository_branches branch
ON branch.repository_id = repo.id
AND repo.default_branch = branch.name
WHERE
branch.protected = FALSE
AND archived != true
ORDER BY repo.name ASC;
full_name | pushed_at | private | protected | archived |
---|---|---|---|---|
cq-demo/unicorn-rainbow-pizza | 2024-06-06 13:20:21 | False | False | False |
cq-demo/dancing-platypus | 2023-11-16 14:46:37 | True | False | False |
cq-demo/invisible-taco | 2023-07-19 08:00:47 | True | False | False |
cq-demo/sparkly-donut-ui | 2024-08-02 14:53:51 | False | False | False |
cq-demo/ninja-kitten-analytics | 2024-05-22 17:15:08 | True | False | False |
Written by Herman Schaaf
Herman is the Director of Engineering at CloudQuery and an Apache Arrow contributor. A polyglot with a preference for Go and Python, he has spoken at QCon London and Data Council New York.