Skip to content

Commit a37e8b2

Browse files
KN4CK3Rwxiaoguanglunny6543
authored
Do not send notifications for draft releases (go-gitea#21451)
Fixes go-gitea#21448 Co-authored-by: wxiaoguang <[email protected]> Co-authored-by: Lunny Xiao <[email protected]> Co-authored-by: 6543 <[email protected]>
1 parent c0888de commit a37e8b2

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

services/release/release.go

+8-7
Original file line numberDiff line numberDiff line change
@@ -271,13 +271,12 @@ 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-
279274
if !rel.IsDraft {
280-
notification.NotifyNewRelease(rel)
275+
if isCreated {
276+
notification.NotifyNewRelease(rel)
277+
} else {
278+
notification.NotifyUpdateRelease(doer, rel)
279+
}
281280
}
282281

283282
return err
@@ -353,7 +352,9 @@ func DeleteReleaseByID(ctx context.Context, id int64, doer *user_model.User, del
353352
}
354353
}
355354

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

358359
return nil
359360
}

0 commit comments

Comments
 (0)