Compare commits
2 Commits
d401e4c9ff
...
60037a3996
Author | SHA1 | Date |
---|---|---|
Florian Beisel | 60037a3996 | |
Florian Beisel | 1fbb0eba98 |
|
@ -56,17 +56,19 @@ func updateOrCreateDraftRelease(a *Action, cfg *config.RepoConfig) (*gitea.Relea
|
|||
for _, pr := range prs {
|
||||
categorized := false
|
||||
for _, category := range cfg.Categories {
|
||||
if !categorized && prHasLabel(prs, category.Labels) {
|
||||
if !categorized && prHasLabel(pr, category.Labels) {
|
||||
categorizedPRs[category.Title] = append(categorizedPRs[category.Title], pr)
|
||||
categorized = true
|
||||
// Break after adding the PR to a category
|
||||
break
|
||||
break // Break out of the category loop
|
||||
}
|
||||
}
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -165,8 +167,7 @@ func (a *Action) Run() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func prHasLabel(prs []*gitea.PullRequest, labels []string) bool {
|
||||
for _, pr := range prs {
|
||||
func prHasLabel(pr *gitea.PullRequest, labels []string) bool {
|
||||
for _, prLabel := range pr.Labels {
|
||||
for _, label := range labels {
|
||||
if prLabel.Name == label {
|
||||
|
@ -174,6 +175,5 @@ func prHasLabel(prs []*gitea.PullRequest, labels []string) bool {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue