53 lines
2 KiB
YAML
53 lines
2 KiB
YAML
name: vale
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
vale:
|
|
name: runner / vale
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
run: |
|
|
git clone --depth 1 https://token:${{ secrets.ACTIONS_TOKEN }}@gugulet.hu/technical/git/g_it/site.git .
|
|
cd site || true
|
|
|
|
- name: Check working directory structure
|
|
run: |
|
|
echo "## CURRENT DIRECTORY CONTENTS"
|
|
pwd
|
|
ls -la
|
|
echo ""
|
|
echo "## GIT REMOTE CONFIGURATION"
|
|
git remote -v
|
|
|
|
- name: Install and run Vale
|
|
run: |
|
|
# 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
|
|
|
|
while IFS= read -r file; do
|
|
echo "Checking $file"
|
|
if ! vale "$file"; then
|
|
echo "Vale found issues in $file"
|
|
FAILED=1
|
|
else
|
|
echo "Vale check passed for $file"
|
|
fi
|
|
done < <(find . -type f -name "*.md")
|
|
|
|
if [ $FAILED -eq 1 ]; then
|
|
echo "Vale check failed. See output above."
|
|
exit 1
|
|
fi
|
|
echo "Vale check completed successfully."
|
|
else
|
|
echo "Vale not installed or .vale.ini missing. Skipping Vale."
|
|
fi
|