mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-20 20:07:03 +01:00
Use correct user on releases (#17806)
- Use the provided `doer` instead of `rel.Publisher`. The code will also run on edited releases and deleted ones, which isn't necessary done by `rel.Publisher`. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
parent
4f99697888
commit
4b4997c73e
1 changed files with 2 additions and 2 deletions
|
@ -769,12 +769,12 @@ func sendReleaseHook(doer *user_model.User, rel *models.Release, action api.Hook
|
|||
return
|
||||
}
|
||||
|
||||
mode, _ := models.AccessLevel(rel.Publisher, rel.Repo)
|
||||
mode, _ := models.AccessLevel(doer, rel.Repo)
|
||||
if err := webhook_services.PrepareWebhooks(rel.Repo, webhook.HookEventRelease, &api.ReleasePayload{
|
||||
Action: action,
|
||||
Release: convert.ToRelease(rel),
|
||||
Repository: convert.ToRepo(rel.Repo, mode),
|
||||
Sender: convert.ToUser(rel.Publisher, nil),
|
||||
Sender: convert.ToUser(doer, nil),
|
||||
}); err != nil {
|
||||
log.Error("PrepareWebhooks: %v", err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue