Skip to content

Commit e1ccf3f

Browse files
committed
Send webhook when tag is removed via Web UI
1 parent 66379ba commit e1ccf3f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

services/release/release.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,16 @@ func DeleteReleaseByID(id int64, doer *models.User, delTag bool) error {
152152
return fmt.Errorf("git tag -d: %v", err)
153153
}
154154

155+
notification.NotifyPushCommits(
156+
doer, repo,
157+
&repository.PushUpdateOptions{
158+
RefFullName: git.TagPrefix + rel.TagName,
159+
OldCommitID: rel.Sha1,
160+
NewCommitID: git.EmptySHA,
161+
}, repository.NewPushCommits())
162+
notification.NotifyDeleteRef(doer, repo, "tag", git.TagPrefix+rel.TagName)
163+
rel.CreatedUnix = timeutil.TimeStampNow()
164+
155165
if err := models.DeleteReleaseByID(id); err != nil {
156166
return fmt.Errorf("DeleteReleaseByID: %v", err)
157167
}

0 commit comments

Comments
 (0)