]> source.dussan.org Git - gitea.git/commitdiff
Use correct user on releases (#17818)
authorGusted <williamzijl7@hotmail.com>
Fri, 26 Nov 2021 07:06:26 +0000 (07:06 +0000)
committerGitHub <noreply@github.com>
Fri, 26 Nov 2021 07:06:26 +0000 (07:06 +0000)
- Backport #17806

modules/notification/webhook/webhook.go

index 55169be3b573435d2b9f9dc94acad7e281b157c9..465455da15655ebe51f8106178b96e9e15b17dff 100644 (file)
@@ -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)
        }