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

reposGetStatusChecksProtection

Get status checks protection

Details

  • Method: GET
  • Path: /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks
  • Operation ID: repos/get-status-checks-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": "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('reposGetStatusChecksProtection', {
    # Add required parameters here
})