Skip to content

Repair wp/6.4 branch Actions: Disable npm caching in release workflows - #469

Closed
desrosj wants to merge 1 commit into
fix-actions-6.4/remove-rn-workflowsfrom
fix-actions-6.4/disable-cache-for-release-builds
Closed

desrosj wants to merge 1 commit into
fix-actions-6.4/remove-rn-workflowsfrom
fix-actions-6.4/disable-cache-for-release-builds

Conversation

@desrosj

@desrosj desrosj commented Sep 22, 2026

Copy link
Copy Markdown
Owner

Part of the wp/6.4 branch Actions repair.

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), and removes the build job's cache: npm.

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)

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 is deliberately left alone: it is only ever called by test and automation workflows, none of which publish a release artifact.

Note: upstream WordPress#79835 is still open at the time of writing.

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 this pull request to stack #458 September 22, 2026 19:35
`actions/setup-node`'s `package-manager-cache` input defaults to `true`,
so caching can switch on implicitly -- it engages as soon as
`package.json` gains a `packageManager` (or `devEngines.packageManager`)
field naming npm. Relying on that field's absence leaves the caching
behaviour of release workflows dependent on unrelated packaging
metadata.

Every `actions/setup-node` step in the workflows that build and publish
release artifacts now sets `package-manager-cache: false` explicitly,
and the `build` job's `cache: npm` is dropped where present.

Cache poisoning is an attack in which a release workflow picks up build
state cached by an earlier, less-trusted run. These jobs now always
install from the lockfile, so a poisoned cache cannot reach a published
plugin ZIP or npm package.

Ports WordPress#79835, "Disable caching when publishing built
assets", adapted: upstream routes these jobs through the composite
`.github/setup-node` action and passes `cache: false`; this branch calls
`actions/setup-node` directly, so the equivalent input is set on each
step instead.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@desrosj
desrosj removed this pull request from stack #458 September 22, 2026 20:15
@desrosj
desrosj changed the base branch from fix-actions-6.4/exclude-firefox-playwright-crash to wp/6.4 September 22, 2026 21:29
@desrosj
desrosj force-pushed the fix-actions-6.4/disable-cache-for-release-builds branch from c260b79 to 7fd47de Compare September 22, 2026 21:30
@desrosj
desrosj changed the base branch from wp/6.4 to fix-actions-6.4/remove-rn-workflows September 22, 2026 21:33
@desrosj
desrosj added this pull request to stack #482 September 22, 2026 21:34
@desrosj
desrosj removed this pull request from stack #482 September 23, 2026 01:30
@desrosj
desrosj changed the base branch from fix-actions-6.4/remove-rn-workflows to wp/6.4 September 23, 2026 01:30
@desrosj
desrosj changed the base branch from wp/6.4 to fix-actions-6.4/remove-rn-workflows September 23, 2026 01:37
@desrosj
desrosj added this pull request to stack #485 September 23, 2026 01:38
@desrosj
desrosj removed this pull request from stack #485 September 24, 2026 04:44
@desrosj
desrosj changed the base branch from fix-actions-6.4/remove-rn-workflows to wp/6.4 September 24, 2026 04:45
@desrosj
desrosj changed the base branch from wp/6.4 to fix-actions-6.4/remove-rn-workflows September 24, 2026 04:47
@desrosj
desrosj added this pull request to stack #508 September 24, 2026 04:48
@desrosj
desrosj removed this pull request from stack #508 September 24, 2026 17:43
@desrosj
desrosj added this pull request to stack #514 September 24, 2026 17:44
@desrosj
desrosj marked this pull request as ready for review September 25, 2026 16:45
@github-actions

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>

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

@desrosj
desrosj removed this pull request from stack #514 September 25, 2026 17:16
@desrosj
desrosj added this pull request to stack #533 September 25, 2026 17:16
@desrosj
desrosj removed this pull request from stack #533 September 28, 2026 15:23
@desrosj
desrosj added this pull request to stack #550 September 28, 2026 15:24
@desrosj
desrosj removed this pull request from stack #550 September 28, 2026 16:24
@desrosj
desrosj added this pull request to stack #555 September 28, 2026 16:25
@desrosj
desrosj removed this pull request from stack #555 September 28, 2026 18:59
@desrosj
desrosj added this pull request to stack #565 September 28, 2026 19:01
@desrosj

desrosj commented Sep 28, 2026

Copy link
Copy Markdown
Owner Author

Moved to WordPress#83668. The branch is left in place.

@desrosj desrosj closed this Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant