Skip to content

Commit dd4d2a1

Browse files
author
Emma Sax
authored
Turn RequiredStatusChecks Checks and Contexts into pointers (#3070)
Fixes: #2976 and #2467.
1 parent 5145e7f commit dd4d2a1

File tree

5 files changed

+384
-27
lines changed

5 files changed

+384
-27
lines changed

github/github-accessors.go

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/github-accessors_test.go

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/repos.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,20 +1191,20 @@ type RequiredStatusChecks struct {
11911191
// Require branches to be up to date before merging. (Required.)
11921192
Strict bool `json:"strict"`
11931193
// The list of status checks to require in order to merge into this
1194-
// branch. (Deprecated. Note: only one of Contexts/Checks can be populated,
1195-
// but at least one must be populated).
1196-
Contexts []string `json:"contexts,omitempty"`
1194+
// branch. An empty slice is valid. (Deprecated. Note: only one of
1195+
// Contexts/Checks can be populated, but at least one must be populated).
1196+
Contexts *[]string `json:"contexts,omitempty"`
11971197
// The list of status checks to require in order to merge into this
1198-
// branch.
1199-
Checks []*RequiredStatusCheck `json:"checks,omitempty"`
1200-
ContextsURL *string `json:"contexts_url,omitempty"`
1201-
URL *string `json:"url,omitempty"`
1198+
// branch. An empty slice is valid.
1199+
Checks *[]*RequiredStatusCheck `json:"checks,omitempty"`
1200+
ContextsURL *string `json:"contexts_url,omitempty"`
1201+
URL *string `json:"url,omitempty"`
12021202
}
12031203

12041204
// RequiredStatusChecksRequest represents a request to edit a protected branch's status checks.
12051205
type RequiredStatusChecksRequest struct {
12061206
Strict *bool `json:"strict,omitempty"`
1207-
// Note: if both Contexts and Checks are populated,
1207+
// Deprecated. Note: if both Contexts and Checks are populated,
12081208
// the GitHub API will only use Checks.
12091209
Contexts []string `json:"contexts,omitempty"`
12101210
Checks []*RequiredStatusCheck `json:"checks,omitempty"`

0 commit comments

Comments
 (0)