if rel.ID == 0 {
return errors.New("UpdateRelease only accepts an exist release")
}
- isCreated, err := createTag(gitRepo.Ctx, gitRepo, rel, "")
+ isTagCreated, err := createTag(gitRepo.Ctx, gitRepo, rel, "")
if err != nil {
return err
}
}
defer committer.Close()
+ oldRelease, err := repo_model.GetReleaseByID(ctx, rel.ID)
+ if err != nil {
+ return err
+ }
+ isConvertedFromTag := oldRelease.IsTag && !rel.IsTag
+
if err = repo_model.UpdateRelease(ctx, rel); err != nil {
return err
}
}
if !rel.IsDraft {
- if !isCreated {
+ if !isTagCreated && !isConvertedFromTag {
notify_service.UpdateRelease(gitRepo.Ctx, doer, rel)
return nil
}