Use correct user on releases (#17818)

- Backport #17806
release/v1.15
Gusted 2021-11-26 07:06:26 +00:00 committed by GitHub
parent 3a222ee416
commit 04517e17d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -766,12 +766,12 @@ func sendReleaseHook(doer *models.User, rel *models.Release, action api.HookRele
return return
} }
mode, _ := models.AccessLevel(rel.Publisher, rel.Repo) mode, _ := models.AccessLevel(doer, rel.Repo)
if err := webhook_services.PrepareWebhooks(rel.Repo, models.HookEventRelease, &api.ReleasePayload{ if err := webhook_services.PrepareWebhooks(rel.Repo, models.HookEventRelease, &api.ReleasePayload{
Action: action, Action: action,
Release: convert.ToRelease(rel), Release: convert.ToRelease(rel),
Repository: convert.ToRepo(rel.Repo, mode), Repository: convert.ToRepo(rel.Repo, mode),
Sender: convert.ToUser(rel.Publisher, nil), Sender: convert.ToUser(doer, nil),
}); err != nil { }); err != nil {
log.Error("PrepareWebhooks: %v", err) log.Error("PrepareWebhooks: %v", err)
} }