Skip to content

Commit

Permalink
label and milestone webhooks on issue/pull creation
Browse files Browse the repository at this point in the history
  • Loading branch information
jpraet committed Jan 17, 2021
1 parent e6155ff commit 42b4bef
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions services/issue/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ func NewIssue(repo *models.Repository, issue *models.Issue, labelIDs []int64, uu
}

notification.NotifyNewIssue(issue, mentions)
if len(issue.Labels) > 0 {
notification.NotifyIssueChangeLabels(issue.Poster, issue, issue.Labels, nil)
}
if issue.Milestone != nil {
notification.NotifyIssueChangeMilestone(issue.Poster, issue, 0)
}

return nil
}
Expand Down
6 changes: 6 additions & 0 deletions services/pull/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ func NewPullRequest(repo *models.Repository, pull *models.Issue, labelIDs []int6
}

notification.NotifyNewPullRequest(pr, mentions)
if len(pull.Labels) > 0 {
notification.NotifyIssueChangeLabels(pull.Poster, pull, pull.Labels, nil)
}
if pull.Milestone != nil {
notification.NotifyIssueChangeMilestone(pull.Poster, pull, 0)
}

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

0 comments on commit 42b4bef

Please sign in to comment.