prow/github/client.go
func (c *Client) UpdateBranchProtection(org, repo, branch string, config BranchProtectionRequest) error {
	c.log("UpdateBranchProtection", org, repo, branch, config)
	_, err := c.request(&request{
		accept:      "application/vnd.github.luke-cage-preview+json", // for required_approving_review_count
		method:      http.MethodPut,
		path:        fmt.Sprintf("/repos/%s/%s/branches/%s/protection", org, repo, branch),
		requestBody: config,
		exitCodes:   []int{200},
	}, nil)
	return err
}
func (c *Client) UpdateBranchProtection(org, repo, branch string, config BranchProtectionRequest) error {
	c.log("UpdateBranchProtection", org, repo, branch, config)
	_, err := c.request(&request{
		accept:      "application/vnd.github.luke-cage-preview+json", // for required_approving_review_count
		method:      http.MethodPut,
		path:        fmt.Sprintf("/repos/%s/%s/branches/%s/protection", org, repo, branch),
		requestBody: config,
		exitCodes:   []int{200},
	}, nil)
	return err
}
func ( c * Client ) UpdateBranchProtection ( org , repo , branch string , config BranchProtectionRequest ) error { c . log ( " " , org , repo , branch , config ) _ , err := c . request ( & request { accept : " " , // for required_approving_review_count method : http . MethodPut , path : fmt . Sprintf ( " " , org , repo , branch ) , requestBody : config , exitCodes : [ ] int { 200 } , } , nil ) return err }
// UpdateBranchProtection configures org/repo=branch.
//
// See https://developer.github.com/v3/repos/branches/#update-branch-protection
UpdateBranchProtection configures org / repo = branch . See https : // developer . github . com / v3 / repos / branches / #update - branch - protection