Repository: google/go-github
Pull request #3338 (2024-10-27 12:05:32)

build(deps): bump github.com/theupdateframework/go-tuf/v2 from 2.0.0 to 2.0.1 in /example in the go_modules group
Bumps the go_modules group in /example with 1 update: [github.com/theupdateframework/go-tuf/v2](https://github.com/theupdateframework/go-tuf).

Updates `github.com/theupdateframework/go-tuf/v2` from 2.0.0 to 2.0.1
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/theupdateframework/go-tuf/releases">github.com/theupdateframework/go-tuf/v2's releases</a>.</em></p>
<blockquote>
<h2>v2.0.1</h2>
<h2>What's Changed</h2>
<h3>Security</h3>
<ul>
<li>Fix incorrect delegation lookups that can make go-tuf download the wrong artifact by <a href="https://github.com/rdimitrov"><code>@​rdimitrov</code></a> (Thanks to <a href="https://github.com/AdamKorcz"><code>@​AdamKorcz</code></a> for reporting it). This fixes CVE-2024-47534 <a href="https://github.com/theupdateframework/go-tuf/security/advisories/GHSA-4f8r-qqr9-fq8j">GHSA-4f8r-qqr9-fq8j</a></li>
</ul>
<h3>Other</h3>
<ul>
<li>Update MAINTAINERS.md by <a href="https://github.com/trishankatdatadog"><code>@​trishankatdatadog</code></a> in <a href="https://redirect.github.com/theupdateframework/go-tuf/pull/647">theupdateframework/go-tuf#647</a></li>
<li>Update the staging TUF repo in the multi-repo example by <a href="https://github.com/rdimitrov"><code>@​rdimitrov</code></a> in <a href="https://redirect.github.com/theupdateframework/go-tuf/pull/650">theupdateframework/go-tuf#650</a></li>
<li>Fix branch name in multi-repo client example by <a href="https://github.com/rdimitrov"><code>@​rdimitrov</code></a> in <a href="https://redirect.github.com/theupdateframework/go-tuf/pull/651">theupdateframework/go-tuf#651</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/theupdateframework/go-tuf/compare/v2.0.0...v2.0.1">https://github.com/theupdateframework/go-tuf/compare/v2.0.0...v2.0.1</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/theupdateframework/go-tuf/commit/6c47391ef3da3eac29e7b019da00e072303bd748"><code>6c47391</code></a> Fix branch name in multi-repo client example (<a href="https://redirect.github.com/theupdateframework/go-tuf/issues/651">#651</a>)</li>
<li><a href="https://github.com/theupdateframework/go-tuf/commit/eee48422ef8cf9968448cb7dd029261806113def"><code>eee4842</code></a> Update the staging TUF repo in the multi-repo example (<a href="https://redirect.github.com/theupdateframework/go-tuf/issues/650">#650</a>)</li>
<li><a href="https://github.com/theupdateframework/go-tuf/commit/f36420caba9edbfdfd64f95a9554c0836d9cf819"><code>f36420c</code></a> Merge commit from fork</li>
<li><a href="https://github.com/theupdateframework/go-tuf/commit/f95222bdd22d2ac4e5b8ed6fe912b645e213c3b5"><code>f95222b</code></a> Update MAINTAINERS.md (<a href="https://redirect.github.com/theupdateframework/go-tuf/issues/647">#647</a>)</li>
<li>See full diff in <a href="https://github.com/theupdateframework/go-tuf/compare/v2.0.0...v2.0.1">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/theupdateframework/go-tuf/v2&package-manager=go_modules&previous-version=2.0.0&new-version=2.0.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions
You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/google/go-github/network/alerts).

</details>


Patch:
diff --git a/example/go.mod b/example/go.mod
index 5de15d59..e234c569 100644
--- a/example/go.mod
+++ b/example/go.mod
@@ -78,7 +78,7 @@ require (
 	github.com/spf13/viper v1.18.2 // indirect
 	github.com/subosito/gotenv v1.6.0 // indirect
 	github.com/theupdateframework/go-tuf v0.7.0 // indirect
-	github.com/theupdateframework/go-tuf/v2 v2.0.0 // indirect
+	github.com/theupdateframework/go-tuf/v2 v2.0.1 // indirect
 	github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 // indirect
 	github.com/transparency-dev/merkle v0.0.2 // indirect
 	go.mongodb.org/mongo-driver v1.14.0 // indirect
diff --git a/example/go.sum b/example/go.sum
index facdd200..a7ec2d5a 100644
--- a/example/go.sum
+++ b/example/go.sum
@@ -324,8 +324,8 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8
 github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
 github.com/theupdateframework/go-tuf v0.7.0 h1:CqbQFrWo1ae3/I0UCblSbczevCCbS31Qvs5LdxRWqRI=
 github.com/theupdateframework/go-tuf v0.7.0/go.mod h1:uEB7WSY+7ZIugK6R1hiBMBjQftaFzn7ZCDJcp1tCUug=
-github.com/theupdateframework/go-tuf/v2 v2.0.0 h1:rD8d9RotYBprZVgC+9oyTZ5MmawepnTSTqoDuxjWgbs=
-github.com/theupdateframework/go-tuf/v2 v2.0.0/go.mod h1:baB22nBHeHBCeuGZcIlctNq4P61PcOdyARlplg5xmLA=
+github.com/theupdateframework/go-tuf/v2 v2.0.1 h1:11p9tXpq10KQEujxjcIjDSivMKCMLguls7erXHZnxJQ=
+github.com/theupdateframework/go-tuf/v2 v2.0.1/go.mod h1:baB22nBHeHBCeuGZcIlctNq4P61PcOdyARlplg5xmLA=
 github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 h1:e/5i7d4oYZ+C1wj2THlRK+oAhjeS/TRQwMfkIuet3w0=
 github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399/go.mod h1:LdwHTNJT99C5fTAzDz0ud328OgXz+gierycbcIx2fRs=
 github.com/transparency-dev/merkle v0.0.2 h1:Q9nBoQcZcgPamMkGn7ghV8XiTZ/kRxn1yCG81+twTK4=
diff --git a/github/event_types.go b/github/event_types.go
index f9778215..40ad919b 100644
--- a/github/event_types.go
+++ b/github/event_types.go
@@ -29,6 +29,19 @@ type BranchProtectionRuleEvent struct {
 	Installation *Installation         `json:"installation,omitempty"`
 }
 
+// BranchProtectionConfigurationEvent is triggered when there is a change to branch protection configurations for a repository.
+// The Webhook event name is "branch_protection_configuration".
+//
+// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#branch_protection_configuration
+type BranchProtectionConfigurationEvent struct {
+	Action       *string       `json:"action,omitempty"`
+	Repo         *Repository   `json:"repository,omitempty"`
+	Org          *Organization `json:"organization,omitempty"`
+	Enterprise   *Enterprise   `json:"enterprise,omitempty"`
+	Sender       *User         `json:"sender,omitempty"`
+	Installation *Installation `json:"installation,omitempty"`
+}
+
 // CheckRunEvent is triggered when a check run is "created", "completed", or "rerequested".
 // The Webhook event name is "check_run".
 //
@@ -1580,6 +1593,20 @@ type SecretScanningAlertEvent struct {
 	Installation *Installation `json:"installation,omitempty"`
 }
 
+// SecretScanningAlertLocationEvent is triggered when there is activity relating to the locations of a secret in a secret scanning alert.
+// The Webhook event name is "secret_scanning_alert_location".
+//
+// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#secret_scanning_alert_location
+type SecretScanningAlertLocationEvent struct {
+	Action       *string                      `json:"action,omitempty"`
+	Alert        *SecretScanningAlert         `json:"alert,omitempty"`
+	Installation *Installation                `json:"installation,omitempty"`
+	Location     *SecretScanningAlertLocation `json:"location,omitempty"`
+	Organization *Organization                `json:"organization,omitempty"`
+	Repo         *Repository                  `json:"repository,omitempty"`
+	Sender       *User                        `json:"sender,omitempty"`
+}
+
 // SecurityAndAnalysisEvent is triggered when code security and analysis features
 // are enabled or disabled for a repository.
 //
diff --git a/github/github-accessors.go b/github/github-accessors.go
index ea4cfb75..acc54e7d 100644
--- a/github/github-accessors.go
+++ b/github/github-accessors.go
@@ -1646,6 +1646,54 @@ func (b *BranchPolicy) GetProtectedBranches() bool {
 	return *b.ProtectedBranches
 }
 
+// GetAction returns the Action field if it's non-nil, zero value otherwise.
+func (b *BranchProtectionConfigurationEvent) GetAction() string {
+	if b == nil || b.Action == nil {
+		return ""
+	}
+	return *b.Action
+}
+
+// GetEnterprise returns the Enterprise field.
+func (b *BranchProtectionConfigurationEvent) GetEnterprise() *Enterprise {
+	if b == nil {
+		return nil
+	}
+	return b.Enterprise
+}
+
+// GetInstallation returns the Installation field.
+func (b *BranchProtectionConfigurationEvent) GetInstallation() *Installation {
+	if b == nil {
+		return nil
+	}
+	return b.Installation
+}
+
+// GetOrg returns the Org field.
+func (b *BranchProtectionConfigurationEvent) GetOrg() *Organization {
+	if b == nil {
+		return nil
+	}
+	return b.Org
+}
+
+// GetRepo returns the Repo field.
+func (b *BranchProtectionConfigurationEvent) GetRepo() *Repository {
+	if b == nil {
+		return nil
+	}
+	return b.Repo
+}
+
+// GetSender returns the Sender field.
+func (b *BranchProtectionConfigurationEvent) GetSender() *User {
+	if b == nil {
+		return nil
+	}
+	return b.Sender
+}
+
 // GetAdminEnforced returns the AdminEnforced field if it's non-nil, zero value otherwise.
 func (b *BranchProtectionRule) GetAdminEnforced() bool {
 	if b == nil || b.AdminEnforced == nil {
@@ -22054,6 +22102,14 @@ func (r *RulesetRepositoryNamesConditionParameters) GetProtected() bool {
 	return *r.Protected
 }
 
+// GetSource returns the Source field if it's non-nil, zero value otherwise.
+func (r *RulesetRepositoryPropertyTargetParameters) GetSource() string {
+	if r == nil || r.Source == nil {
+		return ""
+	}
+	return *r.Source
+}
+
 // GetBusy returns the Busy field if it's non-nil, zero value otherwise.
 func (r *Runner) GetBusy() bool {
 	if r == nil || r.Busy == nil {
@@ -22918,6 +22974,62 @@ func (s *SecretScanningAlertLocationDetails) GetStartline() int {
 	return *s.Startline
 }
 
+// GetAction returns the Action field if it's non-nil, zero value otherwise.
+func (s *SecretScanningAlertLocationEvent) GetAction() string {
+	if s == nil || s.Action == nil {
+		return ""
+	}
+	return *s.Action
+}
+
+// GetAlert returns the Alert field.
+func (s *SecretScanningAlertLocationEvent) GetAlert() *SecretScanningAlert {
+	if s == nil {
+		return nil
+	}
+	return s.Alert
+}
+
+// GetInstallation returns the Installation field.
+func (s *SecretScanningAlertLocationEvent) GetInstallation() *Installation {
+	if s == nil {
+		return nil
+	}
+	return s.Installation
+}
+
+// GetLocation returns the Location field.
+func (s *SecretScanningAlertLocationEvent) GetLocation() *SecretScanningAlertLocation {
+	if s == nil {
+		return nil
+	}
+	return s.Location
+}
+
+// GetOrganization returns the Organization field.
+func (s *SecretScanningAlertLocationEvent) GetOrganization() *Organization {
+	if s == nil {
+		return nil
+	}
+	return s.Organization
+}
+
+// GetRepo returns the Repo field.
+func (s *SecretScanningAlertLocationEvent) GetRepo() *Repository {
+	if s == nil {
+		return nil
+	}
+	return s.Repo
+}
+
+// GetSender returns the Sender field.
+func (s *SecretScanningAlertLocationEvent) GetSender() *User {
+	if s == nil {
+		return nil
+	}
+	return s.Sender
+}
+
 // GetResolution returns the Resolution field if it's non-nil, zero value otherwise.
 func (s *SecretScanningAlertUpdateOptions) GetResolution() string {
 	if s == nil || s.Resolution == nil {
diff --git a/github/messages.go b/github/messages.go
index f365190a..608c557c 100644
--- a/github/messages.go
+++ b/github/messages.go
@@ -46,74 +46,76 @@ const (
 var (
 	// eventTypeMapping maps webhooks types to their corresponding go-github struct types.
 	eventTypeMapping = map[string]interface{}{
-		"branch_protection_rule":         &BranchProtectionRuleEvent{},
-		"check_run":                      &CheckRunEvent{},
-		"check_suite":                    &CheckSuiteEvent{},
-		"code_scanning_alert":            &CodeScanningAlertEvent{},
-		"commit_comment":                 &CommitCommentEvent{},
-		"content_reference":              &ContentReferenceEvent{},
-		"create":                         &CreateEvent{},
-		"delete":                         &DeleteEvent{},
-		"dependabot_alert":               &DependabotAlertEvent{},
-		"deploy_key":                     &DeployKeyEvent{},
-		"deployment":                     &DeploymentEvent{},
-		"deployment_review":              &DeploymentReviewEvent{},
-		"deployment_status":              &DeploymentStatusEvent{},
-		"deployment_protection_rule":     &DeploymentProtectionRuleEvent{},
-		"discussion":                     &DiscussionEvent{},
-		"discussion_comment":             &DiscussionCommentEvent{},
-		"fork":                           &ForkEvent{},
-		"github_app_authorization":       &GitHubAppAuthorizationEvent{},
-		"gollum":                         &GollumEvent{},
-		"installation":                   &InstallationEvent{},
-		"installation_repositories":      &InstallationRepositoriesEvent{},
-		"installation_target":            &InstallationTargetEvent{},
-		"issue_comment":                  &IssueCommentEvent{},
-		"issues":                         &IssuesEvent{},
-		"label":                          &LabelEvent{},
-		"marketplace_purchase":           &MarketplacePurchaseEvent{},
-		"member":                         &MemberEvent{},
-		"membership":                     &MembershipEvent{},
-		"merge_group":                    &MergeGroupEvent{},
-		"meta":                           &MetaEvent{},
-		"milestone":                      &MilestoneEvent{},
-		"organization":                   &OrganizationEvent{},
-		"org_block":                      &OrgBlockEvent{},
-		"package":                        &PackageEvent{},
-		"page_build":                     &PageBuildEvent{},
-		"personal_access_token_request":  &PersonalAccessTokenRequestEvent{},
-		"ping":                           &PingEvent{},
-		"project":                        &ProjectEvent{},
-		"project_card":                   &ProjectCardEvent{},
-		"project_column":                 &ProjectColumnEvent{},
-		"projects_v2":                    &ProjectV2Event{},
-		"projects_v2_item":               &ProjectV2ItemEvent{},
-		"public":                         &PublicEvent{},
-		"pull_request":                   &PullRequestEvent{},
-		"pull_request_review":            &PullRequestReviewEvent{},
-		"pull_request_review_comment":    &PullRequestReviewCommentEvent{},
-		"pull_request_review_thread":     &PullRequestReviewThreadEvent{},
-		"pull_request_target":            &PullRequestTargetEvent{},
-		"push":                           &PushEvent{},
-		"repository":                     &RepositoryEvent{},
-		"repository_dispatch":            &RepositoryDispatchEvent{},
-		"repository_import":              &RepositoryImportEvent{},
-		"repository_ruleset":             &RepositoryRulesetEvent{},
-		"repository_vulnerability_alert": &RepositoryVulnerabilityAlertEvent{},
-		"release":                        &ReleaseEvent{},
-		"secret_scanning_alert":          &SecretScanningAlertEvent{},
-		"security_advisory":              &SecurityAdvisoryEvent{},
-		"security_and_analysis":          &SecurityAndAnalysisEvent{},
-		"sponsorship":                    &SponsorshipEvent{},
-		"star":                           &StarEvent{},
-		"status":                         &StatusEvent{},
-		"team":                           &TeamEvent{},
-		"team_add":                       &TeamAddEvent{},
-		"user":                           &UserEvent{},
-		"watch":                          &WatchEvent{},
-		"workflow_dispatch":              &WorkflowDispatchEvent{},
-		"workflow_job":                   &WorkflowJobEvent{},
-		"workflow_run":                   &WorkflowRunEvent{},
+		"branch_protection_configuration": &BranchProtectionConfigurationEvent{},
+		"branch_protection_rule":          &BranchProtectionRuleEvent{},
+		"check_run":                       &CheckRunEvent{},
+		"check_suite":                     &CheckSuiteEvent{},
+		"code_scanning_alert":             &CodeScanningAlertEvent{},
+		"commit_comment":                  &CommitCommentEvent{},
+		"content_reference":               &ContentReferenceEvent{},
+		"create":                          &CreateEvent{},
+		"delete":                          &DeleteEvent{},
+		"dependabot_alert":                &DependabotAlertEvent{},
+		"deploy_key":                      &DeployKeyEvent{},
+		"deployment":                      &DeploymentEvent{},
+		"deployment_review":               &DeploymentReviewEvent{},
+		"deployment_status":               &DeploymentStatusEvent{},
+		"deployment_protection_rule":      &DeploymentProtectionRuleEvent{},
+		"discussion":                      &DiscussionEvent{},
+		"discussion_comment":              &DiscussionCommentEvent{},
+		"fork":                            &ForkEvent{},
+		"github_app_authorization":        &GitHubAppAuthorizationEvent{},
+		"gollum":                          &GollumEvent{},
+		"installation":                    &InstallationEvent{},
+		"installation_repositories":       &InstallationRepositoriesEvent{},
+		"installation_target":             &InstallationTargetEvent{},
+		"issue_comment":                   &IssueCommentEvent{},
+		"issues":                          &IssuesEvent{},
+		"label":                           &LabelEvent{},
+		"marketplace_purchase":            &MarketplacePurchaseEvent{},
+		"member":                          &MemberEvent{},
+		"membership":                      &MembershipEvent{},
+		"merge_group":                     &MergeGroupEvent{},
+		"meta":                            &MetaEvent{},
+		"milestone":                       &MilestoneEvent{},
+		"organization":                    &OrganizationEvent{},
+		"org_block":                       &OrgBlockEvent{},
+		"package":                         &PackageEvent{},
+		"page_build":                      &PageBuildEvent{},
+		"personal_access_token_request":   &PersonalAccessTokenRequestEvent{},
+		"ping":                            &PingEvent{},
+		"project":                         &ProjectEvent{},
+		"project_card":                    &ProjectCardEvent{},
+		"project_column":                  &ProjectColumnEvent{},
+		"projects_v2":                     &ProjectV2Event{},
+		"projects_v2_item":                &ProjectV2ItemEvent{},
+		"public":                          &PublicEvent{},
+		"pull_request":                    &PullRequestEvent{},
+		"pull_request_review":             &PullRequestReviewEvent{},
+		"pull_request_review_comment":     &PullRequestReviewCommentEvent{},
+		"pull_request_review_thread":      &PullRequestReviewThreadEvent{},
+		"pull_request_target":             &PullRequestTargetEvent{},
+		"push":                            &PushEvent{},
+		"repository":                      &RepositoryEvent{},
+		"repository_dispatch":             &RepositoryDispatchEvent{},
+		"repository_import":               &RepositoryImportEvent{},
+		"repository_ruleset":              &RepositoryRulesetEvent{},
+		"repository_vulnerability_alert":  &RepositoryVulnerabilityAlertEvent{},
+		"release":                         &ReleaseEvent{},
+		"secret_scanning_alert":           &SecretScanningAlertEvent{},
+		"secret_scanning_alert_location":  &SecretScanningAlertLocationEvent{},
+		"security_advisory":               &SecurityAdvisoryEvent{},
+		"security_and_analysis":           &SecurityAndAnalysisEvent{},
+		"sponsorship":                     &SponsorshipEvent{},
+		"star":                            &StarEvent{},
+		"status":                          &StatusEvent{},
+		"team":                            &TeamEvent{},
+		"team_add":                        &TeamAddEvent{},
+		"user":                            &UserEvent{},
+		"watch":                           &WatchEvent{},
+		"workflow_dispatch":               &WorkflowDispatchEvent{},
+		"workflow_job":                    &WorkflowJobEvent{},
+		"workflow_run":                    &WorkflowRunEvent{},
 	}
 	// Forward mapping of event types to the string names of the structs.
 	messageToTypeName = make(map[string]string, len(eventTypeMapping))
diff --git a/github/repos_rules.go b/github/repos_rules.go
index 07e8afad..0d5052a4 100644
--- a/github/repos_rules.go
+++ b/github/repos_rules.go
@@ -52,7 +52,7 @@ type RulesetRepositoryIDsConditionParameters struct {
 type RulesetRepositoryPropertyTargetParameters struct {
 	Name   string   `json:"name"`
 	Values []string `json:"property_values"`
-	Source string   `json:"source"`
+	Source *string  `json:"source,omitempty"`
 }
 
 // RulesetRepositoryPropertyConditionParameters represents the conditions object for repository_property.


Test patch:
diff --git a/github/event_types_test.go b/github/event_types_test.go
index 0c4deab4..3883c9f0 100644
--- a/github/event_types_test.go
+++ b/github/event_types_test.go
@@ -265,6 +265,61 @@ func TestProjectColumnChange_Marshal_NameChange(t *testing.T) {
 	testJSONMarshal(t, u, want)
 }
 
+func TestBranchProtectionConfigurationEvent_Marshal(t *testing.T) {
+	t.Parallel()
+	testJSONMarshal(t, &BranchProtectionConfigurationEvent{}, "{}")
+	u := &BranchProtectionConfigurationEvent{
+		Action: String("enabled"),
+		Repo: &Repository{
+			ID:     Int64(12345),
+			NodeID: String("MDEwOlJlcG9zaXRvcnkxMjM0NQ=="),
+			Name:   String("example-repo"),
+		},
+		Org: &Organization{
+			Login: String("example-org"),
+			ID:    Int64(67890),
+		},
+		Sender: &User{
+			Login: String("example-user"),
+			ID:    Int64(1111),
+		},
+		Installation: &Installation{
+			ID: Int64(2222),
+		},
+		Enterprise: &Enterprise{
+			ID:   Int(3333),
+			Slug: String("example-enterprise"),
+			Name: String("Example Enterprise"),
+		},
+	}
+
+	want := `{
+		"action": "enabled",
+		"repository": {
+			"id": 12345,
+			"node_id": "MDEwOlJlcG9zaXRvcnkxMjM0NQ==",
+			"name": "example-repo"
+		},
+		"organization": {
+			"login": "example-org",
+			"id": 67890
+		},
+		"sender": {
+			"login": "example-user",
+			"id": 1111
+		},
+		"installation": {
+			"id": 2222
+		},
+		"enterprise": {
+			"id": 3333,
+			"slug": "example-enterprise",
+			"name": "Example Enterprise"
+		}
+	}`
+	testJSONMarshal(t, u, want)
+}
+
 func TestTeamAddEvent_Marshal(t *testing.T) {
 	t.Parallel()
 	testJSONMarshal(t, &TeamAddEvent{}, "{}")
@@ -19295,6 +19350,98 @@ func TestSecretScanningAlertEvent_Marshal(t *testing.T) {
 	testJSONMarshal(t, u, want)
 }
 
+func TestSecretScanningAlertLocationEvent_Marshal(t *testing.T) {
+	t.Parallel()
+	testJSONMarshal(t, &SecretScanningAlertLocationEvent{}, "{}")
+	u := &SecretScanningAlertLocationEvent{
+		Action: String("created"),
+		Alert: &SecretScanningAlert{
+			Number:     Int(10),
+			CreatedAt:  &Timestamp{referenceTime},
+			UpdatedAt:  &Timestamp{referenceTime},
+			URL:        String("a"),
+			HTMLURL:    String("a"),
+			SecretType: String("mailchimp_api_key"),
+		},
+		Location: &SecretScanningAlertLocation{
+			Type: String("blob"),
+			Details: &SecretScanningAlertLocationDetails{
+				Path:        String("path/to/file"),
+				Startline:   Int(10),
+				EndLine:     Int(20),
+				StartColumn: Int(1),
+				EndColumn:   Int(2),
+				BlobSHA:     String("d6e4c75c141dbacecc279b721b8bsomeSHA"),
+				BlobURL:     String("a"),
+				CommitSHA:   String("d6e4c75c141dbacecc279b721b8bsomeSHA"),
+				CommitURL:   String("a"),
+			},
+		},
+		Repo: &Repository{
+			ID:     Int64(12345),
+			NodeID: String("MDEwOlJlcG9zaXRvcnkxMjM0NQ=="),
+			Name:   String("example-repo"),
+		},
+		Organization: &Organization{
+			Login: String("example-org"),
+			ID:    Int64(67890),
+		},
+		Sender: &User{
+			Login: String("example-user"),
+			ID:    Int64(1111),
+		},
+		Installation: &Installation{
+			ID: Int64(2222),
+		},
+	}
+
+	want := `{
+		"action": "created",
+		"alert": {
+			"number": 10,
+			"created_at": ` + referenceTimeStr + `,
+			"updated_at": ` + referenceTimeStr + `,
+			"url": "a",
+			"html_url": "a",
+			"secret_type": "mailchimp_api_key"
+		},
+		"location": {
+
+			"type": "blob",
+			"details": {
+				"path": "path/to/file",
+				"start_line": 10,
+				"end_line": 20,
+				"start_column": 1,
+				"end_column": 2,
+				"blob_sha": "d6e4c75c141dbacecc279b721b8bsomeSHA",
+				"blob_url": "a",
+				"commit_sha": "d6e4c75c141dbacecc279b721b8bsomeSHA",
+				"commit_url": "a"
+			}
+		},
+		"repository": {
+
+			"id": 12345,
+			"node_id": "MDEwOlJlcG9zaXRvcnkxMjM0NQ==",
+			"name": "example-repo"
+		},
+		"organization": {
+		"login": "example-org",
+		"id": 67890
+		},
+		"sender": {
+			"login": "example-user",
+			"id": 1111
+		},
+		"installation": {
+			"id": 2222
+		}
+	}`
+
+	testJSONMarshal(t, u, want)
+}
+
 func TestSecurityAdvisoryEvent_Marshal(t *testing.T) {
 	t.Parallel()
 	testJSONMarshal(t, &SecurityAdvisoryEvent{}, "{}")
diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go
index acd3febe..eea6da94 100644
--- a/github/github-accessors_test.go
+++ b/github/github-accessors_test.go
@@ -2163,6 +2163,57 @@ func TestBranchPolicy_GetProtectedBranches(tt *testing.T) {
 	b.GetProtectedBranches()
 }
 
+func TestBranchProtectionConfigurationEvent_GetAction(tt *testing.T) {
+	tt.Parallel()
+	var zeroValue string
+	b := &BranchProtectionConfigurationEvent{Action: &zeroValue}
+	b.GetAction()
+	b = &BranchProtectionConfigurationEvent{}
+	b.GetAction()
+	b = nil
+	b.GetAction()
+}
+
+func TestBranchProtectionConfigurationEvent_GetEnterprise(tt *testing.T) {
+	tt.Parallel()
+	b := &BranchProtectionConfigurationEvent{}
+	b.GetEnterprise()
+	b = nil
+	b.GetEnterprise()
+}
+
+func TestBranchProtectionConfigurationEvent_GetInstallation(tt *testing.T) {
+	tt.Parallel()
+	b := &BranchProtectionConfigurationEvent{}
+	b.GetInstallation()
+	b = nil
+	b.GetInstallation()
+}
+
+func TestBranchProtectionConfigurationEvent_GetOrg(tt *testing.T) {
+	tt.Parallel()
+	b := &BranchProtectionConfigurationEvent{}
+	b.GetOrg()
+	b = nil
+	b.GetOrg()
+}
+
+func TestBranchProtectionConfigurationEvent_GetRepo(tt *testing.T) {
+	tt.Parallel()
+	b := &BranchProtectionConfigurationEvent{}
+	b.GetRepo()
+	b = nil
+	b.GetRepo()
+}
+
+func TestBranchProtectionConfigurationEvent_GetSender(tt *testing.T) {
+	tt.Parallel()
+	b := &BranchProtectionConfigurationEvent{}
+	b.GetSender()
+	b = nil
+	b.GetSender()
+}
+
 func TestBranchProtectionRule_GetAdminEnforced(tt *testing.T) {
 	tt.Parallel()
 	var zeroValue bool
@@ -28247,6 +28298,17 @@ func TestRulesetRepositoryNamesConditionParameters_GetProtected(tt *testing.T) {
 	r.GetProtected()
 }
 
+func TestRulesetRepositoryPropertyTargetParameters_GetSource(tt *testing.T) {
+	tt.Parallel()
+	var zeroValue string
+	r := &RulesetRepositoryPropertyTargetParameters{Source: &zeroValue}
+	r.GetSource()
+	r = &RulesetRepositoryPropertyTargetParameters{}
+	r.GetSource()
+	r = nil
+	r.GetSource()
+}
+
 func TestRunner_GetBusy(tt *testing.T) {
 	tt.Parallel()
 	var zeroValue bool
@@ -29393,6 +29455,65 @@ func TestSecretScanningAlertLocationDetails_GetStartline(tt *testing.T) {
 	s.GetStartline()
 }
 
+func TestSecretScanningAlertLocationEvent_GetAction(tt *testing.T) {
+	tt.Parallel()
+	var zeroValue string
+	s := &SecretScanningAlertLocationEvent{Action: &zeroValue}
+	s.GetAction()
+	s = &SecretScanningAlertLocationEvent{}
+	s.GetAction()
+	s = nil
+	s.GetAction()
+}
+
+func TestSecretScanningAlertLocationEvent_GetAlert(tt *testing.T) {
+	tt.Parallel()
+	s := &SecretScanningAlertLocationEvent{}
+	s.GetAlert()
+	s = nil
+	s.GetAlert()
+}
+
+func TestSecretScanningAlertLocationEvent_GetInstallation(tt *testing.T) {
+	tt.Parallel()
+	s := &SecretScanningAlertLocationEvent{}
+	s.GetInstallation()
+	s = nil
+	s.GetInstallation()
+}
+
+func TestSecretScanningAlertLocationEvent_GetLocation(tt *testing.T) {
+	tt.Parallel()
+	s := &SecretScanningAlertLocationEvent{}
+	s.GetLocation()
+	s = nil
+	s.GetLocation()
+}
+
+func TestSecretScanningAlertLocationEvent_GetOrganization(tt *testing.T) {
+	tt.Parallel()
+	s := &SecretScanningAlertLocationEvent{}
+	s.GetOrganization()
+	s = nil
+	s.GetOrganization()
+}
+
+func TestSecretScanningAlertLocationEvent_GetRepo(tt *testing.T) {
+	tt.Parallel()
+	s := &SecretScanningAlertLocationEvent{}
+	s.GetRepo()
+	s = nil
+	s.GetRepo()
+}
+
+func TestSecretScanningAlertLocationEvent_GetSender(tt *testing.T) {
+	tt.Parallel()
+	s := &SecretScanningAlertLocationEvent{}
+	s.GetSender()
+	s = nil
+	s.GetSender()
+}
+
 func TestSecretScanningAlertUpdateOptions_GetResolution(tt *testing.T) {
 	tt.Parallel()
 	var zeroValue string
diff --git a/github/messages_test.go b/github/messages_test.go
index e04c0b18..be325d50 100644
--- a/github/messages_test.go
+++ b/github/messages_test.go
@@ -264,6 +264,10 @@ func TestParseWebHook(t *testing.T) {
 		payload     interface{}
 		messageType string
 	}{
+		{
+			payload:     &BranchProtectionConfigurationEvent{},
+			messageType: "branch_protection_configuration",
+		},
 		{
 			payload:     &BranchProtectionRuleEvent{},
 			messageType: "branch_protection_rule",
@@ -480,6 +484,10 @@ func TestParseWebHook(t *testing.T) {
 			payload:     &SecretScanningAlertEvent{},
 			messageType: "secret_scanning_alert",
 		},
+		{
+			payload:     &SecretScanningAlertLocationEvent{},
+			messageType: "secret_scanning_alert_location",
+		},
 		{
 			payload:     &SecurityAdvisoryEvent{},
 			messageType: "security_advisory",
diff --git a/github/orgs_codesecurity_configurations_test.go b/github/orgs_codesecurity_configurations_test.go
index d59b3705..e72f9fb9 100644
--- a/github/orgs_codesecurity_configurations_test.go
+++ b/github/orgs_codesecurity_configurations_test.go
@@ -382,7 +382,6 @@ func TestOrganizationsService_SetDefaultCodeSecurityConfiguration(t *testing.T)
 					"code_scanning_default_setup": "enabled"
 				}
 		}`)
-		w.WriteHeader(http.StatusOK)
 	})
 	got, resp, err := client.Organizations.SetDefaultCodeSecurityConfiguration(ctx, "o", 1, "all")
 	if err != nil {
@@ -478,7 +477,6 @@ func TestOrganizationsService_GetCodeSecurityConfigurationForRepository(t *testi
 				"code_scanning_default_setup": "enabled"
 			}
 		}`)
-		w.WriteHeader(http.StatusOK)
 	})
 
 	rc, _, err := client.Organizations.GetCodeSecurityConfigurationForRepository(ctx, "o", "repo8")
diff --git a/github/orgs_rules_test.go b/github/orgs_rules_test.go
index ac391dae..ca6e3f84 100644
--- a/github/orgs_rules_test.go
+++ b/github/orgs_rules_test.go
@@ -454,7 +454,6 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing.
 				"exclude": [
 					{
 						"name": "testExcludeProp",
-						"source": "custom",
 						"property_values": [
 							"false"
 						]
@@ -590,14 +589,13 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing.
 				Include: []RulesetRepositoryPropertyTargetParameters{
 					{
 						Name:   "testIncludeProp",
-						Source: "custom",
+						Source: String("custom"),
 						Values: []string{"true"},
 					},
 				},
 				Exclude: []RulesetRepositoryPropertyTargetParameters{
 					{
 						Name:   "testExcludeProp",
-						Source: "custom",
 						Values: []string{"false"},
 					},
 				},
@@ -692,14 +690,13 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing.
 				Include: []RulesetRepositoryPropertyTargetParameters{
 					{
 						Name:   "testIncludeProp",
-						Source: "custom",
+						Source: String("custom"),
 						Values: []string{"true"},
 					},
 				},
 				Exclude: []RulesetRepositoryPropertyTargetParameters{
 					{
 						Name:   "testExcludeProp",
-						Source: "custom",
 						Values: []string{"false"},
 					},
 				},
@@ -1287,7 +1284,7 @@ func TestOrganizationsService_GetOrganizationRulesetWithRepoPropCondition(t *tes
 				Include: []RulesetRepositoryPropertyTargetParameters{
 					{
 						Name:   "testIncludeProp",
-						Source: "custom",
+						Source: String("custom"),
 						Values: []string{"true"},
 					},
 				},
@@ -1480,7 +1477,7 @@ func TestOrganizationsService_UpdateOrganizationRulesetWithRepoProp(t *testing.T
 				Include: []RulesetRepositoryPropertyTargetParameters{
 					{
 						Name:   "testIncludeProp",
-						Source: "custom",
+						Source: String("custom"),
 						Values: []string{"true"},
 					},
 				},
@@ -1512,7 +1509,7 @@ func TestOrganizationsService_UpdateOrganizationRulesetWithRepoProp(t *testing.T
 				Include: []RulesetRepositoryPropertyTargetParameters{
 					{
 						Name:   "testIncludeProp",
-						Source: "custom",
+						Source: String("custom"),
 						Values: []string{"true"},
 					},
 				},