Skip to content

Commit 80133c2

Browse files
fixed gollum payload
1 parent deeac91 commit 80133c2

File tree

2 files changed

+9
-96
lines changed

2 files changed

+9
-96
lines changed

github/payload.go

Lines changed: 3 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -710,96 +710,8 @@ type GollumPayload struct {
710710
Sha string `json:"sha"`
711711
HTMLURL string `json:"html_url"`
712712
} `json:"pages"`
713-
Repository struct {
714-
ID int64 `json:"id"`
715-
NodeID string `json:"node_id"`
716-
Name string `json:"name"`
717-
FullName string `json:"full_name"`
718-
Owner struct {
719-
Login string `json:"login"`
720-
ID int64 `json:"id"`
721-
NodeID string `json:"node_id"`
722-
AvatarURL string `json:"avatar_url"`
723-
GravatarID string `json:"gravatar_id"`
724-
URL string `json:"url"`
725-
HTMLURL string `json:"html_url"`
726-
FollowersURL string `json:"followers_url"`
727-
FollowingURL string `json:"following_url"`
728-
GistsURL string `json:"gists_url"`
729-
StarredURL string `json:"starred_url"`
730-
SubscriptionsURL string `json:"subscriptions_url"`
731-
OrganizationsURL string `json:"organizations_url"`
732-
ReposURL string `json:"repos_url"`
733-
EventsURL string `json:"events_url"`
734-
ReceivedEventsURL string `json:"received_events_url"`
735-
Type string `json:"type"`
736-
SiteAdmin bool `json:"site_admin"`
737-
} `json:"owner"`
738-
Private bool `json:"private"`
739-
HTMLURL string `json:"html_url"`
740-
Description string `json:"description"`
741-
Fork bool `json:"fork"`
742-
URL string `json:"url"`
743-
ForksURL string `json:"forks_url"`
744-
KeysURL string `json:"keys_url"`
745-
CollaboratorsURL string `json:"collaborators_url"`
746-
TeamsURL string `json:"teams_url"`
747-
HooksURL string `json:"hooks_url"`
748-
IssueEventsURL string `json:"issue_events_url"`
749-
EventsURL string `json:"events_url"`
750-
AssigneesURL string `json:"assignees_url"`
751-
BranchesURL string `json:"branches_url"`
752-
TagsURL string `json:"tags_url"`
753-
BlobsURL string `json:"blobs_url"`
754-
GitTagsURL string `json:"git_tags_url"`
755-
GitRefsURL string `json:"git_refs_url"`
756-
TreesURL string `json:"trees_url"`
757-
StatusesURL string `json:"statuses_url"`
758-
LanguagesURL string `json:"languages_url"`
759-
StargazersURL string `json:"stargazers_url"`
760-
ContributorsURL string `json:"contributors_url"`
761-
SubscribersURL string `json:"subscribers_url"`
762-
SubscriptionURL string `json:"subscription_url"`
763-
CommitsURL string `json:"commits_url"`
764-
GitCommitsURL string `json:"git_commits_url"`
765-
CommentsURL string `json:"comments_url"`
766-
IssueCommentURL string `json:"issue_comment_url"`
767-
ContentsURL string `json:"contents_url"`
768-
CompareURL string `json:"compare_url"`
769-
MergesURL string `json:"merges_url"`
770-
ArchiveURL string `json:"archive_url"`
771-
DownloadsURL string `json:"downloads_url"`
772-
IssuesURL string `json:"issues_url"`
773-
PullsURL string `json:"pulls_url"`
774-
MilestonesURL string `json:"milestones_url"`
775-
NotificationsURL string `json:"notifications_url"`
776-
LabelsURL string `json:"labels_url"`
777-
ReleasesURL string `json:"releases_url"`
778-
CreatedAt time.Time `json:"created_at"`
779-
UpdatedAt time.Time `json:"updated_at"`
780-
PushedAt time.Time `json:"pushed_at"`
781-
GitURL string `json:"git_url"`
782-
SSHURL string `json:"ssh_url"`
783-
CloneURL string `json:"clone_url"`
784-
SvnURL string `json:"svn_url"`
785-
Homepage *string `json:"homepage"`
786-
Size int64 `json:"size"`
787-
StargazersCount int64 `json:"stargazers_count"`
788-
WatchersCount int64 `json:"watchers_count"`
789-
Language *string `json:"language"`
790-
HasIssues bool `json:"has_issues"`
791-
HasDownloads bool `json:"has_downloads"`
792-
HasWiki bool `json:"has_wiki"`
793-
HasPages bool `json:"has_pages"`
794-
ForksCount int64 `json:"forks_count"`
795-
MirrorURL *string `json:"mirror_url"`
796-
OpenIssuesCount int64 `json:"open_issues_count"`
797-
Forks int64 `json:"forks"`
798-
OpenIssues int64 `json:"open_issues"`
799-
Watchers int64 `json:"watchers"`
800-
DefaultBranch string `json:"default_branch"`
801-
} `json:"repository"`
802-
Sender struct {
713+
Repository Repository `json:"repository"`
714+
Sender struct {
803715
Login string `json:"login"`
804716
ID int64 `json:"id"`
805717
NodeID string `json:"node_id"`
@@ -819,6 +731,7 @@ type GollumPayload struct {
819731
Type string `json:"type"`
820732
SiteAdmin bool `json:"site_admin"`
821733
} `json:"sender"`
734+
Installation Installation `json:"installation"`
822735
}
823736

824737
// InstallationPayload contains the information for GitHub's installation and integration_installation hook events

github/payload_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ func TestPayloads(t *testing.T) {
6969
filename: "fork.json",
7070
typ: &ForkPayload{},
7171
},
72-
// {
73-
// name: "GollumPayload",
74-
// filename: "gollum.json",
75-
// typ: &GollumPayload{},
76-
// },
72+
{
73+
name: "GollumPayload",
74+
filename: "gollum.json",
75+
typ: &GollumPayload{},
76+
},
7777
// {
7878
// name: "InstallationRepositoriesPayload",
7979
// filename: "installation-repositories.json",
@@ -245,7 +245,7 @@ func TestSingle(t *testing.T) {
245245
},
246246
}
247247
}
248-
tests := createTest("gollum.json", &GollumPayload{}, &GollumPayload{})
248+
tests := createTest("installation.json", &InstallationPayload{}, &InstallationPayload{})
249249
for _, tt := range tests {
250250
tc := tt
251251
t.Run(tt.name, func(t *testing.T) {

0 commit comments

Comments
 (0)