@@ -877,14 +877,33 @@ type RequiredStatusChecks struct {
877877 // Require branches to be up to date before merging. (Required.)
878878 Strict bool `json:"strict"`
879879 // The list of status checks to require in order to merge into this
880- // branch. (Required; use []string{} instead of nil for empty list.)
881- Contexts []string `json:"contexts"`
880+ // branch. (Deprecated. Note: only one of Contexts/Checks can be populated,
881+ // but at least one must be populated).
882+ Contexts []string `json:"contexts,omitempty"`
883+ // The list of status checks to require in order to merge into this
884+ // branch.
885+ Checks []* RequiredStatusCheck `json:"checks,omitempty"`
882886}
883887
884888// RequiredStatusChecksRequest represents a request to edit a protected branch's status checks.
885889type RequiredStatusChecksRequest struct {
886- Strict * bool `json:"strict,omitempty"`
887- Contexts []string `json:"contexts,omitempty"`
890+ Strict * bool `json:"strict,omitempty"`
891+ // Note: if both Contexts and Checks are populated,
892+ // the GitHub API will only use Checks.
893+ Contexts []string `json:"contexts,omitempty"`
894+ Checks []* RequiredStatusCheck `json:"checks,omitempty"`
895+ }
896+
897+ // RequiredStatusCheck represents a status check of a protected branch.
898+ type RequiredStatusCheck struct {
899+ // The name of the required check.
900+ Context string `json:"context"`
901+ // The ID of the GitHub App that must provide this check.
902+ // Omit this field to automatically select the GitHub App
903+ // that has recently provided this check,
904+ // or any app if it was not set by a GitHub App.
905+ // Pass -1 to explicitly allow any app to set the status.
906+ AppID * int64 `json:"app_id,omitempty"`
888907}
889908
890909// PullRequestReviewsEnforcement represents the pull request reviews enforcement of a protected branch.
0 commit comments