Repository: google/go-github
Pull request #2742 (2023-04-07 23:59:06)

Add Topics to PushEventRepository
Closes https://github.com/google/go-github/issues/2741

Adding the `Topics` field, which is included in push event payloads under `repository`

codecov[bot]: ## [Codecov](https://codecov.io/gh/google/go-github/pull/2742?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) Report
> Merging [#2742](https://codecov.io/gh/google/go-github/pull/2742?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) (733c09b) into [master](https://codecov.io/gh/google/go-github/commit/c96ba417f7b022bee92bc04d831e89fd9fc70edc?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) (c96ba41) will **not change** coverage.
> The diff coverage is `n/a`.

> :exclamation: Current head 733c09b differs from pull request most recent head b8dfc96. Consider uploading reports for the commit b8dfc96 to get more accurate results

```diff
@@           Coverage Diff           @@
##           master    #2742   +/-   ##
=======================================
  Coverage   98.05%   98.05%           
=======================================
  Files         132      132           
  Lines       11611    11611           
=======================================
  Hits        11385    11385           
  Misses        154      154           
  Partials       72       72           
```


| [Impacted Files](https://codecov.io/gh/google/go-github/pull/2742?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) | Coverage Δ | |
|---|---|---|
| [github/event\_types.go](https://codecov.io/gh/google/go-github/pull/2742?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google#diff-Z2l0aHViL2V2ZW50X3R5cGVzLmdv) | `100.00% <ø> (ø)` | |

Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google)


Patch:
diff --git a/github/event_types.go b/github/event_types.go
index 598d98d4..71dfd2d0 100644
--- a/github/event_types.go
+++ b/github/event_types.go
@@ -1062,6 +1062,7 @@ type PushEventRepository struct {
 	SSHURL          *string    `json:"ssh_url,omitempty"`
 	CloneURL        *string    `json:"clone_url,omitempty"`
 	SVNURL          *string    `json:"svn_url,omitempty"`
+	Topics          []string   `json:"topics,omitempty"`
 }
 
 // PushEventRepoOwner is a basic representation of user/org in a PushEvent payload.


Test patch:
diff --git a/github/event_types_test.go b/github/event_types_test.go
index 7c84146f..a2628b85 100644
--- a/github/event_types_test.go
+++ b/github/event_types_test.go
@@ -12271,6 +12271,7 @@ func TestPushEventRepository_Marshal(t *testing.T) {
 		SSHURL:          String("s"),
 		CloneURL:        String("c"),
 		SVNURL:          String("s"),
+		Topics:          []string{"octocat", "api"},
 	}
 
 	want := `{
@@ -12325,8 +12326,9 @@ func TestPushEventRepository_Marshal(t *testing.T) {
 		"git_url": "g",
 		"ssh_url": "s",
 		"clone_url": "c",
-		"svn_url": "s"
-	}`
+		"svn_url": "s",
+		"topics": ["octocat","api"]
+    }`
 
 	testJSONMarshal(t, u, want)
 }