diff --git a/github/event_types.go b/github/event_types.go index 5c81115877..f63c804033 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -20,12 +20,13 @@ type RequestedAction struct { // // GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#branch_protection_rule type BranchProtectionRuleEvent struct { - Action *string `json:"action,omitempty"` - Rule *BranchProtectionRule `json:"rule,omitempty"` - Changes *ProtectionChanges `json:"changes,omitempty"` - Repo *Repository `json:"repository,omitempty"` - Org *Organization `json:"organization,omitempty"` - Sender *User `json:"sender,omitempty"` + Action *string `json:"action,omitempty"` + Rule *BranchProtectionRule `json:"rule,omitempty"` + Changes *ProtectionChanges `json:"changes,omitempty"` + Repo *Repository `json:"repository,omitempty"` + Org *Organization `json:"organization,omitempty"` + Sender *User `json:"sender,omitempty"` + Installation *Installation `json:"installation,omitempty"` } // CheckRunEvent is triggered when a check run is "created", "completed", or "rerequested". diff --git a/github/github-accessors.go b/github/github-accessors.go index 8c6ebdadc0..166e2ad50c 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -1604,6 +1604,14 @@ func (b *BranchProtectionRuleEvent) GetChanges() *ProtectionChanges { return b.Changes } +// GetInstallation returns the Installation field. +func (b *BranchProtectionRuleEvent) GetInstallation() *Installation { + if b == nil { + return nil + } + return b.Installation +} + // GetOrg returns the Org field. func (b *BranchProtectionRuleEvent) GetOrg() *Organization { if b == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 246190dc42..fa4dc56c39 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -1928,6 +1928,13 @@ func TestBranchProtectionRuleEvent_GetChanges(tt *testing.T) { b.GetChanges() } +func TestBranchProtectionRuleEvent_GetInstallation(tt *testing.T) { + b := &BranchProtectionRuleEvent{} + b.GetInstallation() + b = nil + b.GetInstallation() +} + func TestBranchProtectionRuleEvent_GetOrg(tt *testing.T) { b := &BranchProtectionRuleEvent{} b.GetOrg() diff --git a/scrape/testdata/access-restrictions-disabled.html b/scrape/testdata/access-restrictions-disabled.html index 97e8133927..a5fbe34cab 100644 --- a/scrape/testdata/access-restrictions-disabled.html +++ b/scrape/testdata/access-restrictions-disabled.html @@ -2,16 +2,16 @@ Some extraneous markup removed to keep the file size smaller --> - +
- +
- +

Third-party application access policy

diff --git a/scrape/testdata/access-restrictions-enabled.html b/scrape/testdata/access-restrictions-enabled.html index 39ef4b4cde..4b8d1db816 100644 --- a/scrape/testdata/access-restrictions-enabled.html +++ b/scrape/testdata/access-restrictions-enabled.html @@ -2,10 +2,10 @@ Some extraneous markup removed to keep the file size smaller --> - +
- +
@@ -13,7 +13,7 @@
- +

Third-party application access policy

@@ -23,24 +23,24 @@

Third-party application access policy

Only approved applications can access data in this organization. Applications owned by google-test always have access.

- +
- + Remove restrictions

Are you sure?

- +
You’re about to remove all third-party application restrictions. Please read this carefully.
@@ -69,7 +69,7 @@

Are you sure?