Update whether a repository inherits the owner-level branch protection rules
PUT
/repos/{owner}/{repo}/branch_protection_inheritance
const url = 'https://gitea.example.com/api/v1/repos/example/example/branch_protection_inheritance';const options = { method: 'PUT', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"inherit":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://gitea.example.com/api/v1/repos/example/example/branch_protection_inheritance \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "inherit": true }'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
Request Body
Section titled “Request Body”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}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
APIValidationError is error format response related to input validation
Media typeapplication/json
Headers
Section titled “Headers”message
string
url
string
APIRepoArchivedError is an error that is raised when an archived repo should be modified
Media typeapplication/json
Headers
Section titled “Headers”message
string
url
string