Skip to content

Commit c7a9ad7

Browse files
caseyduquettescgmlewis
authored andcommitted
Change PushEvent.Pusher type to CommitAuthor (google#2999)
Fixes: google#2998.
1 parent b0181bb commit c7a9ad7

File tree

5 files changed

+15
-23
lines changed

5 files changed

+15
-23
lines changed

github/event_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,7 @@ type PushEvent struct {
12821282
Compare *string `json:"compare,omitempty"`
12831283
Repo *PushEventRepository `json:"repository,omitempty"`
12841284
HeadCommit *HeadCommit `json:"head_commit,omitempty"`
1285-
Pusher *User `json:"pusher,omitempty"`
1285+
Pusher *CommitAuthor `json:"pusher,omitempty"`
12861286
Sender *User `json:"sender,omitempty"`
12871287
Installation *Installation `json:"installation,omitempty"`
12881288

github/event_types_test.go

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3777,14 +3777,11 @@ func TestPushEvent_Marshal(t *testing.T) {
37773777
Compare: String("a"),
37783778
Repo: &PushEventRepository{ID: Int64(1)},
37793779
HeadCommit: &HeadCommit{ID: String("id")},
3780-
Pusher: &User{
3781-
Login: String("l"),
3782-
ID: Int64(1),
3783-
NodeID: String("n"),
3784-
URL: String("u"),
3785-
ReposURL: String("r"),
3786-
EventsURL: String("e"),
3787-
AvatarURL: String("a"),
3780+
Pusher: &CommitAuthor{
3781+
Login: String("l"),
3782+
Date: &Timestamp{referenceTime},
3783+
Name: String("n"),
3784+
Email: String("e"),
37883785
},
37893786
Sender: &User{
37903787
Login: String("l"),
@@ -3937,13 +3934,10 @@ func TestPushEvent_Marshal(t *testing.T) {
39373934
"id": "id"
39383935
},
39393936
"pusher": {
3940-
"login": "l",
3941-
"id": 1,
3942-
"node_id": "n",
3943-
"avatar_url": "a",
3944-
"url": "u",
3945-
"events_url": "e",
3946-
"repos_url": "r"
3937+
"date": ` + referenceTimeStr + `,
3938+
"name": "n",
3939+
"email": "e",
3940+
"username": "l"
39473941
},
39483942
"sender": {
39493943
"login": "l",

github/github-accessors.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/github-stringify_test.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/repos_hooks_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,8 @@ func TestBranchWebHookPayload_Marshal(t *testing.T) {
357357
Organization: &Organization{
358358
ID: Int64(22),
359359
},
360-
Pusher: &User{
360+
Pusher: &CommitAuthor{
361361
Login: String("rd@yahoo.com"),
362-
ID: Int64(112),
363362
},
364363
Repo: &PushEventRepository{
365364
ID: Int64(321),
@@ -421,8 +420,7 @@ func TestBranchWebHookPayload_Marshal(t *testing.T) {
421420
"id" : 22
422421
},
423422
"pusher":{
424-
"login": "rd@yahoo.com",
425-
"id": 112
423+
"username": "rd@yahoo.com"
426424
},
427425
"repository":{
428426
"id": 321,

0 commit comments

Comments
 (0)