Use raw vale commands rather.
All checks were successful
lint / runner / vale (push) Successful in 6s
All checks were successful
lint / runner / vale (push) Successful in 6s
This commit is contained in:
parent
79925af7d3
commit
cdc47d5058
1 changed files with 20 additions and 60 deletions
80
.github/workflows/lint.yml
vendored
80
.github/workflows/lint.yml
vendored
|
|
@ -9,30 +9,12 @@ jobs:
|
||||||
name: runner / vale
|
name: runner / vale
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
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
|
- name: Checkout repository
|
||||||
run: |
|
run: |
|
||||||
git clone --depth 1 https://token:${{ secrets.ACTIONS_TOKEN }}@gugulet.hu/technical/git/g_it/site.git .
|
git clone --depth 1 https://token:${{ secrets.ACTIONS_TOKEN }}@gugulet.hu/technical/git/g_it/site.git .
|
||||||
cd site || true
|
cd site || true
|
||||||
|
|
||||||
- name: 📁 Check working directory structure
|
- name: Check working directory structure
|
||||||
run: |
|
run: |
|
||||||
echo "## CURRENT DIRECTORY CONTENTS"
|
echo "## CURRENT DIRECTORY CONTENTS"
|
||||||
pwd
|
pwd
|
||||||
|
|
@ -41,49 +23,27 @@ jobs:
|
||||||
echo "## GIT REMOTE CONFIGURATION"
|
echo "## GIT REMOTE CONFIGURATION"
|
||||||
git remote -v
|
git remote -v
|
||||||
|
|
||||||
# Original Vale action step
|
- name: Install and run Vale
|
||||||
# - uses: https://github.com/vale-cli/vale-action@v2
|
|
||||||
# with:
|
|
||||||
# fail_on_error: true
|
|
||||||
# files: .
|
|
||||||
|
|
||||||
- name: Install and run Vale (direct)
|
|
||||||
run: |
|
run: |
|
||||||
# Install Vale (same binary the action uses)
|
# 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
|
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"
|
||||||
|
|
||||||
# sanity
|
if command -v vale &>/dev/null && [[ -f ".vale.ini" ]]; then
|
||||||
echo "=== PWD ==="; pwd
|
echo "Running Vale on all Markdown files..."
|
||||||
|
find . -type f -name "*.md" | while read -r file; do
|
||||||
# show config
|
echo "Checking $file"
|
||||||
echo "=== .vale.ini ==="; sed -n '1,200p' .vale.ini || echo "No .vale.ini found"
|
vale_output=$(vale "$file" 2>&1)
|
||||||
|
VALE_EXIT_CODE=$?
|
||||||
# list markdown files
|
if [ $VALE_EXIT_CODE -ne 0 ]; then
|
||||||
echo "=== Markdown files (first 100) ==="
|
echo "Vale found issues in $file. Exiting with code $VALE_EXIT_CODE"
|
||||||
find content -name '*.md' -print | sed -n '1,100p' || true
|
echo "$vale_output"
|
||||||
|
exit $VALE_EXIT_CODE
|
||||||
# sync packages into StylesPath
|
else
|
||||||
echo "=== vale sync ==="; vale sync
|
echo "Vale check passed for $file"
|
||||||
|
fi
|
||||||
# list installed style files
|
done
|
||||||
echo "=== .vale contents ==="; ls -la .vale || true
|
echo "Vale check completed successfully."
|
||||||
find .vale -type f -maxdepth 6 -print | sed -n '1,200p' || true
|
else
|
||||||
|
echo "Vale not installed or .vale.ini missing. Skipping Vale."
|
||||||
# show vale version and debug one known file (reveals loaded config, styles, rules)
|
fi
|
||||||
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
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue