site/.github/workflows/lint.yml
g_it cb205c88df
All checks were successful
lint / runner / vale (push) Successful in 16s
Runner debug 26.
2026-04-08 01:22:50 +02:00

89 lines
3.9 KiB
YAML
Executable file

name: lint
on:
push:
branches:
- main
jobs:
vale:
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
run: |
echo "## CURRENT DIRECTORY CONTENTS"
pwd
ls -la
echo ""
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)
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