From 221f40a29d1682362c8764fa5ea9e0249c9a3caa Mon Sep 17 00:00:00 2001 From: Jan Braje <12571346+janluak@users.noreply.github.com> Date: Mon, 20 Jul 2026 10:56:03 +0200 Subject: [PATCH] fix potential writing of chart files even if testing with no actual chart Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Jan Braje <12571346+janluak@users.noreply.github.com> --- pkg/action/bump.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/action/bump.go b/pkg/action/bump.go index f01034a49..860bdf21d 100644 --- a/pkg/action/bump.go +++ b/pkg/action/bump.go @@ -134,9 +134,11 @@ func (b *Bump) Run(bumpType string, chartpath string) (string, error) { b.chart.Metadata.Version = newVersion // Save the updated chart to disk (this will update Chart.yaml) - err = util.SaveChartfile(filepath.Join(chartpath, "Chart.yaml"), b.chart.Metadata) - if err != nil { - return "", fmt.Errorf("failed to save updated chart: %w", err) + if chartpath != "" { + err = util.SaveChartfile(filepath.Join(chartpath, "Chart.yaml"), b.chart.Metadata) + if err != nil { + return "", fmt.Errorf("failed to save updated chart: %w", err) + } } return newVersion, nil