Parcourir la source

label and milestone webhooks on issue/pull creation (#14363)

tags/v1.15.0-dev
Jimmy Praet il y a 3 ans
Parent
révision
4d9349123f
Aucun compte lié à l'adresse e-mail de l'auteur
2 fichiers modifiés avec 12 ajouts et 0 suppressions
  1. 6
    0
      services/issue/issue.go
  2. 6
    0
      services/pull/pull.go

+ 6
- 0
services/issue/issue.go Voir le fichier

@@ -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
}

+ 6
- 0
services/pull/pull.go Voir le fichier

@@ -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())

Chargement…
Annuler
Enregistrer