pass through the true webhook action when parsing

This commit is contained in:
Lucian Jones 2019-06-25 14:49:54 +12:00
parent 93e052a713
commit e51ef216f3

View file

@ -246,7 +246,7 @@ func (p *parser) Parse(req *http.Request, secretFunc func(string) string) (*core
hook = &core.Hook{
Trigger: core.TriggerHook, // core.TriggerHook,
Event: core.EventPullRequest,
Action: core.ActionCreate,
Action: v.Action.String(),
Link: v.PullRequest.Link,
Timestamp: v.PullRequest.Created.Unix(),
Title: v.PullRequest.Title,
@ -262,9 +262,6 @@ func (p *parser) Parse(req *http.Request, secretFunc func(string) string) (*core
AuthorAvatar: v.PullRequest.Author.Avatar,
Sender: v.Sender.Login,
}
if v.Action != scm.ActionSync {
hook.Action = core.ActionSync
}
// HACK this is a workaround for github. The pull
// request title is populated, but not the message.
if hook.Message == "" {