parent
e101cb0af6
commit
b76d18f454
1 changed files with 18 additions and 11 deletions
31
.github/workflows/lint.yml
vendored
31
.github/workflows/lint.yml
vendored
|
|
@ -25,25 +25,32 @@ jobs:
|
||||||
|
|
||||||
- name: Install and run Vale
|
- name: Install and run Vale
|
||||||
run: |
|
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
|
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"
|
export PATH="/tmp:$PATH"
|
||||||
|
|
||||||
if command -v vale &>/dev/null && [[ -f ".vale.ini" ]]; then
|
if command -v vale &>/dev/null && [[ -f ".vale.ini" ]]; then
|
||||||
echo "Running Vale on all Markdown files..."
|
echo "Running Vale on all Markdown files..."
|
||||||
|
FAILED=0
|
||||||
find . -type f -name "*.md" | while read -r file; do
|
find . -type f -name "*.md" | while read -r file; do
|
||||||
echo "Checking $file"
|
echo "Checking $file"
|
||||||
vale_output=$(vale "$file" 2>&1)
|
vale_output=$(vale "$file" 2>&1)
|
||||||
VALE_EXIT_CODE=$?
|
VALE_EXIT_CODE=$?
|
||||||
if [ $VALE_EXIT_CODE -ne 0 ]; then
|
if [ $VALE_EXIT_CODE -ne 0 ]; then
|
||||||
echo "Vale found issues in $file. Exiting with code $VALE_EXIT_CODE"
|
echo "Vale found issues in $file:"
|
||||||
echo "$vale_output"
|
echo "$vale_output"
|
||||||
exit $VALE_EXIT_CODE
|
FAILED=1
|
||||||
else
|
else
|
||||||
echo "Vale check passed for $file"
|
echo "Vale check passed for $file"
|
||||||
fi
|
fi
|
||||||
done
|
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
|
else
|
||||||
echo "Vale not installed or .vale.ini missing. Skipping Vale."
|
echo "Vale not installed or .vale.ini missing. Skipping Vale."
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue