Skip to content

PR Validation

PR Validation #38

Workflow file for this run

name: "PR Validation"
on:
pull_request:
paths:
- "docs/**"
- "package.json"
- "package-lock.json"
- ".github/workflows/pr-validation.yml"
workflow_dispatch:
jobs:
validate:
name: "Content & Build Validation"
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ["lts/*"]
steps:
- name: "Checkout code"
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: "Setup Node.js"
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: "Install dependencies"
run: npm ci
- name: "� Write translations"
run: npm run write-translations
continue-on-error: false
- name: "📥 Download translations from Crowdin"
run: npm run crowdin download
env:
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
continue-on-error: true
- name: "�📋 Validate Frontmatter & Titles"
run: node scripts/validate-content.js
continue-on-error: false
- name: "🏗️ Build Website"
shell: bash
run: |
set -o pipefail
npm run build 2>&1 | tee build.log
WARNINGS=$(grep -E "^\[WARNING\]" build.log || true)
if [ -n "$WARNINGS" ]; then
WARNING_DETAILS=$(awk 'BEGIN {capture=0} /^\[WARNING\]/{capture=1} capture && /^\[[^]]+\]/ && $0 !~ /^\[WARNING\]/{exit} capture {print}' build.log)
echo "## Build warnings" >> "$GITHUB_STEP_SUMMARY"
echo "Detected build warnings and related output:" >> "$GITHUB_STEP_SUMMARY"
echo '```text' >> "$GITHUB_STEP_SUMMARY"
echo "$WARNING_DETAILS" >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
while IFS= read -r line; do
echo "::warning title=Build warning::$line"
done <<< "$WARNINGS"
fi
continue-on-error: false
- name: "✅ All checks passed"
if: success()
run: |
echo "✨ Alle Validierungen erfolgreich!"
echo "- ✅ Frontmatter validiert"
echo "- ✅ Titel validiert"
echo "- ✅ Build erfolgreich"