Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add checks field to RequiredStatusChecks #2276

Merged
merged 3 commits into from Jan 31, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions github/github-accessors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions github/github-accessors_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 23 additions & 4 deletions github/repos.go
Expand Up @@ -877,14 +877,33 @@ type RequiredStatusChecks struct {
// Require branches to be up to date before merging. (Required.)
Strict bool `json:"strict"`
// The list of status checks to require in order to merge into this
// branch. (Required; use []string{} instead of nil for empty list.)
Contexts []string `json:"contexts"`
// branch. (Deprecated. Note: only one of Contexts/Checks can be populated,
// but at least one must be populated).
Contexts []string `json:"contexts,omitempty"`
// The list of status checks to require in order to merge into this
// branch.
Checks []*RequiredStatusCheck `json:"checks,omitempty"`
}

// RequiredStatusChecksRequest represents a request to edit a protected branch's status checks.
type RequiredStatusChecksRequest struct {
Strict *bool `json:"strict,omitempty"`
Contexts []string `json:"contexts,omitempty"`
Strict *bool `json:"strict,omitempty"`
// Note: if both Contexts and Checks are populated,
// the Github API will only use Checks.
gmlewis marked this conversation as resolved.
Show resolved Hide resolved
Contexts []string `json:"contexts,omitempty"`
Checks []RequiredStatusCheck `json:"checks,omitempty"`
gmlewis marked this conversation as resolved.
Show resolved Hide resolved
}

// RequiredStatusCheck represents a status check of a protected branch.
type RequiredStatusCheck struct {
// The name of the required check.
Context string `json:"context"`
// The ID of the GitHub App that must provide this check.
// Omit this field to automatically select the GitHub App
// that has recently provided this check,
// or any app if it was not set by a GitHub App.
// Pass -1 to explicitly allow any app to set the status.
AppID *int64 `json:"app_id,omitempty"`
}

// PullRequestReviewsEnforcement represents the pull request reviews enforcement of a protected branch.
Expand Down