Reputation: 21
I am really new to Github APIs.
I have to create a script (shell/Groovy) that can enable protection on branches of multiple repos in one go so that just the authorized users can access it. Although I have read the documentation but it's not very clear to me how to implement it.
Upvotes: 1
Views: 371
Reputation: 1324148
The actual API would be "Update branch protection"
PUT /repos/:owner/:repo/branches/:branch/protection
Use a PAT (Personal Access Token) with an associated scope of at least public_repo
Upvotes: 1