gpt4 book ai didi

github-api - 使用 Github REST API 创建部署分支规则

转载 作者:行者123 更新时间:2023-12-05 05:54:10 24 4
gpt4 key购买 nike

我正在使用 github rest api 来创建 repo 环境:

https://docs.github.com/en/rest/reference/repos#create-or-update-an-environment

API 允许我们选择 deployment_branch_policy.custom_branch_policies: (boolean) 但我找不到使用自定义模式创建 部署分支规则 的方法,例如你会在 UI 上做:

enter image description here

有什么方法可以通过 REST api 创建它吗?

非常感谢

最佳答案

应该可以通过 Deployment branch policies API 来完成:

The Deployment branch policies API allows you to specify custom name patterns that branches must match in order to deploy to an environment. The deployment_branch_policy.custom_branch_policies property for the environment must be set to true to use these endpoints. To update the deployment_branch_policy for an environment, see "Create or update an environment."

For more information about restricting environment deployments to certain branches, see "Using environments for deployment."

关于github-api - 使用 Github REST API 创建部署分支规则,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69697460/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com