Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not send notifications for draft releases #21451

Merged
merged 12 commits into from
Oct 17, 2022
15 changes: 8 additions & 7 deletions services/release/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,12 @@ func UpdateRelease(doer *user_model.User, gitRepo *git.Repository, rel *repo_mod
}
}

if !isCreated {
notification.NotifyUpdateRelease(doer, rel)
return
}

if !rel.IsDraft {
notification.NotifyNewRelease(rel)
if isCreated {
notification.NotifyNewRelease(rel)
} else {
notification.NotifyUpdateRelease(doer, rel)
}
}

return err
Expand Down Expand Up @@ -353,7 +352,9 @@ func DeleteReleaseByID(ctx context.Context, id int64, doer *user_model.User, del
}
}

notification.NotifyDeleteRelease(doer, rel)
if !rel.IsDraft {
notification.NotifyDeleteRelease(doer, rel)
}

return nil
}