Open Context Protocol is live! 🚀 Read the launch post
reposUpdateDeploymentBranchPolicy

reposUpdateDeploymentBranchPolicy

Update a deployment branch policy

Details

  • Method: PUT
  • Path: /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}
  • Operation ID: repos/update-deployment-branch-policy

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"
  },
  "environment_name": {
    "description": "The name of the environment. The name must be URL encoded. For example, any slashes in the name must be replaced with `%2F`.",
    "required": true,
    "location": "path",
    "type": "string"
  },
  "branch_policy_id": {
    "description": "The unique identifier of the branch policy.",
    "required": true,
    "location": "path",
    "type": "integer"
  },
  "name": {
    "description": "The name pattern that branches must match in order to deploy to the environment.\n\nWildcard characters will not match `/`. For example, to match branches that begin with `release/` and contain an additional single slash, use `release/*/*`.\nFor more information about pattern matching syntax, see the [Ruby File.fnmatch documentation](https://ruby-doc.org/core-2.5.1/File.html#method-c-fnmatch).",
    "required": true,
    "location": "body",
    "type": "string"
  }
}

Response Schema

{
  "title": "Deployment branch policy",
  "description": "Details of a deployment branch or tag policy.",
  "type": "object",
  "properties": {
    "id": {
      "description": "The unique identifier of the branch or tag policy.",
      "type": "integer",
      "example": 361471
    },
    "node_id": {
      "type": "string",
      "example": "MDE2OkdhdGVCcmFuY2hQb2xpY3kzNjE0NzE="
    },
    "name": {
      "description": "The name pattern that branches or tags must match in order to deploy to the environment.",
      "type": "string",
      "example": "release/*"
    },
    "type": {
      "description": "Whether this rule targets a branch or tag.",
      "type": "string",
      "example": "branch",
      "enum": [
        "branch",
        "tag"
      ]
    }
  }
}

Usage

from ocp_agent import OCPAgent

agent = OCPAgent()
await agent.register_api('github')

# Call this tool
result = await agent.call_tool('reposUpdateDeploymentBranchPolicy', {
    # Add required parameters here
})