0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-24 17:12:59 +01:00

Avoid sending update/delete release notice when it is draft (#29008)

Fix #27157
This commit is contained in:
yp05327 2024-02-02 13:18:12 +09:00 committed by GitHub
parent e6265cf59d
commit b9f8d75e27
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 !rel.IsDraft {
if !isCreated {
notify_service.UpdateRelease(gitRepo.Ctx, doer, rel)
return nil
}
notify_service.NewRelease(gitRepo.Ctx, rel) notify_service.NewRelease(gitRepo.Ctx, rel)
} }
return nil 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 return nil
} }