Skip to content

Commit

Permalink
Add fields to Branch Protection endpoint (#2744)
Browse files Browse the repository at this point in the history
Fixes: #2719.
  • Loading branch information
yardenshoham authored Apr 9, 2023
1 parent 4fec23d commit 4caa1d6
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 1 deletion.
32 changes: 32 additions & 0 deletions github/github-accessors.go

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

37 changes: 37 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.

6 changes: 5 additions & 1 deletion github/repos.go
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,8 @@ type Protection struct {
BlockCreations *BlockCreations `json:"block_creations,omitempty"`
LockBranch *LockBranch `json:"lock_branch,omitempty"`
AllowForkSyncing *AllowForkSyncing `json:"allow_fork_syncing,omitempty"`
RequiredSignatures *SignaturesProtectedBranch `json:"required_signatures,omitempty"`
URL *string `json:"url,omitempty"`
}

// BlockCreations represents whether users can push changes that create branches. If this is true, this
Expand Down Expand Up @@ -1023,7 +1025,9 @@ type RequiredStatusChecks struct {
Contexts []string `json:"contexts,omitempty"`
// The list of status checks to require in order to merge into this
// branch.
Checks []*RequiredStatusCheck `json:"checks"`
Checks []*RequiredStatusCheck `json:"checks"`
ContextsURL *string `json:"contexts_url,omitempty"`
URL *string `json:"url,omitempty"`
}

// RequiredStatusChecksRequest represents a request to edit a protected branch's status checks.
Expand Down

0 comments on commit 4caa1d6

Please sign in to comment.