Skip to content

Repair wp/6.1 branch Actions: Disable npm caching in release workflows - #472

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

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

Conversation

@desrosj

@desrosj desrosj commented Sep 22, 2026

Copy link
Copy Markdown
Owner

Part of the wp/6.1 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 (3 steps), and removes the build job's cache: npm.

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

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 #461 September 22, 2026 19:36
@desrosj
desrosj removed this pull request from stack #461 September 22, 2026 20:36
@desrosj
desrosj changed the base branch from fix-actions-6.1/fix-reflection-getstaticpropertyvalue-php7 to wp/6.1 September 22, 2026 20:37
@desrosj
desrosj force-pushed the fix-actions-6.1/disable-cache-for-release-builds branch from 253264e to 1f2e141 Compare September 22, 2026 20:38
@desrosj
desrosj changed the base branch from wp/6.1 to fix-actions-6.1/remove-rn-workflows September 22, 2026 20:43
@desrosj
desrosj added this pull request to stack #479 September 22, 2026 20:43
@desrosj
desrosj removed this pull request from stack #479 September 23, 2026 01:32
@desrosj
desrosj changed the base branch from fix-actions-6.1/remove-rn-workflows to wp/6.1 September 23, 2026 01:32
@desrosj
desrosj changed the base branch from wp/6.1 to fix-actions-6.1/remove-rn-workflows September 23, 2026 01:47
@desrosj
desrosj added this pull request to stack #488 September 23, 2026 01:47
@desrosj
desrosj removed this pull request from stack #488 September 23, 2026 21:32
@desrosj
desrosj changed the base branch from fix-actions-6.1/remove-rn-workflows to wp/6.1 September 23, 2026 21:32
@desrosj
desrosj changed the base branch from wp/6.1 to fix-actions-6.1/remove-rn-workflows September 23, 2026 21:35
@desrosj
desrosj added this pull request to stack #506 September 23, 2026 21:36
@desrosj
desrosj removed this pull request from stack #506 September 24, 2026 18:16
@desrosj
desrosj added this pull request to stack #520 September 24, 2026 18:17
@desrosj
desrosj removed this pull request from stack #520 September 28, 2026 14:34
@desrosj
desrosj added this pull request to stack #541 September 28, 2026 14:36
@desrosj
desrosj removed this pull request from stack #541 September 28, 2026 19:09
@desrosj
desrosj added this pull request to stack #568 September 28, 2026 19:10
@desrosj
desrosj removed this pull request from stack #568 September 29, 2026 00:26
@desrosj
desrosj changed the base branch from fix-actions-6.1/remove-rn-workflows to wp/6.1 September 29, 2026 00:26
@desrosj
desrosj changed the base branch from wp/6.1 to fix-actions-6.1/remove-rn-workflows September 29, 2026 00:27
@desrosj
desrosj added this pull request to stack #574 September 29, 2026 00:28
@desrosj
desrosj removed this pull request from stack #574 October 5, 2026 20:48
@desrosj
desrosj added this pull request to stack #611 October 5, 2026 20:48
@desrosj
desrosj removed this pull request from stack #611 October 6, 2026 14:20
@desrosj
desrosj added this pull request to stack #621 October 6, 2026 14:21
`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 #621 October 7, 2026 18:02
@desrosj
desrosj changed the base branch from fix-actions-6.1/remove-rn-workflows to wp/6.1 October 7, 2026 18:02
@desrosj
desrosj force-pushed the fix-actions-6.1/disable-cache-for-release-builds branch from 1f2e141 to 5ea32a3 Compare October 7, 2026 18:04
@desrosj
desrosj changed the base branch from wp/6.1 to fix-actions-6.1/remove-rn-workflows October 7, 2026 18:05
@desrosj
desrosj added this pull request to stack #667 October 7, 2026 18:05
@desrosj
desrosj marked this pull request as ready for review October 8, 2026 03:24
@github-actions

github-actions Bot commented Oct 8, 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>

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

@desrosj

desrosj commented Oct 8, 2026

Copy link
Copy Markdown
Owner Author

Moved to WordPress#84241.

@desrosj desrosj closed this Oct 8, 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