Skip to content

Commit

Permalink
Ignore directories with missing Chart.yaml (#18)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ccremer authored Apr 6, 2020
1 parent 5ecd0f7 commit 8505b7a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion cr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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() {
Expand Down

0 comments on commit 8505b7a

Please sign in to comment.