mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-25 11:22:16 +00:00
Fix release published actions not triggering for releases created from existing tags
This commit is contained in:
parent
20c0292b5c
commit
46977b0f01
4 changed files with 15 additions and 15 deletions
|
@ -199,7 +199,7 @@ func CreateNewTag(ctx context.Context, doer *user_model.User, repo *repo_model.R
|
|||
// delAttachmentUUIDs accept a slice of attachments' uuids which will be deleted from the release
|
||||
// editAttachments accept a map of attachment uuid to new attachment name which will be updated with attachments.
|
||||
func UpdateRelease(ctx context.Context, doer *user_model.User, gitRepo *git.Repository, rel *repo_model.Release,
|
||||
addAttachmentUUIDs, delAttachmentUUIDs []string, editAttachments map[string]string,
|
||||
addAttachmentUUIDs, delAttachmentUUIDs []string, editAttachments map[string]string, createdFromTag bool,
|
||||
) error {
|
||||
if rel.ID == 0 {
|
||||
return errors.New("UpdateRelease only accepts an exist release")
|
||||
|
@ -292,11 +292,11 @@ func UpdateRelease(ctx context.Context, doer *user_model.User, gitRepo *git.Repo
|
|||
}
|
||||
|
||||
if !rel.IsDraft {
|
||||
if !isCreated {
|
||||
notify_service.UpdateRelease(gitRepo.Ctx, doer, rel)
|
||||
if createdFromTag || isCreated {
|
||||
notify_service.NewRelease(gitRepo.Ctx, rel)
|
||||
return nil
|
||||
}
|
||||
notify_service.NewRelease(gitRepo.Ctx, rel)
|
||||
notify_service.UpdateRelease(gitRepo.Ctx, doer, rel)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue