Compare commits
No commits in common. "60037a3996172e84c55d1cb16fc0cb2647477350" and "d401e4c9ff14c9e8f294923b5125744d48f004c1" have entirely different histories.
60037a3996
...
d401e4c9ff
|
@ -56,19 +56,17 @@ func updateOrCreateDraftRelease(a *Action, cfg *config.RepoConfig) (*gitea.Relea
|
||||||
for _, pr := range prs {
|
for _, pr := range prs {
|
||||||
categorized := false
|
categorized := false
|
||||||
for _, category := range cfg.Categories {
|
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)
|
categorizedPRs[category.Title] = append(categorizedPRs[category.Title], pr)
|
||||||
categorized = true
|
categorized = true
|
||||||
break // Break out of the category loop
|
// Break after adding the PR to a category
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !categorized {
|
if !categorized {
|
||||||
// Add to a default category if not categorized
|
// Add to a default category if not categorized
|
||||||
categorizedPRs["Other Changes"] = append(categorizedPRs["Other Changes"], pr)
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func prHasLabel(pr *gitea.PullRequest, labels []string) bool {
|
func prHasLabel(prs []*gitea.PullRequest, labels []string) bool {
|
||||||
for _, prLabel := range pr.Labels {
|
for _, pr := range prs {
|
||||||
for _, label := range labels {
|
for _, prLabel := range pr.Labels {
|
||||||
if prLabel.Name == label {
|
for _, label := range labels {
|
||||||
return true
|
if prLabel.Name == label {
|
||||||
|
return true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue