Skip to content

Commit 42b4bef

Browse files
committed
label and milestone webhooks on issue/pull creation
1 parent e6155ff commit 42b4bef

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

services/issue/issue.go

+6
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ func NewIssue(repo *models.Repository, issue *models.Issue, labelIDs []int64, uu
2929
}
3030

3131
notification.NotifyNewIssue(issue, mentions)
32+
if len(issue.Labels) > 0 {
33+
notification.NotifyIssueChangeLabels(issue.Poster, issue, issue.Labels, nil)
34+
}
35+
if issue.Milestone != nil {
36+
notification.NotifyIssueChangeMilestone(issue.Poster, issue, 0)
37+
}
3238

3339
return nil
3440
}

services/pull/pull.go

+6
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ func NewPullRequest(repo *models.Repository, pull *models.Issue, labelIDs []int6
5959
}
6060

6161
notification.NotifyNewPullRequest(pr, mentions)
62+
if len(pull.Labels) > 0 {
63+
notification.NotifyIssueChangeLabels(pull.Poster, pull, pull.Labels, nil)
64+
}
65+
if pull.Milestone != nil {
66+
notification.NotifyIssueChangeMilestone(pull.Poster, pull, 0)
67+
}
6268

6369
// add first push codes comment
6470
baseGitRepo, err := git.OpenRepository(pr.BaseRepo.RepoPath())

0 commit comments

Comments
 (0)