GitSettings
创建保护分支规则。Create branch protection rule.
为指定仓库创建保护分支规则。每个仓库最多支持 10 条保护分支规则。需要仓库 Master 权限。创建成功后返回 201 状态码。 Create a branch protection rule for the specified repository. Maximum 10 rules per repository. Requires Master permission. Returns 201 on success. 访问令牌调用此接口需包含以下权限。Required permissions for access token. repo-manage:rw
post/{repo}/-/settings/branch-protections
Request
- Base URL: https://api.cnb.cool (the document declares no server; this is the origin it was published from)
- URL: https://api.cnb.cool/{repo}/-/settings/branch-protections
- Auth: API key in header Authorization
Path parameters
repostring required
不带.git后缀的仓库名称。格式:组织名称/仓库名称。Repository name without .git suffix. Format: org/repo.
Request body
Response
Created
Changes
No recorded changes to this operation across all 1 revision of this API.