Add a protection rule to a repository
One step with Harness. We can help you get access.
Get something done
Add a protection rule to a repository
with Harness
Works with AI assistants
Use Harness: its Harness Rules API lets you add a protection rule to a repository in a single step (POST /code/api/v1/repos/{repo_identifier}/rules). Harness also has an MCP server, so an AI assistant like Claude or ChatGPT can do it for you. capabilities.work can help you get signed up and connected.
- How do I protect the main branch of a single repo from direct pushes?
- Can a repository rule match branches by pattern?
Say it to your AI assistant
- Add a protection rule {identifier} to repo {repo_identifier} matching pattern {pattern}.
- Create a {type} rule on repo {repo_identifier} with definition {definition}.
For your developer
POST /code/api/v1/repos/{repo_identifier}/rules in Harness Rules API. Full spec on APIs.io.