Skip to content

Commit df7ce2f

Browse files
authored
Merge pull request #328 from onepanelio/chore/update-commands
chore: update gen-release-md command and README
2 parents b3e7ed5 + f20a7a2 commit df7ce2f

File tree

3 files changed

+28
-14
lines changed

3 files changed

+28
-14
lines changed

cmd/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Helper scripts
2+
3+
## gen-release-md.go
4+
Generates markdown for releases.
5+
6+
Usage:
7+
```bash
8+
go run cmd/gen-release-md.go -v=0.10.0 > /tmp/release.md
9+
```
10+
11+
## goose.go
12+
Supports both Go and SQL migrations.
13+
14+
```bash
15+
go run cmd/goose up # run up migrations
16+
go run cmd/goose down # run down migrations
17+
```

scripts/generate-release-md.go renamed to cmd/gen-release-md.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"flag"
66
"fmt"
77
"net/http"
8+
"strings"
89
)
910

1011
type User struct {
@@ -91,19 +92,24 @@ func printMarkDown(issues []*Issue, version *string) {
9192
continue
9293
}
9394

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+
}
96100
}
97101

98102
releaseTemplate := fmt.Sprintf(releaseTemplate, *version, *version)
99103
fmt.Println(releaseTemplate)
100104
fmt.Println("# Changelog\n")
101105
fmt.Println("## Features\n")
102-
fmt.Println(sections["kind/enhancement"])
106+
fmt.Println(sections["feat"])
103107
fmt.Println("## Fixes\n")
104-
fmt.Println(sections["kind/bug"])
108+
fmt.Println(sections["fix"])
105109
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"])
107113

108114
fmt.Println("# Contributors\n")
109115
for _, user := range contributors {

scripts/README.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)