diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 205c303..0333860 100755 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -25,25 +25,32 @@ jobs: - name: Install and run Vale run: | - # Install Vale (same binary the action uses) + # Install Vale wget -qO- https://github.com/errata-ai/vale/releases/download/v3.14.1/vale_3.14.1_Linux_64-bit.tar.gz | tar xz -C /tmp export PATH="/tmp:$PATH" if command -v vale &>/dev/null && [[ -f ".vale.ini" ]]; then echo "Running Vale on all Markdown files..." + FAILED=0 find . -type f -name "*.md" | while read -r file; do - echo "Checking $file" - vale_output=$(vale "$file" 2>&1) - VALE_EXIT_CODE=$? - if [ $VALE_EXIT_CODE -ne 0 ]; then - echo "Vale found issues in $file. Exiting with code $VALE_EXIT_CODE" - echo "$vale_output" - exit $VALE_EXIT_CODE - else - echo "Vale check passed for $file" - fi + echo "Checking $file" + vale_output=$(vale "$file" 2>&1) + VALE_EXIT_CODE=$? + if [ $VALE_EXIT_CODE -ne 0 ]; then + echo "Vale found issues in $file:" + echo "$vale_output" + FAILED=1 + else + echo "Vale check passed for $file" + fi done - echo "Vale check completed successfully." + + if [ $FAILED -eq 1 ]; then + echo "Vale check failed. See output above." + exit 1 + else + echo "Vale check completed successfully." + fi else echo "Vale not installed or .vale.ini missing. Skipping Vale." fi