From 39cc72562b1f9607d9eb8141daa8050d4468aade Mon Sep 17 00:00:00 2001 From: Giteabot Date: Tue, 31 Dec 2024 20:33:08 +0800 Subject: [PATCH] feat(action): issue change title notifications (#33050) (#33065) Backport #33050 by appleboy action file as below: ```yaml name: Semantic Pull Request on: pull_request_target: types: [edited] ``` Signed-off-by: Bo-Yi Wu Co-authored-by: Bo-Yi Wu Co-authored-by: wxiaoguang --- services/actions/notifier.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/services/actions/notifier.go b/services/actions/notifier.go index a4ebdf9e88..67e33e7cce 100644 --- a/services/actions/notifier.go +++ b/services/actions/notifier.go @@ -58,7 +58,15 @@ func (n *actionsNotifier) NewIssue(ctx context.Context, issue *issues_model.Issu // IssueChangeContent notifies change content of issue func (n *actionsNotifier) IssueChangeContent(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, oldContent string) { ctx = withMethod(ctx, "IssueChangeContent") + n.notifyIssueChangeWithTitleOrContent(ctx, doer, issue) +} +func (n *actionsNotifier) IssueChangeTitle(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, oldTitle string) { + ctx = withMethod(ctx, "IssueChangeTitle") + n.notifyIssueChangeWithTitleOrContent(ctx, doer, issue) +} + +func (n *actionsNotifier) notifyIssueChangeWithTitleOrContent(ctx context.Context, doer *user_model.User, issue *issues_model.Issue) { var err error if err = issue.LoadRepo(ctx); err != nil { log.Error("LoadRepo: %v", err)