mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-23 00:46:30 +00:00
add missing Email from Hook Event in gitea. (#2080)
* add missing Email from Hook Event in gitea. Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * fix field. Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * fix avatar path Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * fix testing Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
eed03a5803
commit
b833b16f32
4 changed files with 7 additions and 1 deletions
|
@ -39,11 +39,13 @@ const HookPush = `
|
|||
"pusher": {
|
||||
"name": "gordon",
|
||||
"email": "gordon@golang.org",
|
||||
"username": "gordon"
|
||||
"username": "gordon",
|
||||
"login": "gordon"
|
||||
},
|
||||
"sender": {
|
||||
"login": "gordon",
|
||||
"id": 1,
|
||||
"username": "gordon",
|
||||
"avatar_url": "http://gitea.golang.org///1.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -88,6 +88,7 @@ func buildFromPush(hook *pushHook) *model.Build {
|
|||
Message: hook.Commits[0].Message,
|
||||
Avatar: avatar,
|
||||
Author: author,
|
||||
Email: hook.Pusher.Email,
|
||||
Timestamp: time.Now().UTC().Unix(),
|
||||
Sender: sender,
|
||||
}
|
||||
|
|
|
@ -33,7 +33,9 @@ func Test_parse(t *testing.T) {
|
|||
g.Assert(hook.Pusher.Name).Equal("gordon")
|
||||
g.Assert(hook.Pusher.Email).Equal("gordon@golang.org")
|
||||
g.Assert(hook.Pusher.Username).Equal("gordon")
|
||||
g.Assert(hook.Pusher.Login).Equal("gordon")
|
||||
g.Assert(hook.Sender.Login).Equal("gordon")
|
||||
g.Assert(hook.Sender.Username).Equal("gordon")
|
||||
g.Assert(hook.Sender.Avatar).Equal("http://gitea.golang.org///1.gravatar.com/avatar/8c58a0be77ee441bb8f8595b7f1b4e87")
|
||||
})
|
||||
|
||||
|
|
|
@ -88,6 +88,7 @@ func buildFromPush(hook *pushHook) *model.Build {
|
|||
Message: hook.Commits[0].Message,
|
||||
Avatar: avatar,
|
||||
Author: author,
|
||||
Email: hook.Pusher.Email,
|
||||
Timestamp: time.Now().UTC().Unix(),
|
||||
Sender: sender,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue