Skip to content

Commit 8def405

Browse files
GiteaBotyp05327
andauthored
Avoid sending update/delete release notice when it is draft (#29008) (#29025)
Backport #29008 by @yp05327 Fix #27157 Co-authored-by: yp05327 <[email protected]>
1 parent 5ac4102 commit 8def405

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

services/release/release.go

+7-8
Original file line numberDiff line numberDiff line change
@@ -278,15 +278,13 @@ func UpdateRelease(ctx context.Context, doer *user_model.User, gitRepo *git.Repo
278278
}
279279
}
280280

281-
if !isCreated {
282-
notify_service.UpdateRelease(gitRepo.Ctx, doer, rel)
283-
return nil
284-
}
285-
286281
if !rel.IsDraft {
282+
if !isCreated {
283+
notify_service.UpdateRelease(gitRepo.Ctx, doer, rel)
284+
return nil
285+
}
287286
notify_service.NewRelease(gitRepo.Ctx, rel)
288287
}
289-
290288
return nil
291289
}
292290

@@ -351,7 +349,8 @@ func DeleteReleaseByID(ctx context.Context, repo *repo_model.Repository, rel *re
351349
}
352350
}
353351

354-
notify_service.DeleteRelease(ctx, doer, rel)
355-
352+
if !rel.IsDraft {
353+
notify_service.DeleteRelease(ctx, doer, rel)
354+
}
356355
return nil
357356
}

0 commit comments

Comments
 (0)