Skip to content

ci: pin @wordpress/env@11.7.0 to fix Plugin Check#181

Closed
abdul-kaioum wants to merge 6 commits into
mainfrom
fix/plugin-check-wp-env-pin
Closed

ci: pin @wordpress/env@11.7.0 to fix Plugin Check#181
abdul-kaioum wants to merge 6 commits into
mainfrom
fix/plugin-check-wp-env-pin

Conversation

@abdul-kaioum

Copy link
Copy Markdown
Member

Problem

Plugin Check has failed on every branch since 2026-06-08.

wordpress/plugin-check-action@v1 force-installs the latest @wordpress/env at runtime (npm -g i @wordpress/env, no pin). @wordpress/env@11.8.0 (2026-06-04) silently exits 0 from wp-env start without bringing up the Docker cli container. So wp plugin check runs against a non-existent environment:

✖ Environment not initialized. Run `wp-env start` first.
service "cli" is not running
No files were found with the provided path: .../plugin-check-results.txt. No artifacts will be uploaded.

The check never runs → no results file → step exits 1 → job red. The action exposes no input to pin the wp-env version, and every action tag (v1.0.7 → v1.1.6) reinstalls latest at runtime, so pinning the action does not help.

Fix

Replace the action with explicit steps that mirror it but pin @wordpress/env@11.7.0 (last release before the regression):

  • build the same .wp-env.json (plugin-check.zip + build-dir mapping)
  • run the identical wp plugin check invocation (same categories/checks/exclude-dirs/--require)
  • gate the job on ERROR rows (WP-CLI plugin check exits 0 even on findings — verified against plugin-check source)
  • upload the results artifact

Optimizations

  • testsEnvironment: false — skip tests-* containers (~half the Docker work)
  • drop wp-env start --update — no forced re-fetch on a fresh runner
  • on: pull_request only — avoid duplicate push+PR runs on merge

Revert path

Restore wordpress/plugin-check-action@v1 once upstream ships a fixed @wordpress/env (> 11.8.0).

🤖 Generated with Claude Code

wordpress/plugin-check-action@v1 force-installs the latest @wordpress/env
at runtime (`npm -g i @wordpress/env`, no pin). @wordpress/env@11.8.0
(2026-06-04) silently exits 0 from `wp-env start` without bringing up the
Docker cli container, so `wp plugin check` runs against a non-existent
environment ("service cli is not running" / "Environment not initialized"),
writes no results file, and the job fails. Broken on all branches since
2026-06-08.

The action exposes no input to pin the wp-env version, so replace it with
explicit steps that mirror the action while pinning @wordpress/env@11.7.0
(last release before the regression):
- build the same .wp-env.json (plugin-check.zip + build-dir mapping)
- run the identical `wp plugin check` invocation (same categories/checks)
- gate the job on ERROR rows (WP-CLI exits 0 even on findings)
- upload the results artifact

Also optimize:
- testsEnvironment:false — skip tests-* containers (~half the Docker work)
- drop `wp-env start --update` — no forced re-fetch on a fresh runner
- run on pull_request only — avoid duplicate push+PR runs on merge

Revert to wordpress/plugin-check-action@v1 once upstream ships a fixed
@wordpress/env.

Assisted-By: AI
@gemini-code-assist

Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

Plugin Check flagged two WordPress.WP.AlternativeFunctions errors in the
image-sideload helper:
- parse_url() -> wp_parse_url() (consistent output across PHP versions)
- @Unlink() -> wp_delete_file() (WordPress file-deletion wrapper)

Assisted-By: AI
Print the findings inside a collapsible log group and write them to the
GitHub Actions job summary (✅ when clean), so results are visible without
digging through the raw log. Strip the cli container's bootstrap notices
and the stray wpdb error banner so the captured JSON stays clean.

Assisted-By: AI
Move the pinned-wp-env Plugin Check logic out of the workflow and into
.github/actions/plugin-check, mirroring wordpress/plugin-check-action@v1's
input interface (build-dir, categories, checks, exclude-directories,
ignore-warnings). The workflow now just references it, so reverting to the
upstream action once the @wordpress/env regression is fixed is a one-line
`uses:` swap with an identical `with:` block.

The action runs the check twice from the live environment: --format=json for
the uploaded artifact and the ERROR gate (reliable), and --format=table for a
readable view in the log group and the job summary.

Assisted-By: AI
WP-CLI `plugin check --format=table` emits tab-separated rows (not an aligned
table) over the wp-env cli container, and the previous summary heuristic
misdetected findings. Run the check once as JSON and render it with a small
PHP formatter that prints an aligned, file-grouped table to the log, writes a
Markdown table to the job summary, and exits non-zero on blocking errors.
Drops the second check run.

Assisted-By: AI
…ifact

WP-CLI `plugin check --format=table` emits tab-separated rows (not an aligned
table) over the wp-env cli container, and the previous summary heuristic
misdetected findings. Run the check once as JSON and render it with a small
PHP formatter that prints an aligned, file-grouped table to the log, writes a
Markdown table to the job summary, and exits non-zero on blocking errors.
Drops the second check run.

Also bump actions/upload-artifact v4 -> v7 to clear the Node.js 20 deprecation
warning (v5+ run on Node.js 24).

Assisted-By: AI
@RishadAlam RishadAlam closed this Jun 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants