githubgraphqlgithub-api

How to set repository to Require approval for all outside collaborators from the API?


I would want to set or check the following setting:

enter image description here

using the github API. I tried searching https://docs.github.com/en/rest/repos?apiVersion=2022-11-28 , https://docs.github.com/en/graphql , https://docs.github.com/en/graphql/reference/mutations and google but I was not able to find anything relevant to the setting. How do I do that?

I would be happy even with listing which repositories from the list do not have this setting set, so that I can update them one by one manually.


Solution

  • According to this thread in Github discussions, this is not a current feature of the Github API. I recommend following that discussion if you want this feature in the future.