Skip to content

Commit 9e120a2

Browse files
committed
fix(cicd): update helm-docs check to look at readme inside of chart directory
1 parent d6a483b commit 9e120a2

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

.github/workflows/helm-docs.yml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,34 @@ jobs:
3434
3535
- name: Check for changes
3636
run: |
37-
if ! git diff --exit-code; then
37+
# Find all chart directories that contain Chart.yaml
38+
CHART_DIRS=$(find charts -name "Chart.yaml" -exec dirname {} \;)
39+
40+
if [ -z "$CHART_DIRS" ]; then
41+
echo "No Helm charts found in charts/ directory"
42+
exit 0
43+
fi
44+
45+
CHANGES_FOUND=false
46+
47+
for CHART_DIR in $CHART_DIRS; do
48+
echo "Checking documentation in $CHART_DIR..."
49+
50+
# Check if README.md exists and has changes
51+
if [ -f "$CHART_DIR/README.md" ]; then
52+
if ! git diff --exit-code "$CHART_DIR/README.md" > /dev/null 2>&1; then
53+
echo "❌ Documentation is out of date in $CHART_DIR"
54+
CHANGES_FOUND=true
55+
else
56+
echo "✅ Documentation is up to date in $CHART_DIR"
57+
fi
58+
else
59+
echo "⚠️ No README.md found in $CHART_DIR - this might be expected if it's a new chart"
60+
fi
61+
done
62+
63+
if [ "$CHANGES_FOUND" = true ]; then
64+
echo ""
3865
echo "❌ Helm documentation is out of date!"
3966
echo "Please run 'helm-docs' locally and commit the changes."
4067
echo ""
@@ -47,5 +74,6 @@ jobs:
4774
echo " git commit -m 'Update helm docs'"
4875
exit 1
4976
else
50-
echo "✅ Helm documentation is up to date!"
77+
echo ""
78+
echo "✅ All Helm documentation is up to date!"
5179
fi

0 commit comments

Comments
 (0)