Avoid wp-env silent startup failures when loading Plugin Check - #590
Merged
Conversation
Copilot
AI
changed the title
[WIP] Fix environment not initialized error in action
Avoid wp-env silent startup failures when loading Plugin Check
Jun 15, 2026
🔍 WordPress Plugin Check Report
📊 Report
❌ Errors (8)📁 hello.php (7 errors)
📁 readme.txt (1 error)
|
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
72 |
WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound | Functions declared in the global namespace by a theme/plugin should start with the theme/plugin prefix. Found: "dolly_css". |
🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the composite action to avoid wp-env “silent success” startup failures caused by preloading Plugin Check via a remote ZIP URL, and instead installs/activates Plugin Check after the environment is confirmed running.
Changes:
- Removes
https://downloads.wordpress.org/plugin/plugin-check.zipfrom the generated.wp-env.json. - Extends the retry-wrapped
wp-envstartup to immediately verify the environment withwp-env run cli wp cli info. - Installs (or reuses and activates) the
plugin-checkplugin via WP-CLI afterwp-envis up, and adds regression tests validating these behaviors.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
action.yml |
Stops preloading Plugin Check from a URL, adds a post-start verification command, and installs/activates Plugin Check via WP-CLI after boot. |
src/action.test.ts |
Adds regression tests ensuring action.yml no longer references plugin-check.zip and includes the new startup verification command. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ilicfilip
added a commit
to ProgressPlanner/progress-planner
that referenced
this pull request
Aug 14, 2026
Two independent upstream breakages stack in this job: 1. `wp package install` fails with "Your github oauth token for github.com contains invalid characters". The stable WP-CLI phar bundles an old Composer that rejects the current GitHub Actions token format (hyphens) — composer#12076. setup-php exports the token via COMPOSER_AUTH, so pinning setup-php or clearing GITHUB_TOKEN does not help (both were tried in #766 and failed). The nightly phar bundles a Composer with relaxed validation, which fixed this step in #766. 2. The plugin check step then failed with "Environment not initialized. Run `wp-env start` first." plugin-check-action generated a .wp-env.json that loaded plugin-check from a download URL; on newer runner images wp-env exits 0 without initializing. #766 worked around it by pinning @wordpress/env to 11.5.0, which did not work and left that PR blocked. Upstream fixed (2) in plugin-check-action v1.1.7, so no @wordpress/env pin is needed — pinning to 11.5.0 against a fixed action would be counterproductive. v1.1.9 also picks up the v1.1.8 bundle-regression fix. Ref: WordPress/plugin-check-action#590 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ilicfilip
added a commit
to ProgressPlanner/progress-planner
that referenced
this pull request
Aug 14, 2026
…o v1.1.9 Replaces this branch's earlier attempts, all of which were dead ends: setup-php pinning, unsetting GITHUB_TOKEN, the WP-CLI nightly, and the @wordpress/env 11.5.0 pin. Two independent breakages: 1. "Your github oauth token for github.com contains invalid characters". This is INTERMITTENT — setup-php stores the run's ephemeral Actions token in ~/.composer/auth.json as a github-oauth credential, and Composer rejects it only when that particular token contains a character its validator dislikes (composer#12076). Roughly half of runs failed, which is why every previous "fix" appeared to work and then regressed: a single green run proves nothing here. Verified in run 31784727273 that GITHUB_TOKEN and COMPOSER_AUTH are already EMPTY at that point and the credential lives on disk, so clearing env vars cannot help. dist-archive-command is a public package needing no auth, so the fix is to delete the stored credential. Note the WP-CLI nightly used earlier is now actively harmful: it reports as wp-cli 3.0.0-alpha, while every released dist-archive-command requires wp-cli ^2 / ^2.13, so `wp package install` cannot resolve against it. 2. "Environment not initialized. Run `wp-env start` first." — fixed upstream in plugin-check-action v1.1.7 (WordPress/plugin-check-action#590); v1.1.9 also picks up the v1.1.8 bundle-regression fix. Since that landed upstream, the @wordpress/env 11.5.0 pin is dropped rather than carried forward. dist-archive-command stays at v3.1.0: newest release accepting wp-cli ^2. v3.2.x requires ^2.13, which has no stable release (latest is 2.12.0). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
plugin-check-actionwas generating a.wp-env.jsonthat always loadedplugin-checkfrom a download URL. On newer GitHub runner images, that URL-plugin path can causewp-envto exit successfully without actually initializing the environment, leading toEnvironment not initialized. Run \wp-env start` first.` in later steps.Remove the fragile URL-plugin bootstrap path
https://downloads.wordpress.org/plugin/plugin-check.zipto the generated.wp-env.json.Install Plugin Check after wp-env is up
plugin-checkvia WP-CLI afterwp-env start.Fail early if wp-env did not actually start
wp-env run cli wp cli infoimmediately afterwp-env start --update.Add focused regression coverage
plugin-check.zip.