fix double 'push tag' action feed (#15078) (#15083)

Signed-off-by: a1012112796 <1012112796@qq.com>
mj-v1.14.3
a1012112796 3 years ago committed by GitHub
parent ac2ae66ae7
commit fbaa01998a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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) { func (a *actionNotifier) NotifyCreateRef(doer *models.User, repo *models.Repository, refType, refFullName string) {
opType := models.ActionCommitRepo opType := models.ActionCommitRepo
if refType == "tag" { if refType == "tag" {
opType = models.ActionPushTag // has sent same action in `NotifyPushCommits`, so skip it.
return
} }
if err := models.NotifyWatchers(&models.Action{ if err := models.NotifyWatchers(&models.Action{
ActUserID: doer.ID, 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) { func (a *actionNotifier) NotifyDeleteRef(doer *models.User, repo *models.Repository, refType, refFullName string) {
opType := models.ActionDeleteBranch opType := models.ActionDeleteBranch
if refType == "tag" { if refType == "tag" {
opType = models.ActionDeleteTag // has sent same action in `NotifyPushCommits`, so skip it.
return
} }
if err := models.NotifyWatchers(&models.Action{ if err := models.NotifyWatchers(&models.Action{
ActUserID: doer.ID, ActUserID: doer.ID,

Loading…
Cancel
Save