From 5f610bb01cec75410a67de7f48bfbbcf89d1cf36 Mon Sep 17 00:00:00 2001 From: Arthur Chaloin Date: Mon, 20 Jun 2022 11:25:39 +0200 Subject: [PATCH] fix(ci): properly escape changelog when updating chart.yaml --- deploy/chart/ci.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/deploy/chart/ci.sh b/deploy/chart/ci.sh index 8c3b993..faccc26 100755 --- a/deploy/chart/ci.sh +++ b/deploy/chart/ci.sh @@ -23,9 +23,13 @@ yq -i ".appVersion = \"$version\"" Chart.yaml yq -i ".annotations[\"artifacthub.io/prerelease\"] = \"$prerelease\"" Chart.yaml yq -i ".annotations[\"artifacthub.io/containsSecurityUpdates\"] = \"$containsSecurityUpdates\"" Chart.yaml -yq -i ".annotations[\"artifacthub.io/changes\"] = \"\"" Chart.yaml +changes="[]" IFS=$'\n' for line in $notes; do - yq -i ".annotations[\"artifacthub.io/changes\"] += \"- $(echo "$line" | sed "s/\\\"/\\\\\"/g")\"" Chart.yaml - yq -i $'.annotations[\"artifacthub.io/changes\"] += "\n"' Chart.yaml + changes=$(echo $changes | jq ". += [$(echo -n $line | jq -R -s '.')]") done + +rawChanges="$(echo -n $changes | jq -R -s '.')" +rawChanges="${rawChanges:1}" +rawChanges="${rawChanges%?}" +sed -i '' "s/artifacthub.io\\/changes:\ \'\'/artifacthub.io\\/changes: '$rawChanges'/g" Chart.yaml