reposSetAdminBranchProtection
Set admin branch protection
Details
- Method:
POST - Path:
/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins - Operation ID:
repos/set-admin-branch-protection
Parameters
{
"owner": {
"description": "The account owner of the repository. The name is not case sensitive.",
"required": true,
"location": "path",
"type": "string"
},
"repo": {
"description": "The name of the repository without the `.git` extension. The name is not case sensitive.",
"required": true,
"location": "path",
"type": "string"
},
"branch": {
"description": "The name of the branch. Cannot contain wildcard characters. To use wildcard characters in branch names, use [the GraphQL API](https://docs.github.com/graphql).",
"required": true,
"location": "path",
"type": "string"
}
}Response Schema
{
"title": "Protected Branch Admin Enforced",
"description": "Protected Branch Admin Enforced",
"type": "object",
"properties": {
"url": {
"type": "string",
"format": "uri",
"example": "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/enforce_admins"
},
"enabled": {
"type": "boolean",
"example": true
}
},
"required": [
"url",
"enabled"
]
}Usage
from ocp_agent import OCPAgent
agent = OCPAgent()
await agent.register_api('github')
# Call this tool
result = await agent.call_tool('reposSetAdminBranchProtection', {
# Add required parameters here
})