Skip to content

Commit

Permalink
Set default properties for releases created from tags
Browse files Browse the repository at this point in the history
This makes it easier to create new releases from tags as the
release form is pre-filled with data that is in the tag
message anyway.

Signed-off-by: Wiktor Kwapisiewicz <wiktor@metacode.biz>
  • Loading branch information
wiktor-k committed Mar 27, 2023
1 parent 35bc1ea commit 52fbd92
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions services/repository/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,15 +374,20 @@ func pushUpdateAddTags(ctx context.Context, repo *repo_model.Repository, gitRepo
rel, has := relMap[lowerTag]

if !has {
parts := strings.SplitN(tag.Message, "\n", 2)
note := ""
if len(parts) > 1 {
note = parts[1]
}
rel = &repo_model.Release{
RepoID: repo.ID,
Title: "",
Title: parts[0],
TagName: tags[i],
LowerTagName: lowerTag,
Target: "",
Sha1: commit.ID.String(),
NumCommits: commitsCount,
Note: "",
Note: note,
IsDraft: false,
IsPrerelease: false,
IsTag: true,
Expand Down

0 comments on commit 52fbd92

Please sign in to comment.