Skip to content

Commit 3f7cab4

Browse files
Revert "Do not send notifications for draft releases (#21451)" (#21594)
This reverts commit a37e8b2 / #21451 Temporarily revert this PR to be able to continue discussion, and potentially get it into 1.19.0
1 parent 5c2089a commit 3f7cab4

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

Diff for: services/release/release.go

+7-8
Original file line numberDiff line numberDiff line change
@@ -271,12 +271,13 @@ func UpdateRelease(doer *user_model.User, gitRepo *git.Repository, rel *repo_mod
271271
}
272272
}
273273

274+
if !isCreated {
275+
notification.NotifyUpdateRelease(doer, rel)
276+
return
277+
}
278+
274279
if !rel.IsDraft {
275-
if isCreated {
276-
notification.NotifyNewRelease(rel)
277-
} else {
278-
notification.NotifyUpdateRelease(doer, rel)
279-
}
280+
notification.NotifyNewRelease(rel)
280281
}
281282

282283
return err
@@ -352,9 +353,7 @@ func DeleteReleaseByID(ctx context.Context, id int64, doer *user_model.User, del
352353
}
353354
}
354355

355-
if !rel.IsDraft {
356-
notification.NotifyDeleteRelease(doer, rel)
357-
}
356+
notification.NotifyDeleteRelease(doer, rel)
358357

359358
return nil
360359
}

0 commit comments

Comments
 (0)