@@ -18,9 +18,7 @@ package steps
18
18
19
19
import (
20
20
"bytes"
21
- "fmt"
22
21
"os"
23
- "strings"
24
22
25
23
semver "github.com/blang/semver/v4"
26
24
"github.com/helm/helm/pkg/chartutil"
@@ -104,18 +102,21 @@ func updateVersion(version string) {
104
102
utils .CheckIfError (err , "HELM Saving new Chart" )
105
103
}
106
104
107
- func updateChartReleaseNotes (releasesNotes []string ) {
108
- utils .Info ("HELM Updating the Chart Release notes" )
105
+ func updateChartReleaseNotes (releaseNotes []string ) {
106
+ utils .Info ("HELM Updating chart release notes" )
109
107
chart , err := chartutil .LoadChartfile (HelmChartPath )
110
- utils .CheckIfError (err , "HELM Could not Load Chart to update release notes %s" , HelmChartPath )
111
- for i := range releasesNotes {
112
- releasesNotes [i ] = fmt .Sprintf ("- %q" , releasesNotes [i ])
113
- }
114
- releaseNoteString := strings .Join (releasesNotes , "\n " )
115
- utils .Info ("HELM Release note string %s" , releaseNoteString )
116
- chart .Annotations ["artifacthub.io/changes" ] = releaseNoteString
108
+ utils .CheckIfError (err , "HELM Failed to load chart manifest: %s" , HelmChartPath )
109
+
110
+ releaseNotesBytes , err := yaml .Marshal (releaseNotes )
111
+ utils .CheckIfError (err , "HELM Failed to marshal release notes" )
112
+
113
+ releaseNotesString := string (releaseNotesBytes )
114
+ utils .Info ("HELM Chart release notes:\n %s" , releaseNotesString )
115
+ chart .Annotations ["artifacthub.io/changes" ] = releaseNotesString
116
+
117
+ utils .Info ("HELM Saving chart release notes" )
117
118
err = chartutil .SaveChartfile (HelmChartPath , chart )
118
- utils .CheckIfError (err , "HELM Saving updated release notes for Chart" )
119
+ utils .CheckIfError (err , "HELM Failed to save chart manifest: %s" , HelmChartPath )
119
120
}
120
121
121
122
// UpdateChartValue Updates the Helm ChartValue
0 commit comments