mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-27 10:50:33 +00:00
uses email from Sender field of push event
Gitea/Gogs [set repository owner](d644e88107/models/pull.go (L469)
) information as Pusher in webhook.
For example, if we have a repository: git.example.com/org1/repo1, owner
of repository will be `org1` and the email field will be empty. This PR
changes gitea/gogs helpers to use the email in Sender field, which is
the user that click the merge button.
This commit is contained in:
parent
5722ce410a
commit
e3a5376d01
6 changed files with 6 additions and 2 deletions
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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"`
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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"`
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue