Skip to content

Commit eeac201

Browse files
authored
fix: Add missing require_last_push_approval field to branch protection rule event structs (#3623)
1 parent b758928 commit eeac201

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed

github/github-accessors.go

Lines changed: 24 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: 30 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: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,6 +1074,7 @@ type BranchProtectionRule struct {
10741074
RequiredConversationResolutionLevel *string `json:"required_conversation_resolution_level,omitempty"`
10751075
AuthorizedActorsOnly *bool `json:"authorized_actors_only,omitempty"`
10761076
AuthorizedActorNames []string `json:"authorized_actor_names,omitempty"`
1077+
RequireLastPushApproval *bool `json:"require_last_push_approval,omitempty"`
10771078
}
10781079

10791080
// ProtectionChanges represents the changes to the rule if the BranchProtection was edited.
@@ -1093,6 +1094,7 @@ type ProtectionChanges struct {
10931094
RequiredStatusChecks *RequiredStatusChecksChanges `json:"required_status_checks,omitempty"`
10941095
RequiredStatusChecksEnforcementLevel *RequiredStatusChecksEnforcementLevelChanges `json:"required_status_checks_enforcement_level,omitempty"`
10951096
SignatureRequirementEnforcementLevel *SignatureRequirementEnforcementLevelChanges `json:"signature_requirement_enforcement_level,omitempty"`
1097+
RequireLastPushApproval *RequireLastPushApprovalChanges `json:"require_last_push_approval,omitempty"`
10961098
}
10971099

10981100
// AdminEnforcedChanges represents the changes made to the AdminEnforced policy.
@@ -1170,6 +1172,11 @@ type SignatureRequirementEnforcementLevelChanges struct {
11701172
From *string `json:"from,omitempty"`
11711173
}
11721174

1175+
// RequireLastPushApprovalChanges represents the changes made to the RequireLastPushApproval policy.
1176+
type RequireLastPushApprovalChanges struct {
1177+
From *bool `json:"from,omitempty"`
1178+
}
1179+
11731180
// ProtectionRequest represents a request to create/edit a branch's protection.
11741181
type ProtectionRequest struct {
11751182
RequiredStatusChecks *RequiredStatusChecks `json:"required_status_checks"`

0 commit comments

Comments
 (0)