Skip to content

Commit 62cd7f8

Browse files
yp05327GiteaBot
authored andcommitted
Avoid sending update/delete release notice when it is draft (go-gitea#29008)
Fix go-gitea#27157
1 parent 333d02d commit 62cd7f8

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
@@ -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)