diff --git a/.github/scripts/gen-docs.sh b/.github/scripts/gen-docs.sh index 1440ec8541d..cbd1d957d4d 100755 --- a/.github/scripts/gen-docs.sh +++ b/.github/scripts/gen-docs.sh @@ -27,7 +27,17 @@ sync_tag() { tag="${tag%_}" tag="${tag%.}" sed -i -e "s|appVersion: .*|appVersion: \"${tag}\"|" "${chart}/Chart.yaml" - sed -i -e "s|home: .*|home: \"https:\/\/truecharts.org\/docs\/charts\/${train}\/${chartname}\"|" "${chart}/Chart.yaml" + sed -i -e "s|home: .*|home: https:\/\/truecharts.org\/docs\/charts\/${train}\/${chartname}|" "${chart}/Chart.yaml" + # Get all sources (except truecharts) + curr_sources=$(yq '.sources[] | select(. != "https://github.com/truecharts*")' "${chart}/Chart.yaml") + # Empty sources list in-place + yq -i 'del(.sources.[])' "${chart}/Chart.yaml" + # Add truechart source + tcsource="https://github.com/truecharts/charts/tree/master/charts/$train/$chartname" yq -i '.sources += env(tcsource)' "${chart}/Chart.yaml" + # Add the rest of the sources + while IFS= read -r line; do + src="$line" yq -i '.sources += env(src)' "${chart}/Chart.yaml" + done <<< "$curr_sources" } export -f sync_tag diff --git a/tools/build-release.sh b/tools/build-release.sh index 4c7c00799bb..b80e4aef3e2 100755 --- a/tools/build-release.sh +++ b/tools/build-release.sh @@ -296,7 +296,17 @@ sync_tag() { tag="${tag%_}" tag="${tag%.}" sed -i -e "s|appVersion: .*|appVersion: \"${tag}\"|" "${chart}/Chart.yaml" - sed -i -e "s|home: .*|home: \"https:\/\/truecharts.org\/docs\/charts\/${train}\/${chartname}\"|" "${chart}/Chart.yaml" + sed -i -e "s|home: .*|home: https:\/\/truecharts.org\/docs\/charts\/${train}\/${chartname}|" "${chart}/Chart.yaml" + # Get all sources (except truecharts) + curr_sources=$(yq '.sources[] | select(. != "https://github.com/truecharts*")' "${chart}/Chart.yaml") + # Empty sources list in-place + yq -i 'del(.sources.[])' "${chart}/Chart.yaml" + # Add truechart source + tcsource="https://github.com/truecharts/charts/tree/master/charts/$train/$chartname" yq -i '.sources += env(tcsource)' "${chart}/Chart.yaml" + # Add the rest of the sources + while IFS= read -r line; do + src="$line" yq -i '.sources += env(src)' "${chart}/Chart.yaml" + done <<< "$curr_sources" } export -f sync_tag