From 0bef932442961de5d97e7966c65cad350687e32c Mon Sep 17 00:00:00 2001 From: David Stone Date: Tue, 10 Feb 2026 10:27:42 -0700 Subject: [PATCH] fix: filter missing addon plugins in e2e workflow wp-env setup The .wp-env.json includes addon paths (e.g. domain-seller) that only exist in the local monorepo but not in CI where only the core plugin is checked out. This caused wp-env start to fail with "plugin could not be found". Now the override step checks each plugin path exists before including it. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/e2e.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 0d0f0bc2..7a043d54 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -56,9 +56,25 @@ jobs: - name: Install Composer dependencies run: composer install - - name: Set PHP version for wp-env + - name: Set PHP version and filter missing plugins for wp-env run: | - echo "{\"config\": {\"phpVersion\": \"${{ matrix.php }}\"}}" > .wp-env.override.json + node -e " + const fs = require('fs'); + const path = require('path'); + const config = JSON.parse(fs.readFileSync('.wp-env.json', 'utf8')); + const override = { config: { phpVersion: '${{ matrix.php }}' }, env: {} }; + for (const [envName, envConfig] of Object.entries(config.env || {})) { + if (envConfig.plugins) { + const existing = envConfig.plugins.filter(p => { + const resolved = path.resolve(p); + return fs.existsSync(resolved); + }); + override.env[envName] = { plugins: existing }; + } + } + fs.writeFileSync('.wp-env.override.json', JSON.stringify(override, null, 2)); + console.log('Override:', JSON.stringify(override, null, 2)); + " - name: Start WordPress Test Environment run: npm run env:start:test