Set a branch's protection rules
One step with GitHub. We can help you get access.
Get something done
Set a branch's protection rules
with GitHub · Software Construction Management
Use GitHub: its GitHub v3 REST Repos API lets you set a branch's protection rules in a single step (PUT /repos/{owner}/{repo}/branches/{branch}/protection). capabilities.work can help you get signed up and connected.
- How do I protect a branch so it requires reviews and passing checks before merging?
- Can I require a linear history and block force pushes on a branch?
- Does replacing branch protection overwrite the users and teams allowed to push?
Say it to your AI assistant
- Protect {branch} in {owner}/{repo} with status checks {required_status_checks} and reviews {required_pull_request_reviews}.
- Replace the protection on {branch} in {owner}/{repo}, enforcing it for admins: {enforce_admins}.
- Require linear history ({required_linear_history}) on {branch} of {owner}/{repo} in its protection rules.
For your developer
PUT /repos/{owner}/{repo}/branches/{branch}/protection in GitHub v3 REST Repos API. Full spec on APIs.io.