跳转到内容

cnb-rs repo branch lock

cnb-rs repo branch lock <BRANCH>

临时锁定分支,禁止 push(区别于 settings branch-protection 的永久规则)。

参数

  • <BRANCH>: 分支名(必填)

继承的全局选项:

  • --repo <REPO>: 指定仓库路径

适用场景

  • Release 期间禁 push 到 main,避免临时改动混入打包
  • 调试某分支 CI 失败,避免新提交干扰
  • 紧急安全冻结某分支

长期治理(如「main 永远要 PR review」)请用 repo settings branch-protection

示例

bash
cnb-rs --repo wwvo/cnb-rs/cnb-rs repo branch lock main

API

步骤API方法
锁分支${CNB_API_ENDPOINT}/{repo}/-/git/branch-locks/{branch}POST

另请参阅

Released under the MIT License.