mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-26 01:40:36 +00:00
fix wrong sender when send slack webhook (#7918)
This commit is contained in:
parent
8c10d91086
commit
9b9d162194
1 changed files with 4 additions and 4 deletions
|
@ -409,7 +409,7 @@ func UpdateRelease(doer *User, gitRepo *git.Repository, rel *Release, attachment
|
||||||
Action: api.HookReleaseUpdated,
|
Action: api.HookReleaseUpdated,
|
||||||
Release: rel.APIFormat(),
|
Release: rel.APIFormat(),
|
||||||
Repository: rel.Repo.APIFormat(mode),
|
Repository: rel.Repo.APIFormat(mode),
|
||||||
Sender: rel.Publisher.APIFormat(),
|
Sender: doer.APIFormat(),
|
||||||
}); err1 != nil {
|
}); err1 != nil {
|
||||||
log.Error("PrepareWebhooks: %v", err)
|
log.Error("PrepareWebhooks: %v", err)
|
||||||
} else {
|
} else {
|
||||||
|
@ -420,7 +420,7 @@ func UpdateRelease(doer *User, gitRepo *git.Repository, rel *Release, attachment
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteReleaseByID deletes a release and corresponding Git tag by given ID.
|
// DeleteReleaseByID deletes a release and corresponding Git tag by given ID.
|
||||||
func DeleteReleaseByID(id int64, u *User, delTag bool) error {
|
func DeleteReleaseByID(id int64, doer *User, delTag bool) error {
|
||||||
rel, err := GetReleaseByID(id)
|
rel, err := GetReleaseByID(id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("GetReleaseByID: %v", err)
|
return fmt.Errorf("GetReleaseByID: %v", err)
|
||||||
|
@ -459,12 +459,12 @@ func DeleteReleaseByID(id int64, u *User, delTag bool) error {
|
||||||
return fmt.Errorf("LoadAttributes: %v", err)
|
return fmt.Errorf("LoadAttributes: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
mode, _ := AccessLevel(u, rel.Repo)
|
mode, _ := AccessLevel(doer, rel.Repo)
|
||||||
if err := PrepareWebhooks(rel.Repo, HookEventRelease, &api.ReleasePayload{
|
if err := PrepareWebhooks(rel.Repo, HookEventRelease, &api.ReleasePayload{
|
||||||
Action: api.HookReleaseDeleted,
|
Action: api.HookReleaseDeleted,
|
||||||
Release: rel.APIFormat(),
|
Release: rel.APIFormat(),
|
||||||
Repository: rel.Repo.APIFormat(mode),
|
Repository: rel.Repo.APIFormat(mode),
|
||||||
Sender: rel.Publisher.APIFormat(),
|
Sender: doer.APIFormat(),
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
log.Error("PrepareWebhooks: %v", err)
|
log.Error("PrepareWebhooks: %v", err)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue