From 27489f2e0b6af6785e68df2dbe32c3cf5bb85480 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Fri, 29 Nov 2024 02:13:16 +0800 Subject: [PATCH] Don't create action when syncing mirror pull refs (#32659) (#32664) Backport #32659 by @lunny Fix #27961 Co-authored-by: Lunny Xiao --- services/feed/action.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/feed/action.go b/services/feed/action.go index 83daaa1438..a8820aeb77 100644 --- a/services/feed/action.go +++ b/services/feed/action.go @@ -390,6 +390,12 @@ func (a *actionNotifier) DeleteRef(ctx context.Context, doer *user_model.User, r } func (a *actionNotifier) SyncPushCommits(ctx context.Context, pusher *user_model.User, repo *repo_model.Repository, opts *repository.PushUpdateOptions, commits *repository.PushCommits) { + // ignore pull sync message for pull requests refs + // TODO: it's better to have a UI to let users chose + if opts.RefFullName.IsPull() { + return + } + data, err := json.Marshal(commits) if err != nil { log.Error("json.Marshal: %v", err)