Skip to content

Commit

Permalink
fix: in case of missing label pr goes to misc
Browse files Browse the repository at this point in the history
  • Loading branch information
bartoszmajsak committed Dec 5, 2019
1 parent cb5ee99 commit 78bb79b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/cmd/generate/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ func fetchRelatedPRs(repoName, ref string) map[string][]github.PullRequest {
prsByLabels := make(map[string][]github.PullRequest)
for i := range prs {
pr := prs[i]
prsByLabels[pr.Labels[0]] = append(prsByLabels[pr.Labels[0]], pr)
label := "misc"
if len(pr.Labels) > 0 {
label = pr.Labels[0]
}
prsByLabels[label] = append(prsByLabels[label], pr)
}

return prsByLabels
Expand Down

0 comments on commit 78bb79b

Please sign in to comment.