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

Update the force branch protection inheritance setting of an organization

PUT
/orgs/{org}/branch_protection_inheritance
curl --request PUT \
--url https://gitea.example.com/api/v1/orgs/example/branch_protection_inheritance \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/json' \
--data '{ "force_inheritance": true }'

Gitea Enterprise only. This endpoint is not part of the community edition.

org
required
string

Name of the organization

Media typeapplication/json

OrgBranchProtectionInheritance represents the organization-level setting that forces all repositories of the organization to inherit its branch protection rules.

object
force_inheritance

Whether all repositories of the organization are forced to inherit the organization’s branch protection rules. When enabled, a repository can not opt out of inheritance.

boolean
Examplegenerated
{
"force_inheritance": true
}

OrgBranchProtectionInheritance

Media typeapplication/json

OrgBranchProtectionInheritance represents the organization-level setting that forces all repositories of the organization to inherit its branch protection rules.

object
force_inheritance

Whether all repositories of the organization are forced to inherit the organization’s branch protection rules. When enabled, a repository can not opt out of inheritance.

boolean
Examplegenerated
{
"force_inheritance": true
}

APINotFound is a not found empty response

Media typeapplication/json