Skip to content

Commit 17731e0

Browse files
authored
fix double 'push tag' action feed (#15078)
Signed-off-by: a1012112796 <1012112796@qq.com>
1 parent 2f0eb9f commit 17731e0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

modules/notification/action/action.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,8 @@ func (a *actionNotifier) NotifyPushCommits(pusher *models.User, repo *models.Rep
332332
func (a *actionNotifier) NotifyCreateRef(doer *models.User, repo *models.Repository, refType, refFullName string) {
333333
opType := models.ActionCommitRepo
334334
if refType == "tag" {
335-
opType = models.ActionPushTag
335+
// has sent same action in `NotifyPushCommits`, so skip it.
336+
return
336337
}
337338
if err := models.NotifyWatchers(&models.Action{
338339
ActUserID: doer.ID,
@@ -350,7 +351,8 @@ func (a *actionNotifier) NotifyCreateRef(doer *models.User, repo *models.Reposit
350351
func (a *actionNotifier) NotifyDeleteRef(doer *models.User, repo *models.Repository, refType, refFullName string) {
351352
opType := models.ActionDeleteBranch
352353
if refType == "tag" {
353-
opType = models.ActionDeleteTag
354+
// has sent same action in `NotifyPushCommits`, so skip it.
355+
return
354356
}
355357
if err := models.NotifyWatchers(&models.Action{
356358
ActUserID: doer.ID,

0 commit comments

Comments
 (0)