1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-23 12:59:11 -05:00

Avoid sending update/delete release notice when it is draft (#29008) (#29025)

Backport #29008 by @yp05327

Fix #27157

Co-authored-by: yp05327 <576951401@qq.com>
This commit is contained in:
Giteabot 2024-02-02 17:37:37 +08:00 committed by GitHub
parent 5ac41026f9
commit 8def405047
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -278,15 +278,13 @@ func UpdateRelease(ctx context.Context, doer *user_model.User, gitRepo *git.Repo
}
}
if !isCreated {
notify_service.UpdateRelease(gitRepo.Ctx, doer, rel)
return nil
}
if !rel.IsDraft {
if !isCreated {
notify_service.UpdateRelease(gitRepo.Ctx, doer, rel)
return nil
}
notify_service.NewRelease(gitRepo.Ctx, rel)
}
return nil
}
@ -351,7 +349,8 @@ func DeleteReleaseByID(ctx context.Context, repo *repo_model.Repository, rel *re
}
}
notify_service.DeleteRelease(ctx, doer, rel)
if !rel.IsDraft {
notify_service.DeleteRelease(ctx, doer, rel)
}
return nil
}