fix: 🐛 attempt to fix the Duplication of PRs in Rrelease Draft
This commit is contained in:
parent
56650ff20f
commit
d401e4c9ff
|
@ -53,15 +53,21 @@ func updateOrCreateDraftRelease(a *Action, cfg *config.RepoConfig) (*gitea.Relea
|
||||||
categorizedPRs := make(map[string][]*gitea.PullRequest)
|
categorizedPRs := make(map[string][]*gitea.PullRequest)
|
||||||
|
|
||||||
for _, prs := range *changelog {
|
for _, prs := range *changelog {
|
||||||
for _, category := range cfg.Categories {
|
|
||||||
if prHasLabel(prs, category.Labels) {
|
|
||||||
// Correctly append each PR in the slice
|
|
||||||
for _, pr := range prs {
|
for _, pr := range prs {
|
||||||
|
categorized := false
|
||||||
|
for _, category := range cfg.Categories {
|
||||||
|
if !categorized && prHasLabel(prs, category.Labels) {
|
||||||
categorizedPRs[category.Title] = append(categorizedPRs[category.Title], pr)
|
categorizedPRs[category.Title] = append(categorizedPRs[category.Title], pr)
|
||||||
}
|
categorized = true
|
||||||
|
// Break after adding the PR to a category
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if !categorized {
|
||||||
|
// Add to a default category if not categorized
|
||||||
|
categorizedPRs["Other Changes"] = append(categorizedPRs["Other Changes"], pr)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build the changelog string
|
// Build the changelog string
|
||||||
|
|
Loading…
Reference in New Issue