Repository: google/go-github
File: github/repos.go (Go)

Code before:
	// RequiredApprovingReviewCount specifies the number of approvals required before the pull request can be merged.
	// Valid values are 1-6.
	RequiredApprovingReviewCount int `json:"required_approving_review_count"`
	// RequireLastPushApproval specifies whether the last pusher to a pull request branch can approve it.
	RequireLastPushApproval bool `json:"require_last_push_approval"`
}

// PullRequestReviewsEnforcementRequest represents request to set the pull request review
// enforcement of a protected branch. It is separate from PullRequestReviewsEnforcement above
// because the request structure is different from the response structure.
type PullRequestReviewsEnforcementRequest struct {
	// Allow specific users, teams, or apps to bypass pull request requirements.
	BypassPullRequestAllowancesRequest *BypassPullRequestAllowancesRequest `json:"bypass_pull_request_allowances,omitempty"`
	// Specifies which users, teams and apps should be allowed to dismiss pull request reviews.
	// User, team and app dismissal restrictions are only available for
	// organization-owned repositories. Must be nil for personal repositories.
	DismissalRestrictionsRequest *DismissalRestrictionsRequest `json:"dismissal_restrictions,omitempty"`
	// Specifies if approved reviews can be dismissed automatically, when a new commit is pushed. (Required)
	DismissStaleReviews bool `json:"dismiss_stale_reviews"`
	// 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"`
	// RequiredApprovingReviewCount specifies the number of approvals required before the pull request can be merged.
	// Valid values are 1-6.
	RequiredApprovingReviewCount int `json:"required_approving_review_count"`
	// RequireLastPushApproval specifies whether the last pusher to a pull request branch can approve it.
	RequireLastPushApproval bool `json:"require_last_push_approval"`
}

// PullRequestReviewsEnforcementUpdate represents request to patch the pull request review
// enforcement of a protected branch. It is separate from PullRequestReviewsEnforcementRequest above
// because the patch request does not require all fields to be initialized.
type PullRequestReviewsEnforcementUpdate struct {
	// Allow specific users, teams, or apps to bypass pull request requirements.
	BypassPullRequestAllowancesRequest *BypassPullRequestAllowancesRequest `json:"bypass_pull_request_allowances,omitempty"`
	// Specifies which users, teams and apps can dismiss pull request reviews. Can be omitted.
	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 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 or 0 to not require reviewers.
	RequiredApprovingReviewCount int `json:"required_approving_review_count"`
	// RequireLastPushApproval specifies whether the last pusher to a pull request branch can approve it.
	RequireLastPushApproval *bool `json:"require_last_push_approval,omitempty"`
}

// RequireLinearHistory represents the configuration to enforce branches with no merge commit.
type RequireLinearHistory struct {
	Enabled bool `json:"enabled"`
}

Review comment (suggestion):
```suggestion
	RequireLastPushApproval *bool `json:"require_last_push_approval,omitempty"`
```

Code after:
	// RequiredApprovingReviewCount specifies the number of approvals required before the pull request can be merged.
	// Valid values are 1-6.
	RequiredApprovingReviewCount int `json:"required_approving_review_count"`
	// RequireLastPushApproval specifies whether the last pusher to a pull request branch can approve it.
	RequireLastPushApproval bool `json:"require_last_push_approval"`
}

// PullRequestReviewsEnforcementRequest represents request to set the pull request review
// enforcement of a protected branch. It is separate from PullRequestReviewsEnforcement above
// because the request structure is different from the response structure.
type PullRequestReviewsEnforcementRequest struct {
	// Allow specific users, teams, or apps to bypass pull request requirements.
	BypassPullRequestAllowancesRequest *BypassPullRequestAllowancesRequest `json:"bypass_pull_request_allowances,omitempty"`
	// Specifies which users, teams and apps should be allowed to dismiss pull request reviews.
	// User, team and app dismissal restrictions are only available for
	// organization-owned repositories. Must be nil for personal repositories.
	DismissalRestrictionsRequest *DismissalRestrictionsRequest `json:"dismissal_restrictions,omitempty"`
	// Specifies if approved reviews can be dismissed automatically, when a new commit is pushed. (Required)
	DismissStaleReviews bool `json:"dismiss_stale_reviews"`
	// 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"`
	// RequiredApprovingReviewCount specifies the number of approvals required before the pull request can be merged.
	// Valid values are 1-6.
	RequiredApprovingReviewCount int `json:"required_approving_review_count"`
	// RequireLastPushApproval specifies whether the last pusher to a pull request branch can approve it.
	RequireLastPushApproval *bool `json:"require_last_push_approval,omitempty"`
}

// PullRequestReviewsEnforcementUpdate represents request to patch the pull request review
// enforcement of a protected branch. It is separate from PullRequestReviewsEnforcementRequest above
// because the patch request does not require all fields to be initialized.
type PullRequestReviewsEnforcementUpdate struct {
	// Allow specific users, teams, or apps to bypass pull request requirements.
	BypassPullRequestAllowancesRequest *BypassPullRequestAllowancesRequest `json:"bypass_pull_request_allowances,omitempty"`
	// Specifies which users, teams and apps can dismiss pull request reviews. Can be omitted.
	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 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 or 0 to not require reviewers.
	RequiredApprovingReviewCount int `json:"required_approving_review_count"`
	// RequireLastPushApproval specifies whether the last pusher to a pull request branch can approve it.
	RequireLastPushApproval *bool `json:"require_last_push_approval,omitempty"`
}

// RequireLinearHistory represents the configuration to enforce branches with no merge commit.
type RequireLinearHistory struct {
	Enabled bool `json:"enabled"`
}