Repository navigation
Conversation
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
Review effort: Lite
Findings: 4
Open (9)
Same issue asci-lint-js.yml: when changed stylesheets are present, this calls `npm run lint:css… · New Same issue asci-lint-js.yml: when changed stylesheets are present, this calls `npm run lint:css… · New When linting only changed files, this appends file paths as arguments toLINT_COMMAND, but the… · New When linting only changed files, this appends file paths as arguments toLINT_COMMAND, but the… · Newactions/setup-nodedocumentsnode-version-fileas a path resolved from the workspace/repo.… · Newactions/setup-nodedocumentsnode-version-fileas a path resolved from the workspace/repo.… · Newactions/setup-nodedocumentsnode-version-fileas a path resolved from the workspace/repo.… · Newactions/setup-nodedocumentsnode-version-fileas a path resolved from the workspace/repo.… · New The same multi-line ‘Resolve Node.js version’ step is duplicated across several workflows in this… · New
What changed in this PR
This PR enhances the reusable CI/CD workflows so callers can override leaf-job settings (notably Node/PHP versions and command inputs) while making Node resolution respect project .nvmrc files instead of always forcing Node 22.
Changes:
- Forward additional inputs from
wp-ci.ymlinto leaf workflows (Node/PHP versions, Composer flags, per-job*-commandinputs). - Add consistent Node resolution logic across “leaf” workflows:
node-version→.nvmrcinworking-dir→ repo root.nvmrc→ Node 22. - Update docs (README/AGENTS) to describe the forwarding behavior and GitHub’s empty-string default behavior.
| File | Description |
|---|---|
| README.md | Documents Node resolution and forwarded leaf inputs. |
| AGENTS.md | Captures conventions for forwarding inputs and Node selection behavior. |
| .github/workflows/wp-ci.yml | Adds and forwards many new inputs to leaf workflows. |
| .github/workflows/ci-test-php.yml | Uses .nvmrc-aware Node resolution and step-level string defaults. |
| .github/workflows/ci-test-js.yml | Uses .nvmrc-aware Node resolution and step-level string defaults. |
| .github/workflows/ci-test-build-artifact.yml | Uses .nvmrc-aware Node resolution; step-level defaults for PHP version. |
| .github/workflows/ci-test-a11y.yml | Uses .nvmrc-aware Node resolution and step-level command defaults. |
| .github/workflows/ci-lint-php.yml | Moves string defaults to runtime fallbacks (PHP/Composer/PHPCS/PHPStan). |
| .github/workflows/ci-lint-js.yml | Adds .nvmrc Node resolution; changes “lint changed files” behavior. |
| .github/workflows/ci-lint-css.yml | Adds .nvmrc Node resolution; changes “lint changed files” behavior. |
| .github/workflows/ci-build.yml | Adds .nvmrc Node resolution; moves PHP/Composer defaults to runtime fallbacks. |
| .github/workflows/cd-built-branch.yml | Adds per-target .nvmrc support via node-version-file in the matrix. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if [ -z "$node_version" ]; then | ||
| if [ -s "$dir/.nvmrc" ]; then node_version_file="${dir%/}/.nvmrc" |
| --arg name "$name" --arg dir "$dir" \ | ||
| --arg composer "$composer" --arg node "$node" \ | ||
| --arg php "$php_version" --arg nodever "$node_version" \ | ||
| --arg php "$php_version" --arg nodever "$node_version" --arg nodefile "$node_version_file" \ |
| --arg pp "$publish_abs" --arg vp "$verify_abs" \ | ||
| '{name:$name, dir:$dir, composer:$composer, node:$node, | ||
| "php-version":$php, "node-version":$nodever, | ||
| "php-version":$php, "node-version":$nodever, "node-version-file":$nodefile, |
| node-version: ${{ matrix.node-version }} | ||
| node-version-file: ${{ matrix.node-version-file }} |
| # Node version: the input, else .nvmrc (working-dir, then repo root), else 22. | ||
| - name: Resolve Node.js version | ||
| id: node | ||
| shell: bash | ||
| env: | ||
| NODE_VERSION: ${{ inputs.node-version }} | ||
| WORKING_DIR: ${{ inputs.working-dir }} | ||
| run: | | ||
| set -euo pipefail | ||
| # setup-node reads the file path from the repo root. | ||
| if [ -n "$NODE_VERSION" ]; then | ||
| echo "version=$NODE_VERSION" >> "$GITHUB_OUTPUT" | ||
| elif [ -s .nvmrc ]; then | ||
| echo "file=$WORKING_DIR/.nvmrc" >> "$GITHUB_OUTPUT" | ||
| elif [ -s "$GITHUB_WORKSPACE/.nvmrc" ]; then | ||
| echo "file=.nvmrc" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "version=22" >> "$GITHUB_OUTPUT" | ||
| fi |
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
Review effort: Lite
Findings: 1
Open (7)
The.nvmrcexistence check and the emitted path can disagree: the step tests[ -s .nvmrc ]in… · New The Node resolution block is duplicated across multiple workflows (lint/test/build/a11y/artifact).… · New The same multi-line ‘Resolve Node.js version’ step is duplicated across several workflows in this…actions/setup-nodedocumentsnode-version-fileas a path resolved from the workspace/repo.…actions/setup-nodedocumentsnode-version-fileas a path resolved from the workspace/repo.…actions/setup-nodedocumentsnode-version-fileas a path resolved from the workspace/repo.…actions/setup-nodedocumentsnode-version-fileas a path resolved from the workspace/repo.…
Resolved since last review (4)
When linting only changed files, this appends file paths as arguments toLINT_COMMAND, but the… When linting only changed files, this appends file paths as arguments toLINT_COMMAND, but the… Same issue asci-lint-js.yml: when changed stylesheets are present, this calls `npm run lint:css… Same issue asci-lint-js.yml: when changed stylesheets are present, this calls `npm run lint:css…
| # Node version: the input, else .nvmrc (working-dir, then repo root), else 22. | ||
| - name: Resolve Node.js version | ||
| id: node | ||
| shell: bash | ||
| env: | ||
| NODE_VERSION: ${{ inputs.node-version }} | ||
| WORKING_DIR: ${{ inputs.working-dir }} | ||
| run: | | ||
| set -euo pipefail | ||
| # setup-node reads the file path from the repo root. | ||
| if [ -n "$NODE_VERSION" ]; then | ||
| echo "version=$NODE_VERSION" >> "$GITHUB_OUTPUT" | ||
| elif [ -s .nvmrc ]; then | ||
| echo "file=$WORKING_DIR/.nvmrc" >> "$GITHUB_OUTPUT" | ||
| elif [ -s "$GITHUB_WORKSPACE/.nvmrc" ]; then | ||
| echo "file=.nvmrc" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "version=22" >> "$GITHUB_OUTPUT" | ||
| fi |
| # Node version: the input, else .nvmrc (working-dir, then repo root), else 22. | ||
| - name: Resolve Node.js version | ||
| id: node | ||
| if: ${{ inputs.install-node-deps }} | ||
| shell: bash | ||
| env: | ||
| NODE_VERSION: ${{ inputs.node-version }} | ||
| WORKING_DIR: ${{ inputs.working-dir }} | ||
| run: | | ||
| set -euo pipefail | ||
| # setup-node reads the file path from the repo root. | ||
| if [ -n "$NODE_VERSION" ]; then | ||
| echo "version=$NODE_VERSION" >> "$GITHUB_OUTPUT" | ||
| elif [ -s .nvmrc ]; then | ||
| echo "file=$WORKING_DIR/.nvmrc" >> "$GITHUB_OUTPUT" | ||
| elif [ -s "$GITHUB_WORKSPACE/.nvmrc" ]; then | ||
| echo "file=.nvmrc" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "version=22" >> "$GITHUB_OUTPUT" | ||
| fi |


What this PR does
Lets
wp-ci.ymlcallers configure every job it fans out to (Node/PHP versions, Composer flags, the*-commandinputs), and makes every leaf honor.nvmrcinstead of forcing Node 22.Closes
N/A
Changes
How I verified
Acceptance criteria
Code quality
Housekeeping
CHANGELOG.mdentry under the current version headingexamples/<workflow>.ymladded or updated to match any input changeyamllint,actionlintandbin/check-workflows.shpass locally