]> source.dussan.org Git - gitea.git/commitdiff
fix double 'push tag' action feed (#15078)
authora1012112796 <1012112796@qq.com>
Sun, 21 Mar 2021 10:11:22 +0000 (18:11 +0800)
committerGitHub <noreply@github.com>
Sun, 21 Mar 2021 10:11:22 +0000 (11:11 +0100)
Signed-off-by: a1012112796 <1012112796@qq.com>
modules/notification/action/action.go

index 3530e48b1cebdd7e2356bb71407dd52a47f0037a..776bee6a0ca3e2b7185b8cfe5520babccede059f 100644 (file)
@@ -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,