Skip to content

Commit

Permalink
Avoid sending update/delete release notice when it is draft (#29008) …
Browse files Browse the repository at this point in the history
…(#29025)

Backport #29008 by @yp05327

Fix #27157

Co-authored-by: yp05327 <576951401@qq.com>
  • Loading branch information
GiteaBot and yp05327 authored Feb 2, 2024
1 parent 5ac4102 commit 8def405
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions services/release/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,15 +278,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
}

Expand Down Expand Up @@ -351,7 +349,8 @@ 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
}

0 comments on commit 8def405

Please sign in to comment.