Skip to content

chore(deps): resolve esbuild GHSA-67mh-4wv8-2f99 via electron-vite 5 + in-range dep sweep; docs accuracy pass #247

chore(deps): resolve esbuild GHSA-67mh-4wv8-2f99 via electron-vite 5 + in-range dep sweep; docs accuracy pass

chore(deps): resolve esbuild GHSA-67mh-4wv8-2f99 via electron-vite 5 + in-range dep sweep; docs accuracy pass #247

name: Theme Validation
on:
pull_request:
push:
branches: [main]
jobs:
check-paths:
runs-on: ubuntu-latest
outputs:
should-validate: ${{ steps.filter.outputs.themes }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
themes:
- 'themes/**'
- 'plugins/**'
validate:
needs: check-paths
if: needs.check-paths.outputs.should-validate == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: composer
- name: Install PHPCS & WordPress Standards
run: |
composer install --no-interaction --prefer-dist
./vendor/bin/phpcs -i
- name: Security Scan
run: |
chmod +x scripts/wordpress/security-scan.sh
ERRORS=0
for theme_dir in themes/*/; do
if [ -d "$theme_dir" ]; then
theme_name=$(basename "$theme_dir")
echo "=== Security scan: $theme_name ==="
find "$theme_dir" -name "*.php" | while read -r f; do
echo "{\"tool_input\":{\"file_path\":\"$f\"}}" | ./scripts/wordpress/security-scan.sh 2>&1 || ERRORS=$((ERRORS + 1))
done
fi
done
exit $ERRORS
- name: WordPress Coding Standards
run: |
for theme_dir in themes/*/; do
if [ -d "$theme_dir" ]; then
theme_name=$(basename "$theme_dir")
echo "=== PHPCS: $theme_name ==="
./vendor/bin/phpcs --standard=WordPress --severity=5 --report=summary "$theme_dir" || true
fi
done
- name: Block Markup Validation
run: |
chmod +x scripts/block-markup-validator/validate-block-markup.sh 2>/dev/null || true
for theme_dir in themes/*/; do
if [ -d "$theme_dir" ]; then
theme_name=$(basename "$theme_dir")
echo "=== Block markup: $theme_name ==="
find "$theme_dir" \( -path "*/templates/*.html" -o -path "*/parts/*.html" \) | while read -r f; do
echo "{\"tool_input\":{\"file_path\":\"$f\"}}" | ./scripts/block-markup-validator/validate-block-markup.sh 2>&1 || true
done
fi
done
- name: Token Compliance
run: |
chmod +x scripts/theme-token-auditor/audit-tokens.sh 2>/dev/null || true
for theme_dir in themes/*/; do
if [ -d "$theme_dir" ]; then
theme_name=$(basename "$theme_dir")
echo "=== Token audit: $theme_name ==="
find "$theme_dir" \( -name "*.php" -o -name "*.css" \) | while read -r f; do
echo "{\"tool_input\":{\"file_path\":\"$f\"}}" | ./scripts/theme-token-auditor/audit-tokens.sh 2>&1 || true
done
fi
done
- name: Required Files Check
run: |
EXIT=0
for theme_dir in themes/*/; do
if [ -d "$theme_dir" ]; then
theme_name=$(basename "$theme_dir")
echo "=== Required files: $theme_name ==="
[ -f "$theme_dir/style.css" ] && echo " style.css: OK" || { echo " style.css: MISSING"; EXIT=1; }
[ -f "$theme_dir/theme.json" ] && echo " theme.json: OK" || { echo " theme.json: MISSING"; EXIT=1; }
[ -f "$theme_dir/templates/index.html" ] && echo " templates/index.html: OK" || { echo " templates/index.html: MISSING"; EXIT=1; }
fi
done
exit $EXIT
- name: Pattern Architecture Check
run: |
for theme_dir in themes/*/; do
if [ -d "$theme_dir/templates" ]; then
theme_name=$(basename "$theme_dir")
echo "=== Pattern architecture: $theme_name ==="
ISSUES=0
find "$theme_dir/templates" -name "*.html" | while read -r f; do
if grep -q '<img' "$f" 2>/dev/null; then
echo " WARNING: Inline <img> in $(basename "$f") (should be in PHP pattern)"
ISSUES=$((ISSUES + 1))
fi
done
[ $ISSUES -eq 0 ] && echo " All templates follow pattern-first architecture"
fi
done
validation-status:
runs-on: ubuntu-latest
needs: [check-paths, validate]
if: always()
name: Validate WordPress Themes
steps:
- name: Report status
run: |
if [ "${{ needs.check-paths.outputs.should-validate }}" != "true" ]; then
echo "No theme/plugin changes detected — skipping validation"
exit 0
fi
if [ "${{ needs.validate.result }}" = "success" ]; then
echo "Theme validation passed"
exit 0
fi
echo "Theme validation failed"
exit 1