Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub API - Equivalent of GitLab's Protected branch API

There is a feature named Protected branches API on GitLab API. Basically, you can restrict all the push and merge access by setting their levels to 0.

I have checked Branches section on GitHub REST API document but I couldn't find the equivalent API. How can I restrict merge and push to a branch on GitHub? Also, I want to remove this restriction after some operations.

protect master branch (do not allow any push, merge etc.)
do something
unprotect master branch
like image 490
hisener Avatar asked Sep 09 '26 05:09

hisener


1 Answers

Going to the github api documentation, I see they have added protections. This seems pretty clear how to add proctections using API now.

like image 129
mdave16 Avatar answered Sep 12 '26 10:09

mdave16