Merge pull request #2315 from favadi/gitea-pull-sender

uses email from Sender field of push event
This commit is contained in:
Brad Rydzewski 2018-02-19 12:25:34 -08:00 committed by GitHub
commit 9a76ab5bbb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 2 deletions

View file

@ -46,6 +46,7 @@ const HookPush = `
"login": "gordon",
"id": 1,
"username": "gordon",
"email": "gordon@golang.org",
"avatar_url": "http://gitea.golang.org///1.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87"
}
}

View file

@ -77,7 +77,7 @@ func buildFromPush(hook *pushHook) *model.Build {
Message: hook.Commits[0].Message,
Avatar: avatar,
Author: author,
Email: hook.Pusher.Email,
Email: hook.Sender.Email,
Timestamp: time.Now().UTC().Unix(),
Sender: sender,
}

View file

@ -38,6 +38,7 @@ type pushHook struct {
ID int64 `json:"id"`
Login string `json:"login"`
Username string `json:"username"`
Email string `json:"email"`
Avatar string `json:"avatar_url"`
} `json:"sender"`
}

View file

@ -44,6 +44,7 @@ var HookPush = `
"sender": {
"login": "gordon",
"id": 1,
"email": "gordon@golang.org",
"avatar_url": "http://gogs.golang.org///1.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87"
}
}

View file

@ -77,7 +77,7 @@ func buildFromPush(hook *pushHook) *model.Build {
Message: hook.Commits[0].Message,
Avatar: avatar,
Author: author,
Email: hook.Pusher.Email,
Email: hook.Sender.Email,
Timestamp: time.Now().UTC().Unix(),
Sender: sender,
}

View file

@ -37,6 +37,7 @@ type pushHook struct {
ID int64 `json:"id"`
Login string `json:"login"`
Username string `json:"username"`
Email string `json:"email"`
Avatar string `json:"avatar_url"`
} `json:"sender"`
}