是否可以使用API将
Do not allow bypassing the above settings
设置为true?在文档中找不到它https://docs.github.com/en/[email protected]/rest/branches/branch-protection并且服务器响应不返回此类属性
您可以使用以下命令启用“不允许绕过上述设置”设置
curl -L \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR_GITHUB_TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/OWNER/REPO/branches/BRANCH/protection \
-d '{
"required_status_checks": null,
"enforce_admins": true,
"required_pull_request_reviews": null,
"restrictions": null,
}'