From fbaa01998ac60360f353c10e8af2270cafdfd5fd Mon Sep 17 00:00:00 2001 From: a1012112796 <1012112796@qq.com> Date: Sun, 21 Mar 2021 22:51:31 +0800 Subject: [PATCH] fix double 'push tag' action feed (#15078) (#15083) Signed-off-by: a1012112796 <1012112796@qq.com> --- modules/notification/action/action.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/notification/action/action.go b/modules/notification/action/action.go index 3530e48b1ceb..776bee6a0ca3 100644 --- a/modules/notification/action/action.go +++ b/modules/notification/action/action.go @@ -332,7 +332,8 @@ func (a *actionNotifier) NotifyPushCommits(pusher *models.User, repo *models.Rep func (a *actionNotifier) NotifyCreateRef(doer *models.User, repo *models.Repository, refType, refFullName string) { opType := models.ActionCommitRepo if refType == "tag" { - opType = models.ActionPushTag + // has sent same action in `NotifyPushCommits`, so skip it. + return } if err := models.NotifyWatchers(&models.Action{ ActUserID: doer.ID, @@ -350,7 +351,8 @@ func (a *actionNotifier) NotifyCreateRef(doer *models.User, repo *models.Reposit func (a *actionNotifier) NotifyDeleteRef(doer *models.User, repo *models.Repository, refType, refFullName string) { opType := models.ActionDeleteBranch if refType == "tag" { - opType = models.ActionDeleteTag + // has sent same action in `NotifyPushCommits`, so skip it. + return } if err := models.NotifyWatchers(&models.Action{ ActUserID: doer.ID,