site/.github/workflows/lint.yml
g_it aafe8621d3
All checks were successful
lint / runner / vale (push) Successful in 14s
Runner debug 24.
2026-04-08 01:15:48 +02:00

100 lines
4.3 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
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"
# Ensure we are in the repository root
echo "=== PWD ==="
pwd
# Show .vale.ini so we can confirm patterns / BasedOnStyles
echo ""
echo "=== .vale.ini ==="
sed -n '1,200p' .vale.ini || echo "No .vale.ini found"
# Confirm markdown files exist
echo ""
echo "=== Markdown files (first 50) ==="
find content -name '*.md' -print | sed -n '1,50p' || true
# Sync packages into StylesPath (.vale)
echo ""
echo "=== vale sync ==="
vale sync
# List installed style/package files so we can confirm rules are present
echo ""
echo "=== .vale contents ==="
ls -la .vale || true
find .vale -type f -maxdepth 5 -print | sed -n '1,200p' || true
# Vale binary version & debug on one known file (shows which config and styles were loaded)
echo ""
echo "=== vale --version & debug ==="
vale --version
vale --debug content/index.md || true
# Lint each markdown file individually and print JSON + line output so nothing is filtered
echo ""
echo "=== Linting files one-by-one (JSON then line) ==="
find content -name '*.md' -print0 | xargs -0 -n1 -I{} sh -c '
echo "----- {} -----";
vale --output=JSON "{}" || true;
vale --output=line "{}" || true;
'
# Also run a recursive lint in case you prefer aggregated output
echo ""
echo "=== Recursive run (all content) ==="
vale --output=JSON content/ || true
vale --output=line content/ || true