From cdc47d5058e5e9c66a837e9cc201083f432fe4e1 Mon Sep 17 00:00:00 2001 From: g_it Date: Wed, 8 Apr 2026 12:03:26 +0200 Subject: [PATCH] Use raw vale commands rather. --- .github/workflows/lint.yml | 80 ++++++++++---------------------------- 1 file changed, 20 insertions(+), 60 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index aff3c94..205c303 100755 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,30 +9,12 @@ jobs: name: runner / vale runs-on: ubuntu-latest steps: - # DEBUG SECTION - Add these steps AFTER checkout but BEFORE vale-action - - name: 🔍 Debug environment variables - run: | - echo "## FORGEJO ENVIRONMENT VARIABLES" - echo "FORGEJO_SERVER_URL: $FORGEJO_SERVER_URL" - echo "FORGEJO_REPOSITORY: $FORGEJO_REPOSITORY" - echo "FORGEJO_REPOSITORY_OWNER: $FORGEJO_REPOSITORY_OWNER" - echo "FORGEJO_REPOSITORY_NAME: $FORGEJO_REPOSITORY_NAME" - echo "FORGEJO_WORKSPACE: $FORGEJO_WORKSPACE" - echo "" - echo "## GITHUB-COMPATIBLE VARIABLES" - echo "GITHUB_SERVER_URL: $GITHUB_SERVER_URL" - echo "GITHUB_REPOSITORY: $GITHUB_REPOSITORY" - echo "" - echo "## GENERATED REPO URL" - echo "Repository URL: $FORGEJO_SERVER_URL/$FORGEJO_REPOSITORY.git" - echo "" - - 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 + - name: Check working directory structure run: | echo "## CURRENT DIRECTORY CONTENTS" pwd @@ -41,49 +23,27 @@ jobs: echo "## GIT REMOTE CONFIGURATION" git remote -v - # Original Vale action step - # - uses: https://github.com/vale-cli/vale-action@v2 - # with: - # fail_on_error: true - # files: . - - - name: Install and run Vale (direct) + - name: Install and run Vale run: | # Install Vale (same binary the action uses) 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" - # sanity - echo "=== PWD ==="; pwd - - # show config - echo "=== .vale.ini ==="; sed -n '1,200p' .vale.ini || echo "No .vale.ini found" - - # list markdown files - echo "=== Markdown files (first 100) ===" - find content -name '*.md' -print | sed -n '1,100p' || true - - # sync packages into StylesPath - echo "=== vale sync ==="; vale sync - - # list installed style files - echo "=== .vale contents ==="; ls -la .vale || true - find .vale -type f -maxdepth 6 -print | sed -n '1,200p' || true - - # show vale version and debug one known file (reveals loaded config, styles, rules) - echo "=== vale --version & debug content/index.md ===" - vale --version - vale --debug content/index.md || true - - # lint each markdown file one-by-one so nothing is filtered - echo "=== Per-file JSON + line output ===" - find content -name '*.md' -print0 | xargs -0 -n1 -I{} sh -c ' - echo "----- {} -----"; - vale --output=JSON "{}" || true; - vale --output=line "{}" || true; - ' - - # also run aggregated recursive run as a final check - echo "=== Recursive run (all content) ===" - vale --output=JSON content/ || true - vale --output=line content/ || true + if command -v vale &>/dev/null && [[ -f ".vale.ini" ]]; then + echo "Running Vale on all Markdown files..." + 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 + done + echo "Vale check completed successfully." + else + echo "Vale not installed or .vale.ini missing. Skipping Vale." + fi