From ab9f8d96b0838b282d0f3143e92e79797c24bebd Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 27 Nov 2024 11:39:12 -0800 Subject: [PATCH 1/2] Don't create action when syncing mirror pull refs --- services/feed/action.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/feed/action.go b/services/feed/action.go index 83daaa1438fd5..1f7d1146a9e3d 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 + // 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) From 4880a6b6fc6c1a1fbb39797493eca7a40c9e3943 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 27 Nov 2024 11:41:23 -0800 Subject: [PATCH 2/2] more comment --- services/feed/action.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/feed/action.go b/services/feed/action.go index 1f7d1146a9e3d..a8820aeb777a7 100644 --- a/services/feed/action.go +++ b/services/feed/action.go @@ -390,7 +390,7 @@ 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 + // 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