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

reposUpdateStatusCheckProtection

Update status check protection

Details

  • Method: PATCH
  • Path: /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks
  • Operation ID: repos/update-status-check-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"
  },
  "strict": {
    "description": "Require branches to be up to date before merging.",
    "required": false,
    "location": "body",
    "type": "boolean"
  },
  "contexts": {
    "description": "**Closing down notice**: The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control.",
    "required": false,
    "location": "body",
    "type": "array"
  },
  "checks": {
    "description": "The list of status checks to require in order to merge into this branch.",
    "required": false,
    "location": "body",
    "type": "array"
  }
}

Response Schema

{
  "title": "Status Check Policy",
  "description": "Status Check Policy",
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "format": "uri",
      "example": "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks"
    },
    "strict": {
      "type": "boolean",
      "example": true
    },
    "contexts": {
      "type": "array",
      "example": [
        "continuous-integration/travis-ci"
      ],
      "items": {
        "type": "string"
      }
    },
    "checks": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "context": {
            "type": "string",
            "example": "continuous-integration/travis-ci"
          },
          "app_id": {
            "type": "integer",
            "nullable": true
          }
        },
        "required": [
          "context",
          "app_id"
        ]
      }
    },
    "contexts_url": {
      "type": "string",
      "format": "uri",
      "example": "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_status_checks/contexts"
    }
  },
  "required": [
    "url",
    "contexts_url",
    "strict",
    "contexts",
    "checks"
  ]
}

Usage

from ocp_agent import OCPAgent

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

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