Get whether a repository inherits the owner-level branch protection rules
GET
/repos/{owner}/{repo}/branch_protection_inheritance
const url = 'https://gitea.example.com/api/v1/repos/example/example/branch_protection_inheritance';const options = {method: 'GET', headers: {Authorization: 'Basic <credentials>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://gitea.example.com/api/v1/repos/example/example/branch_protection_inheritance \ --header 'Authorization: Basic <credentials>'Gitea Enterprise only. This endpoint is not part of the community edition.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”owner
required
string
Owner of the repo
repo
required
string
Name of the repo
Responses
Section titled “Responses”RepoBranchProtectionInheritance
Media typeapplication/json
RepoBranchProtectionInheritance represents whether a repository inherits the branch protection rules defined at its owner level.
object
inherit
Whether the repository inherits the owner-level branch protection rules. This only takes effect when the owner does not force inheritance.
boolean
Examplegenerated
{ "inherit": true}APINotFound is a not found empty response
Media typeapplication/json