gh ruleset check
gh ruleset check [<branch>] [flags]
查看应用于给定分支的 GitHub 规则信息。
提供的分支名称无需存在;将显示应用于具有该名称的分支的规则。所有规则都会返回,无论其配置位置。
如果没有提供分支名称,则将使用当前分支。
可以使用 --default
标志查看应用于仓库默认分支的规则。
选项
-
--default
- 检查默认分支上的规则
-w
,--web
- 在网络浏览器中打开分支规则页面
从父命令继承的选项
-R
,--repo <[HOST/]OWNER/REPO>
- 使用 [HOST/]OWNER/REPO 格式选择另一个仓库
示例
# View all rules that apply to the current branch
$ gh ruleset check
# View all rules that apply to a branch named "my-branch" in a different repository
$ gh ruleset check my-branch --repo owner/repo
# View all rules that apply to the default branch in a different repository
$ gh ruleset check --default --repo owner/repo
# View a ruleset configured in a different repository or any of its parents
$ gh ruleset view 23 --repo owner/repo
# View an organization-level ruleset
$ gh ruleset view 23 --org my-org