aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryp05327 <576951401@qq.com>2024-02-02 13:18:12 +0900
committerGitHub <noreply@github.com>2024-02-02 04:18:12 +0000
commitb9f8d75e27dc3b434d2f64a22bcbee22162cfe7c (patch)
tree6fc06a77adf8f3af05dda472f55bf3c8f46d46fb
parente6265cf59dc579ba4564fbafd0ef24f9aa6e26a8 (diff)
downloadgitea-b9f8d75e27dc3b434d2f64a22bcbee22162cfe7c.tar.gz
gitea-b9f8d75e27dc3b434d2f64a22bcbee22162cfe7c.zip
Avoid sending update/delete release notice when it is draft (#29008)
Fix #27157
-rw-r--r--services/release/release.go15
1 files changed, 7 insertions, 8 deletions
diff --git a/services/release/release.go b/services/release/release.go
index c1d13126f0..4c522c18be 100644
--- a/services/release/release.go
+++ b/services/release/release.go
@@ -291,15 +291,13 @@ func UpdateRelease(ctx context.Context, doer *user_model.User, gitRepo *git.Repo
}
}
- if !isCreated {
- notify_service.UpdateRelease(gitRepo.Ctx, doer, rel)
- return nil
- }
-
if !rel.IsDraft {
+ if !isCreated {
+ notify_service.UpdateRelease(gitRepo.Ctx, doer, rel)
+ return nil
+ }
notify_service.NewRelease(gitRepo.Ctx, rel)
}
-
return nil
}
@@ -368,8 +366,9 @@ func DeleteReleaseByID(ctx context.Context, repo *repo_model.Repository, rel *re
}
}
- notify_service.DeleteRelease(ctx, doer, rel)
-
+ if !rel.IsDraft {
+ notify_service.DeleteRelease(ctx, doer, rel)
+ }
return nil
}