Skip to content

Commit

Permalink
Merge branch 'main' into automated-changelog-update
Browse files Browse the repository at this point in the history
  • Loading branch information
fhielpos authored Nov 13, 2024
2 parents 1c27a62 + 186e146 commit de854a8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 26 deletions.
46 changes: 21 additions & 25 deletions hack/changelogger.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ type Changelog struct {
}

type Version struct {
Name string `json:"name"`
Changed []string `json:"changed"`
Added []string `json:"added"`
Fixed []string `json:"fixed"`
Removed []string `json:"removed"`
Notes []string `json:"notes"`
Name string `json:"name"`
Changed []string `json:"changed"`
Added []string `json:"added"`
Fixed []string `json:"fixed"`
Removed []string `json:"removed"`
Notes []string `json:"notes"`
BreakingChanges []string `json:"breakingchanges"`
}

func init() {
Expand Down Expand Up @@ -68,52 +69,45 @@ func writeChangelogFile(newChangelog Changelog, path string) error {

lines = append(lines, newChangelog.Title+"\n")
if len(newChangelog.Notes) > 0 {
for _, note := range newChangelog.Notes {
lines = append(lines, note)
}
lines = append(lines, newChangelog.Notes...)
}
for _, version := range newChangelog.Versions {
lines = append(lines, version.Name+"\n")

if len(version.Added) != 0 {
header := "### Added\n"
lines = append(lines, header)

for _, item := range version.Added {
lines = append(lines, item)
}
lines = append(lines, version.Added...)
lines = append(lines, "")
}
if len(version.Changed) != 0 {
header := "### Changed\n"
lines = append(lines, header)
for _, item := range version.Changed {
lines = append(lines, item)
}
lines = append(lines, version.Changed...)
lines = append(lines, "")
}
if len(version.Fixed) != 0 {
header := "### Fixed\n"
lines = append(lines, header)
for _, item := range version.Fixed {
lines = append(lines, item)
}
lines = append(lines, version.Fixed...)
lines = append(lines, "")
}
if len(version.Removed) != 0 {
header := "### Removed\n"
lines = append(lines, header)
for _, item := range version.Removed {
lines = append(lines, item)
}
lines = append(lines, version.Removed...)
lines = append(lines, "")
}
if len(version.Notes) != 0 {
header := "### Notes\n"
lines = append(lines, header)
for _, item := range version.Notes {
lines = append(lines, item)
}
lines = append(lines, version.Notes...)
lines = append(lines, "")
}
if len(version.BreakingChanges) != 0 {
header := "### Breaking Changes\n"
lines = append(lines, header)
lines = append(lines, version.BreakingChanges...)
lines = append(lines, "")
}
}
Expand Down Expand Up @@ -177,6 +171,8 @@ func parseMarkdown(markdown []string) Changelog {
currentVersion.Removed = append(currentVersion.Removed, line)
case "Notes":
currentVersion.Notes = append(currentVersion.Notes, line)
case "Breaking":
currentVersion.BreakingChanges = append(currentVersion.BreakingChanges, line)
default:
continue
}
Expand Down
2 changes: 1 addition & 1 deletion helm/security-bundle/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ apps:
# namespace: security-bundle
# used by renovate
# repo: giantswarm/trivy-app
version: 0.13.0
version: 0.13.1

trivyOperator:
appName: trivy-operator
Expand Down

0 comments on commit de854a8

Please sign in to comment.