Compare commits

..

No commits in common. "60037a3996172e84c55d1cb16fc0cb2647477350" and "d401e4c9ff14c9e8f294923b5125744d48f004c1" have entirely different histories.

1 changed files with 10 additions and 10 deletions

View File

@ -56,19 +56,17 @@ func updateOrCreateDraftRelease(a *Action, cfg *config.RepoConfig) (*gitea.Relea
for _, pr := range prs {
categorized := false
for _, category := range cfg.Categories {
if !categorized && prHasLabel(pr, category.Labels) {
if !categorized && prHasLabel(prs, category.Labels) {
categorizedPRs[category.Title] = append(categorizedPRs[category.Title], pr)
categorized = true
break // Break out of the category loop
// Break after adding the PR to a category
break
}
}
if !categorized {
// Add to a default category if not categorized
categorizedPRs["Other Changes"] = append(categorizedPRs["Other Changes"], pr)
}
if categorized {
break // Break out of the PR loop once categorized
}
}
}
@ -167,11 +165,13 @@ func (a *Action) Run() error {
return nil
}
func prHasLabel(pr *gitea.PullRequest, labels []string) bool {
for _, prLabel := range pr.Labels {
for _, label := range labels {
if prLabel.Name == label {
return true
func prHasLabel(prs []*gitea.PullRequest, labels []string) bool {
for _, pr := range prs {
for _, prLabel := range pr.Labels {
for _, label := range labels {
if prLabel.Name == label {
return true
}
}
}
}