Skip to content

Repair wp/7.0 branch Actions: Disable npm caching in release workflows - #83401

Open
desrosj wants to merge 2 commits into
fix-actions-7.0/reference-trunk-workflow-lintfrom
fix-actions-7.0/disable-cache-for-release-builds
Open

desrosj wants to merge 2 commits into
fix-actions-7.0/reference-trunk-workflow-lintfrom
fix-actions-7.0/disable-cache-for-release-builds

Conversation

@desrosj

@desrosj desrosj commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

Part of #82782.

What?

Sets package-manager-cache: false explicitly on every actions/setup-node step in the workflows that build and publish release artifacts on this branch (4 steps).

Workflow Job Step
build-plugin-zip.yml build Use desired version of Node.js
build-plugin-zip.yml npm-publish Setup Node.js
publish-npm-packages.yml release Setup Node.js
publish-npm-packages.yml release Setup Node.js (for WP major version)

It also adds the cache input from 9983882 to .github/setup-node/action.yml. The input defaults to true. When it is false, the action skips the node_modules cache step and its post-install step, and turns off the npm cache. This branch has no setup-npm action, so the npm cache is turned off through the cache option of actions/setup-node instead.

Why?

Cache poisoning is an attack in which a release workflow picks up build state cached by an earlier, less-trusted workflow run. A job that produces a published plugin ZIP or npm package should install from the lockfile every time.

actions/setup-node's package-manager-cache input defaults to true. It currently engages only when package.json declares packageManager (or devEngines.packageManager) naming npm — which this branch does not. That means these jobs are uncached by accident, not by intent: adding that field later would silently switch caching back on in the release path with no visible change to any workflow file. Stating it explicitly removes that dependency on unrelated packaging metadata.

How?

Ports WordPress/gutenberg#79835, "Disable caching when publishing built assets", adapted for this branch. Upstream routes these jobs through the composite .github/setup-node action and threads a new cache input through to .github/setup-npm; this branch has no setup-npm composite and its release jobs call actions/setup-node directly, so the equivalent input is set on each step instead.

The composite .github/setup-node on this branch now has the cache input described above, but none of the release workflows use it: they call actions/setup-node directly, so they are covered by package-manager-cache: false instead. The Storybook check opts out of the composite action's cache in #84179.

Use of AI Tools

This PR was created by Claude Code under my supervision. All code should be treated as AI-produced and not yet reviewed by a human until this PR is marked Ready for Review.

🤖 Generated with Claude Code

@desrosj desrosj added the [Type] Build Tooling Issues or PRs related to build tooling label Sep 22, 2026
@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1b61ebe5-3271-48c3-8ba5-9fd3b33e70e0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@desrosj
desrosj added this pull request to stack #83387 September 22, 2026 19:40
@desrosj
desrosj removed this pull request from stack #83387 September 22, 2026 21:48
@desrosj
desrosj changed the base branch from fix-actions-7.0/guard-setaccessible-php85 to wp/7.0 September 22, 2026 21:48
@desrosj
desrosj force-pushed the fix-actions-7.0/disable-cache-for-release-builds branch from c4160c5 to 69a2c34 Compare September 22, 2026 21:49
@desrosj
desrosj changed the base branch from wp/7.0 to fix-actions-7.0/reference-trunk-workflow-lint September 22, 2026 21:51
@desrosj
desrosj added this pull request to stack #83409 September 22, 2026 21:52
@desrosj
desrosj removed this pull request from stack #83409 September 28, 2026 15:38
@desrosj
desrosj changed the base branch from fix-actions-7.0/reference-trunk-workflow-lint to wp/7.0 September 28, 2026 15:38
@desrosj
desrosj force-pushed the fix-actions-7.0/disable-cache-for-release-builds branch from 69a2c34 to d0f4f9e Compare September 28, 2026 15:43
@desrosj
desrosj changed the base branch from wp/7.0 to fix-actions-7.0/reference-trunk-workflow-lint September 28, 2026 15:43
@desrosj
desrosj added this pull request to stack #83630 September 28, 2026 15:43
@desrosj
desrosj marked this pull request as ready for review September 28, 2026 16:01
@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: desrosj <desrosj@git.wordpress.org>
Co-authored-by: lucatume <lucatume@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@desrosj
desrosj force-pushed the fix-actions-7.0/disable-cache-for-release-builds branch from d0f4f9e to 948921c Compare October 7, 2026 13:42
@desrosj
desrosj removed this pull request from stack #83630 October 7, 2026 18:13
@desrosj
desrosj changed the base branch from fix-actions-7.0/reference-trunk-workflow-lint to wp/7.0 October 7, 2026 18:13
@desrosj
desrosj force-pushed the fix-actions-7.0/disable-cache-for-release-builds branch from 0d22ad1 to 4cc7fd8 Compare October 7, 2026 18:16
@desrosj
desrosj changed the base branch from wp/7.0 to fix-actions-7.0/reference-trunk-workflow-lint October 7, 2026 18:17
@desrosj
desrosj added this pull request to stack #84187 October 7, 2026 18:18
@desrosj
desrosj removed this pull request from stack #84187 October 8, 2026 21:10
@desrosj
desrosj changed the base branch from fix-actions-7.0/reference-trunk-workflow-lint to wp/7.0 October 8, 2026 21:10
@desrosj
desrosj force-pushed the fix-actions-7.0/disable-cache-for-release-builds branch from 4cc7fd8 to 0496760 Compare October 8, 2026 21:12
@desrosj
desrosj changed the base branch from wp/7.0 to fix-actions-7.0/reference-trunk-workflow-lint October 8, 2026 21:13
@desrosj
desrosj added this pull request to stack #84347 October 8, 2026 21:13
@desrosj
desrosj removed this pull request from stack #84347 October 9, 2026 23:27
@desrosj
desrosj changed the base branch from fix-actions-7.0/reference-trunk-workflow-lint to wp/7.0 October 9, 2026 23:27
@desrosj
desrosj force-pushed the fix-actions-7.0/disable-cache-for-release-builds branch from 0496760 to 7e9a935 Compare October 9, 2026 23:28
@desrosj
desrosj changed the base branch from wp/7.0 to fix-actions-7.0/reference-trunk-workflow-lint October 9, 2026 23:30
@desrosj
desrosj added this pull request to stack #84468 October 9, 2026 23:30
@desrosj
desrosj removed this pull request from stack #84468 October 21, 2026 18:35
@desrosj
desrosj added this pull request to stack #85325 October 21, 2026 18:35

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Build Tooling Issues or PRs related to build tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants