diff options
author | Unknwon <u@gogs.io> | 2017-03-09 00:03:29 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-03-09 00:03:29 -0500 |
commit | c93731339f3da01bb1158acc7acf781f0dfe2468 (patch) | |
tree | 7c1d161ab780949e5b84313c85788cc1aa2ac9d4 /vendor/github.com/gogits | |
parent | bab448681d613e3982c46c7bd9ed54319638a3dd (diff) |
webhook: support Issues event (#2319)
Also addresses #3485.
Diffstat (limited to 'vendor/github.com/gogits')
-rw-r--r-- | vendor/github.com/gogits/go-gogs-client/gogs.go | 2 | ||||
-rw-r--r-- | vendor/github.com/gogits/go-gogs-client/repo_hook.go | 17 | ||||
-rw-r--r-- | vendor/github.com/gogits/go-gogs-client/user.go | 3 |
3 files changed, 19 insertions, 3 deletions
diff --git a/vendor/github.com/gogits/go-gogs-client/gogs.go b/vendor/github.com/gogits/go-gogs-client/gogs.go index 98421cb7..c34d87f5 100644 --- a/vendor/github.com/gogits/go-gogs-client/gogs.go +++ b/vendor/github.com/gogits/go-gogs-client/gogs.go @@ -14,7 +14,7 @@ import ( ) func Version() string { - return "0.12.7" + return "0.12.8" } // Client represents a Gogs API client. diff --git a/vendor/github.com/gogits/go-gogs-client/repo_hook.go b/vendor/github.com/gogits/go-gogs-client/repo_hook.go index aa251229..ca142e23 100644 --- a/vendor/github.com/gogits/go-gogs-client/repo_hook.go +++ b/vendor/github.com/gogits/go-gogs-client/repo_hook.go @@ -239,6 +239,8 @@ const ( HOOK_ISSUE_UNASSIGNED HookIssueAction = "unassigned" HOOK_ISSUE_LABEL_UPDATED HookIssueAction = "label_updated" HOOK_ISSUE_LABEL_CLEARED HookIssueAction = "label_cleared" + HOOK_ISSUE_MILESTONED HookIssueAction = "milestoned" + HOOK_ISSUE_DEMILESTONED HookIssueAction = "demilestoned" HOOK_ISSUE_SYNCHRONIZED HookIssueAction = "synchronized" ) @@ -251,6 +253,19 @@ type ChangesPayload struct { Body *ChangesFromPayload `json:"body,omitempty"` } +type IssuesPayload struct { + Action HookIssueAction `json:"action"` + Index int64 `json:"number"` + Issue *Issue `json:"issue"` + Changes *ChangesPayload `json:"changes,omitempty"` + Repository *Repository `json:"repository"` + Sender *User `json:"sender"` +} + +func (p *IssuesPayload) JSONPayload() ([]byte, error) { + return json.MarshalIndent(p, "", " ") +} + // __________ .__ .__ __________ __ // \______ \__ __| | | | \______ \ ____ ________ __ ____ _______/ |_ // | ___/ | \ | | | | _// __ \/ ____/ | \_/ __ \ / ___/\ __\ @@ -262,8 +277,8 @@ type ChangesPayload struct { type PullRequestPayload struct { Action HookIssueAction `json:"action"` Index int64 `json:"number"` - Changes *ChangesPayload `json:"changes,omitempty"` PullRequest *PullRequest `json:"pull_request"` + Changes *ChangesPayload `json:"changes,omitempty"` Repository *Repository `json:"repository"` Sender *User `json:"sender"` } diff --git a/vendor/github.com/gogits/go-gogs-client/user.go b/vendor/github.com/gogits/go-gogs-client/user.go index b385b041..3879b1a6 100644 --- a/vendor/github.com/gogits/go-gogs-client/user.go +++ b/vendor/github.com/gogits/go-gogs-client/user.go @@ -18,12 +18,13 @@ type User struct { AvatarUrl string `json:"avatar_url"` } -// MarshalJSON implements the json.Marshaler interface for User, adding field(s) for backward compatibility +// MarshalJSON implements the json.Marshaler interface for User func (u User) MarshalJSON() ([]byte, error) { // Re-declaring User to avoid recursion type shadow User return json.Marshal(struct { shadow + // LEGACY [Gogs 1.0]: remove field(s) for backward compatibility CompatUserName string `json:"username"` }{shadow(u), u.UserName}) } |