fix(ci): properly escape changelog when updating chart.yaml

This commit is contained in:
Arthur Chaloin
2022-06-20 11:26:11 +02:00
parent ba9e1ace38
commit 5f610bb01c
+7 -3
View File
@@ -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