You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sql/README.md
+1
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,7 @@ The `audit` folder has queries that are all around auditing credentials, webhook
15
15
-`hooks-repos.sql` - A report of all repository webhooks used in the past week, who owns it, and where the webhook goes. This is limited to a week based on the length of time these are kept in the `hookshot_delivery_logs` table.
16
16
-`hooks-users.sql` - Same report as above, but for user-owned webhooks.
17
17
-`oauth-apps.sql` - A report of all OAuth apps, who owns it, where it goes, and when it was last used.
18
+
-`repos-audit.sql` - A report of all repositories including the commit count, PR count, Disk size, last push, and more.
18
19
-`user-emails.sql` - A report of all emails that don't match a list of approved domains you define in the `WHERE` clause. This query should be deprecated by [this issue](https://github.com/github/roadmap/issues/204).
19
20
-`user-ssh-keys.sql` - A report of all user SSH keys, when it was last used, when it was set up, and how long the key is.
LEFT JOIN (SELECTCOUNT(id) as count, repository_id FROM pull_requests GROUP BY repository_id) pr onpr.repository_id=repo.id
49
-
LEFT JOIN (SELECTCOUNT(id) as count, repository_id FROM pull_request_reviews GROUP BY repository_id) prr onprr.repository_id=repo.id
50
-
LEFT JOIN (SELECTCOUNT(id) as count, repository_id FROM issues WHERE has_pull_request =0GROUP BY repository_id) issue onissue.repository_id=repo.id
51
-
LEFT JOIN (SELECT1as"internal", repository_id FROM internal_repositories) internal oninternal.repository_id=repo.id
52
-
LEFT JOIN (SELECTSUM(commit_count) as"commit_count", repository_id FROM commit_contributions GROUP BY repository_id) commits oncommits.repository_id=repo.id
53
-
LEFT JOIN (SELECTCOUNT(id) as branch_count, repository_id, GROUP_CONCAT(name SEPARATOR ';') as branch_names FROM protected_branches GROUP BY repository_id) pb onpb.repository_id=repo.id
54
-
LEFT JOIN (SELECT1as is_fork, id, name, parent_id, owner_login FROM repositories) repo2 onrepo2.id=repo.parent_id
55
-
LEFT JOIN (SELECTCOUNT(id) as count, repository_id FROM releases GROUP BY repository_id) releases onreleases.repository_id=repo.id
56
-
LEFT JOIN (SELECTcount(id) as count, owner_id FROM projects WHERE owner_type ="Repository"GROUP BY owner_id) projects onprojects.owner_id=repo.id
57
-
LEFT JOIN (SELECTcount(id) as count, installation_target_id FROM hooks WHERE installation_target_type ="Repository"GROUP BY installation_target_id) hooks onhooks.installation_target_id=repo.id
58
-
LEFT JOIN (SELECTa.subject_id, GROUP_CONCAT(uu.login SEPARATOR ';') as login FROM abilities a
59
-
LEFT JOIN (SELECTu.id, u.loginFROM users u) uu ONuu.id=a.actor_id
0 commit comments