diff options
Diffstat (limited to 'modules/notification/action/action.go')
-rw-r--r-- | modules/notification/action/action.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/modules/notification/action/action.go b/modules/notification/action/action.go index 9956940f30..040cf3df10 100644 --- a/modules/notification/action/action.go +++ b/modules/notification/action/action.go @@ -314,3 +314,22 @@ func (a *actionNotifier) NotifySyncDeleteRef(doer *models.User, repo *models.Rep log.Error("notifyWatchers: %v", err) } } + +func (a *actionNotifier) NotifyNewRelease(rel *models.Release) { + if err := rel.LoadAttributes(); err != nil { + log.Error("NotifyNewRelease: %v", err) + return + } + if err := models.NotifyWatchers(&models.Action{ + ActUserID: rel.PublisherID, + ActUser: rel.Publisher, + OpType: models.ActionPublishRelease, + RepoID: rel.RepoID, + Repo: rel.Repo, + IsPrivate: rel.Repo.IsPrivate, + Content: rel.Title, + RefName: rel.TagName, + }); err != nil { + log.Error("notifyWatchers: %v", err) + } +} |