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

Fix JSON protection unmarshal error #2606

Merged
merged 1 commit into from
Dec 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 26 additions & 10 deletions github/github-accessors.go

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

30 changes: 22 additions & 8 deletions github/github-accessors_test.go

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

16 changes: 12 additions & 4 deletions github/repos.go
Original file line number Diff line number Diff line change
Expand Up @@ -843,10 +843,18 @@ type Protection struct {
AllowForcePushes *AllowForcePushes `json:"allow_force_pushes"`
AllowDeletions *AllowDeletions `json:"allow_deletions"`
RequiredConversationResolution *RequiredConversationResolution `json:"required_conversation_resolution"`
// LockBranch represents if the branch is marked as read-only. If this is true, users will not be able to push to the branch.
LockBranch *bool `json:"lock_branch,omitempty"`
// AllowForkSyncing represents whether users can pull changes from upstream when the branch is locked.
AllowForkSyncing *bool `json:"allow_fork_syncing,omitempty"`
LockBranch *LockBranch `json:"lock_branch,omitempty"`
AllowForkSyncing *AllowForkSyncing `json:"allow_fork_syncing,omitempty"`
}

// LockBranch represents if the branch is marked as read-only. If this is true, users will not be able to push to the branch.
type LockBranch struct {
Enabled *bool `json:"enabled,omitempty"`
}

// AllowForkSyncing represents whether users can pull changes from upstream when the branch is locked.
type AllowForkSyncing struct {
Enabled *bool `json:"enabled,omitempty"`
}

// BranchProtectionRule represents the rule applied to a repositories branch.
Expand Down