Skip to content

Commit

Permalink
fix double 'push tag' action feed (#15078)
Browse files Browse the repository at this point in the history
Signed-off-by: a1012112796 <1012112796@qq.com>
  • Loading branch information
a1012112796 authored Mar 21, 2021
1 parent 2f0eb9f commit 17731e0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/notification/action/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 17731e0

Please sign in to comment.