Skip to content

Commit b9f8d75

Browse files
authored
Avoid sending update/delete release notice when it is draft (#29008)
Fix #27157
1 parent e6265cf commit b9f8d75

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

services/release/release.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -291,15 +291,13 @@ func UpdateRelease(ctx context.Context, doer *user_model.User, gitRepo *git.Repo
291291
}
292292
}
293293

294-
if !isCreated {
295-
notify_service.UpdateRelease(gitRepo.Ctx, doer, rel)
296-
return nil
297-
}
298-
299294
if !rel.IsDraft {
295+
if !isCreated {
296+
notify_service.UpdateRelease(gitRepo.Ctx, doer, rel)
297+
return nil
298+
}
300299
notify_service.NewRelease(gitRepo.Ctx, rel)
301300
}
302-
303301
return nil
304302
}
305303

@@ -368,8 +366,9 @@ func DeleteReleaseByID(ctx context.Context, repo *repo_model.Repository, rel *re
368366
}
369367
}
370368

371-
notify_service.DeleteRelease(ctx, doer, rel)
372-
369+
if !rel.IsDraft {
370+
notify_service.DeleteRelease(ctx, doer, rel)
371+
}
373372
return nil
374373
}
375374

0 commit comments

Comments
 (0)