Validate GitHub Actions cache-mode on low-trust triggers
A workflow that restores dependencies from a cache is making a trust decision, not only a performance decision. GitHub Actions caches are shared by scope, and a later job restores their contents as files on its runner. A cache that a low-trust workflow can write can become an input to a trusted workflow, which is the boundary that makes cache poisoning relevant.
GitHub added cache-mode on 10 September 2026. The setting can apply at the workflow level or to one job. It has four values: read, write, write-only, and none. The useful part is that the cache service enforces the selected capability rather than expecting every cache step to make the right choice. The dangerous part is just as explicit: write and write-only can override the read-only default GitHub applies to low-trust events.