From 733c09b36d0c2c9b0b262b6bf7c5d025aff50455 Mon Sep 17 00:00:00 2001 From: ecrupper Date: Fri, 7 Apr 2023 18:57:39 -0500 Subject: [PATCH 1/3] adding topics to push event repo struct --- github/event_types.go | 1 + github/event_types_test.go | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/github/event_types.go b/github/event_types.go index 598d98d48c3..71dfd2d0a02 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. diff --git a/github/event_types_test.go b/github/event_types_test.go index 7c84146f460..4c4831c88d2 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,7 +12326,11 @@ 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) From b8dfc966901bd37312965de21e0991def910147a Mon Sep 17 00:00:00 2001 From: ecrupper Date: Fri, 7 Apr 2023 19:01:32 -0500 Subject: [PATCH 2/3] fix awkward formatting in test payload --- github/event_types_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/github/event_types_test.go b/github/event_types_test.go index 4c4831c88d2..11b2b4c06cc 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -12328,10 +12328,10 @@ func TestPushEventRepository_Marshal(t *testing.T) { "clone_url": "c", "svn_url": "s", "topics": [ - "octocat", - "api" - ] - }` + "octocat", + "api" + ] + }` testJSONMarshal(t, u, want) } From 2892768236be323a42834043335f0ac6f2f052fd Mon Sep 17 00:00:00 2001 From: ecrupper Date: Fri, 7 Apr 2023 19:04:36 -0500 Subject: [PATCH 3/3] another go at the formatting.... --- github/event_types_test.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/github/event_types_test.go b/github/event_types_test.go index 11b2b4c06cc..a2628b85378 100644 --- a/github/event_types_test.go +++ b/github/event_types_test.go @@ -12327,10 +12327,7 @@ func TestPushEventRepository_Marshal(t *testing.T) { "ssh_url": "s", "clone_url": "c", "svn_url": "s", - "topics": [ - "octocat", - "api" - ] + "topics": ["octocat","api"] }` testJSONMarshal(t, u, want)