From 04517e17d6c87f9c99a3fbc0b3cd782e311b5014 Mon Sep 17 00:00:00 2001 From: Gusted Date: Fri, 26 Nov 2021 07:06:26 +0000 Subject: [PATCH] Use correct user on releases (#17818) - Backport #17806 --- modules/notification/webhook/webhook.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/notification/webhook/webhook.go b/modules/notification/webhook/webhook.go index 55169be3b5..465455da15 100644 --- a/modules/notification/webhook/webhook.go +++ b/modules/notification/webhook/webhook.go @@ -766,12 +766,12 @@ func sendReleaseHook(doer *models.User, rel *models.Release, action api.HookRele 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{ 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) }