Ignore directories with missing Chart.yaml (#18)

Prevents action fails when there are directories detected that do not contain charts.
(e.g. .github)

Signed-off-by: Chris <github.account@chrigel.net>
Fixed: #12
This commit is contained in:
Chris
2020-04-06 18:34:49 +02:00
committed by GitHub
parent 5ecd0f7f1a
commit 8505b7acc8
+13 -1
View File
@@ -181,6 +181,18 @@ lookup_latest_tag() {
fi
}
filter_charts() {
while read chart; do
[[ ! -d "$chart" ]] && continue
local file="$chart/Chart.yaml"
if [[ -f "$file" ]]; then
echo $chart
else
echo "WARNING: $file is missing, assuming that '$chart' is not a Helm chart. Skipping." 1>&2
fi
done
}
lookup_changed_charts() {
local commit="$1"
@@ -194,7 +206,7 @@ lookup_changed_charts() {
fields='1,2'
fi
cut -d '/' -f "$fields" <<< "$changed_files" | uniq
cut -d '/' -f "$fields" <<< "$changed_files" | uniq | filter_charts
}
package_chart() {