@@ -226,6 +226,27 @@ jobs:
226226 npx wp-env run cli wp core version
227227 echo "WordPress is ready!"
228228
229+ - name : Drop broken third-party apt repos on the runner
230+ run : |
231+ # `playwright install --with-deps` runs apt-get update on the RUNNER
232+ # itself (not inside the wp-env container). GitHub's image ships
233+ # third-party apt sources, and Google's has been serving a
234+ # Packages.gz whose checksum does not match its own Release file:
235+ # E: Failed to fetch .../Packages.gz Hash Sum mismatch
236+ # apt fails the whole update on one bad repo, which takes this step
237+ # down on every matrix leg. Playwright's OS dependencies come from
238+ # Ubuntu's own repos, so these third-party sources are unnecessary
239+ # here and safe to remove. Retrying does not help - the bad index is
240+ # served from Google's CDN, not cached locally.
241+ # Match on content, not filename: the runner image has used more
242+ # than one name/URL form for this source. Scoped to sources.list.d so
243+ # /etc/apt/sources.list (Ubuntu's own repos) can never be removed.
244+ sudo grep -rl 'dl\.google\.com' /etc/apt/sources.list.d/ 2>/dev/null \
245+ | sudo xargs -r rm -fv || true
246+ sudo apt-get clean
247+ sudo rm -rf /var/lib/apt/lists/*
248+ sudo apt-get update
249+
229250 - name : Install Playwright Browsers
230251 run : npx playwright install --with-deps chromium
231252
0 commit comments