Move repofiles webhooks to notification (#8807)

This commit is contained in:
Lunny Xiao 2019-11-06 14:43:03 +08:00 committed by GitHub
parent 36b8c081f6
commit 8a84d82d53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 77 additions and 68 deletions

View file

@ -199,3 +199,17 @@ func NotifyPushCommits(pusher *models.User, repo *models.Repository, refName, ol
notifier.NotifyPushCommits(pusher, repo, refName, oldCommitID, newCommitID, commits)
}
}
// NotifyCreateRef notifies branch or tag creation to notifiers
func NotifyCreateRef(pusher *models.User, repo *models.Repository, refType, refFullName string) {
for _, notifier := range notifiers {
notifier.NotifyCreateRef(pusher, repo, refType, refFullName)
}
}
// NotifyDeleteRef notifies branch or tag deletion to notifiers
func NotifyDeleteRef(pusher *models.User, repo *models.Repository, refType, refFullName string) {
for _, notifier := range notifiers {
notifier.NotifyDeleteRef(pusher, repo, refType, refFullName)
}
}