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
Fix #27157
  • Loading branch information
yp05327 authored Feb 2, 2024
1 parent e6265cf commit b9f8d75
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 @@ -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
}

Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit b9f8d75

Please sign in to comment.