'How to query GitHub api for "require approvals" number?
I need to find out which repos have the "require approvals" settings at <2. We have hundreds, so need an automated way to search this.
Never used GithUb Api before, but I looked and there's a query to retrieve a repo object. However, I don't see that number.
Is it possible to get this information? If so, what's the api call to do it?
Thanks!
Solution 1:[1]
The reason you're not seeing this setting in the repository object is that it's not a repository-level setting. It's a setting that applies to the requirement to use pull requests for merging into certain branches, which is controlled by branch protection for the target branches.
The REST API does have an endpoint from which you can fetch this information, however.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | bk2204 |
