diff --git a/github/github-accessors.go b/github/github-accessors.go index 90b9233439..85c899c568 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -12636,6 +12636,14 @@ func (p *PullRequestReviewsEnforcementUpdate) GetDismissStaleReviews() bool { return *p.DismissStaleReviews } +// GetRequireCodeOwnerReviews returns the RequireCodeOwnerReviews field if it's non-nil, zero value otherwise. +func (p *PullRequestReviewsEnforcementUpdate) GetRequireCodeOwnerReviews() bool { + if p == nil || p.RequireCodeOwnerReviews == nil { + return false + } + return *p.RequireCodeOwnerReviews +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (p *PullRequestTargetEvent) GetAction() string { if p == nil || p.Action == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index df8754f518..63e31b5c9d 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -14716,6 +14716,16 @@ func TestPullRequestReviewsEnforcementUpdate_GetDismissStaleReviews(tt *testing. p.GetDismissStaleReviews() } +func TestPullRequestReviewsEnforcementUpdate_GetRequireCodeOwnerReviews(tt *testing.T) { + var zeroValue bool + p := &PullRequestReviewsEnforcementUpdate{RequireCodeOwnerReviews: &zeroValue} + p.GetRequireCodeOwnerReviews() + p = &PullRequestReviewsEnforcementUpdate{} + p.GetRequireCodeOwnerReviews() + p = nil + p.GetRequireCodeOwnerReviews() +} + func TestPullRequestTargetEvent_GetAction(tt *testing.T) { var zeroValue string p := &PullRequestTargetEvent{Action: &zeroValue} diff --git a/github/repos.go b/github/repos.go index 42cd163678..2b1139b679 100644 --- a/github/repos.go +++ b/github/repos.go @@ -944,10 +944,10 @@ type PullRequestReviewsEnforcementUpdate struct { DismissalRestrictionsRequest *DismissalRestrictionsRequest `json:"dismissal_restrictions,omitempty"` // Specifies if approved reviews can be dismissed automatically, when a new commit is pushed. Can be omitted. DismissStaleReviews *bool `json:"dismiss_stale_reviews,omitempty"` - // RequireCodeOwnerReviews specifies if an approved review is required in pull requests including files with a designated code owner. - RequireCodeOwnerReviews bool `json:"require_code_owner_reviews,omitempty"` + // RequireCodeOwnerReviews specifies if merging pull requests is blocked until code owners have reviewed. + RequireCodeOwnerReviews *bool `json:"require_code_owner_reviews,omitempty"` // RequiredApprovingReviewCount specifies the number of approvals required before the pull request can be merged. - // Valid values are 1 - 6. + // Valid values are 1 - 6 or 0 to not require reviewers. RequiredApprovingReviewCount int `json:"required_approving_review_count"` }