|
5 | 5 | "flag" |
6 | 6 | "fmt" |
7 | 7 | "net/http" |
| 8 | + "strings" |
8 | 9 | ) |
9 | 10 |
|
10 | 11 | type User struct { |
@@ -91,19 +92,24 @@ func printMarkDown(issues []*Issue, version *string) { |
91 | 92 | continue |
92 | 93 | } |
93 | 94 |
|
94 | | - contributors[iss.User.Login] = iss.User |
95 | | - sections[iss.Labels[0].Name] += fmt.Sprintf("- %s ([#%d](%s))\n", iss.Title, iss.Number, iss.URL) |
| 95 | + parts := strings.Split(iss.Title, ":") |
| 96 | + if len(parts) > 0 { |
| 97 | + contributors[iss.User.Login] = iss.User |
| 98 | + sections[parts[0]] += fmt.Sprintf("- %s ([#%d](%s))\n", iss.Title, iss.Number, iss.URL) |
| 99 | + } |
96 | 100 | } |
97 | 101 |
|
98 | 102 | releaseTemplate := fmt.Sprintf(releaseTemplate, *version, *version) |
99 | 103 | fmt.Println(releaseTemplate) |
100 | 104 | fmt.Println("# Changelog\n") |
101 | 105 | fmt.Println("## Features\n") |
102 | | - fmt.Println(sections["kind/enhancement"]) |
| 106 | + fmt.Println(sections["feat"]) |
103 | 107 | fmt.Println("## Fixes\n") |
104 | | - fmt.Println(sections["kind/bug"]) |
| 108 | + fmt.Println(sections["fix"]) |
105 | 109 | fmt.Println("## Docs\n") |
106 | | - fmt.Println(sections["kind/docs"]) |
| 110 | + fmt.Println(sections["docs"]) |
| 111 | + fmt.Println("## Chores\n") |
| 112 | + fmt.Println(sections["chore"]) |
107 | 113 |
|
108 | 114 | fmt.Println("# Contributors\n") |
109 | 115 | for _, user := range contributors { |
|
0 commit comments