feat(release): generate the GitHub release body from the changelog (#2987)

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Valentin Maerten
2026-08-21 15:31:52 +02:00
committed by GitHub
parent dd4463ec60
commit 30c998136d
6 changed files with 141 additions and 3 deletions

View File

@@ -43,20 +43,29 @@ var changelogReleaseRegex = regexp.MustCompile(`## Unreleased`)
// Flags
var (
versionFlag bool
notesFlag bool
)
func init() {
pflag.BoolVarP(&versionFlag, "version", "v", false, "resolved version number")
pflag.BoolVar(&notesFlag, "notes", false, "changelog section of the current version, for the GitHub release body")
pflag.Parse()
}
func main() {
if err := release(); err != nil {
if err := run(); err != nil {
fmt.Println(err)
os.Exit(1)
}
}
func run() error {
if notesFlag {
return notes(os.Stdout)
}
return release()
}
func release() error {
if len(pflag.Args()) != 1 {
return errors.New("error: expected version number")