Fix Plugin Check workflow to use @wordpress/env for wp-env lifecycle - #40
Closed
mustafauysal with Copilot wants to merge 2 commits into
Closed
Fix Plugin Check workflow to use @wordpress/env for wp-env lifecycle#40mustafauysal with Copilot wants to merge 2 commits into
@wordpress/env for wp-env lifecycle#40mustafauysal with Copilot wants to merge 2 commits into
Conversation
Copilot
AI
changed the title
[WIP] Fix npm error in Plugin Check workflow
Fix Plugin Check workflow to use Jun 4, 2026
@wordpress/env for wp-env lifecycle
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.
The PR’s Plugin Check job was still failing because workflow steps invoked
npx wp-env, which makes npm resolve a non-existentwp-envpackage. This update switches those lifecycle commands to the correct CLI package so CI can start/stop the WordPress environment reliably.Workflow command correction
@wordpress/envin.github/workflows/plugin-check.yml.Scope
Original prompt
The open pull request for repository
HandyPlugins/security-txt-managerattempted to fix the failingPlugin CheckGitHub Actions workflow, but the workflow is still failing.Latest failing run:
.github/workflows/plugin-check.yml8bbc804765dda969a5881d6f4860f9215c177392Current failure from logs:
npm error 404 Not Found - GET https://registry.npmjs.org/wp-env - Not foundnpm error 404 'wp-env@*' is not in this registry.Current workflow state:
Start WordPress environmentrun: npx wp-env startrun: npx wp-env stopRoot cause:
wp-envis incorrect on npm.@wordpress/env, sonpx wp-env startcauses npm to try resolving a nonexistentwp-envpackage.Please update the existing PR branch with the minimal safe fix so the workflow uses the correct package/command. Focus on the workflow file only.
Implementation guidance:
.github/workflows/plugin-check.yml.npx @wordpress/env startor another equivalent invocation that works in CI.npx @wordpress/env stop.Acceptance criteria:
wp-envnpm package.The following is the prior conversation context from the user's chat exploration (may be truncated):
User: Please find a solution for this failing job. Use the logs, job definition, and any referenced files where the failure occurred. Keep your response focused on the solution and include code suggestions when appropriate.
Assistant: The failure is caused by the job invoking a WordPress environment check without first starting the environment:
Environment not initialized. Run \wp-env start` first.`.github/workflows/plugin-check.ymlFix
Initialize
wp-envbefore theRun Plugin Checkstep.Suggested workflow change
Update
.github/workflows/plugin-check.ymlto add a setup step before line 40:Why this fixes it
The action at
.github/workflows/plugin-check.yml#L40-L45runs in an environment that expectswp-envto already be running. Right now, the workflow installs dependencies and builds assets, but never starts WordPress.Optional hardening
To avoid leftover containers and make failures easier to debug, you can wrap cleanup with
if: always():