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 LockBranch and AllowForkSyncing to repos.go #2577

Merged
merged 5 commits into from Nov 28, 2022
Merged
Changes from 2 commits
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
12 changes: 12 additions & 0 deletions github/repos.go
Expand Up @@ -840,6 +840,8 @@ type Protection struct {
AllowForcePushes *AllowForcePushes `json:"allow_force_pushes"`
AllowDeletions *AllowDeletions `json:"allow_deletions"`
RequiredConversationResolution *RequiredConversationResolution `json:"required_conversation_resolution"`
LockBranch *LockBranch `json:"lock_branch"`
AllowForkSyncing *AllowForkSyncing `json:"allow_fork_syncing"`
XaurDesu marked this conversation as resolved.
Show resolved Hide resolved
}

// BranchProtectionRule represents the rule applied to a repositories branch.
Expand Down Expand Up @@ -894,11 +896,21 @@ type AdminEnforcedChanges struct {
From *bool `json:"from,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 {
From *bool `json:"lock_branch"`
}

XaurDesu marked this conversation as resolved.
Show resolved Hide resolved
// AllowDeletionsEnforcementLevelChanges represents the changes made to the AllowDeletionsEnforcementLevel policy.
type AllowDeletionsEnforcementLevelChanges struct {
From *string `json:"from,omitempty"`
}

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

XaurDesu marked this conversation as resolved.
Show resolved Hide resolved
// AuthorizedActorNames represents who are authorized to edit the branch protection rules.
type AuthorizedActorNames struct {
From []string `json:"from,omitempty"`
Expand Down