summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorBenno <blueworrybear@gmail.com>2019-11-23 06:13:57 +0800
committertechknowlogick <techknowlogick@gitea.io>2019-11-22 17:13:57 -0500
commiteb1b225d9a920e68ce415b9732b4ec1d9527a2a2 (patch)
tree498e52cfbe4614897358dd88ab5148b13c8b35b8 /services
parenta4e398dc45c5ce8e4b6e1c6d9599b30316b82ae1 (diff)
downloadgitea-eb1b225d9a920e68ce415b9732b4ec1d9527a2a2.tar.gz
gitea-eb1b225d9a920e68ce415b9732b4ec1d9527a2a2.zip
Send tag create and push webhook when release created on UI (#8671)
* 'update' * Send push tag event when release created * send tag create event while release created in UI * update to go v1.13 * fix gofmt error * update #8671 move release tag created hook to modules/notification/webhook due to #8802 refactoring * use NotifyCreateRef and NotifyPushCommits instead of NotifyNewReleaseTag * move tag notification to correct place
Diffstat (limited to 'services')
-rw-r--r--services/release/release.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/services/release/release.go b/services/release/release.go
index 681e8c0d9a..2f70bbb665 100644
--- a/services/release/release.go
+++ b/services/release/release.go
@@ -37,6 +37,15 @@ func createTag(gitRepo *git.Repository, rel *models.Release) error {
return err
}
rel.LowerTagName = strings.ToLower(rel.TagName)
+ // Prepare Notify
+ if err := rel.LoadAttributes(); err != nil {
+ log.Error("LoadAttributes: %v", err)
+ return err
+ }
+ notification.NotifyPushCommits(
+ rel.Publisher, rel.Repo, git.TagPrefix+rel.TagName,
+ git.EmptySHA, commit.ID.String(), models.NewPushCommits())
+ notification.NotifyCreateRef(rel.Publisher, rel.Repo, "tag", git.TagPrefix+rel.TagName)
}
commit, err := gitRepo.GetTagCommit(rel.TagName)
if err != nil {