跳转到内容
Try Gitea Cloud ☁️ for 30 days → Accelerate your Development & Deploys!
Support

Update whether a repository inherits the owner-level branch protection rules

PUT
/repos/{owner}/{repo}/branch_protection_inheritance
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.

owner
required
string

Owner of the repo

repo
required
string

Name of the repo

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
}

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

APIValidationError is error format response related to input validation

message
string
url
string

APIRepoArchivedError is an error that is raised when an archived repo should be modified

message
string
url
string