← English news
Priority 4/5

GitHub Actions Introduces Cache Mode for Job Level Cache Permissions Control

GitHub Actions Introduces Cache Mode for Job Level Cache Permissions Control

GitHub has announced the general availability of cache-mode, a new configuration feature designed to secure the caching mechanism within GitHub Actions. Historically, cache access permissions depended on implicit defaults and specific event types, which could expose workflows to cache pollution. With cache-mode, platform engineers can explicitly limit cache operations by assigning read-only, write-only, read-write, or none permissions per job or workflow.

Primary source

Open GitHub Changelog ↗

This article summarizes the source. Check the original for full details and conditions.

Comparison

AspectBefore / AlternativeAfter / This
Permission granularityImplicitly tied to the event type or workflow default settings across all stepsGranular control via cache-mode at both workflow and individual job levels
Permission optionsStandard read-write or restricted depending on actor permissionsSpecific assignments for read-only, write-only, read-write, or none
Reusable workflowsNo built-in capability to enforce caller-level constraints on cache stepsStrictly limited to the permissions explicitly granted by the caller workflow
Low-trust eventsRisky manual configuration allowed silent write actions on pull requestsAutomatic warnings triggered when writing cache during pull_request_target events

Action Checklist

  1. Evaluate existing workflows for cache-mode compatibility Identify jobs that only require reading or writing to partition their access.
  2. Apply read-only permissions to pull_request_target workflows This prevents malicious or untrusted code modifications from corrupting shared caches.
  3. Configure reusable workflows with restricted caller permissions Verify that downstream templates do not inherit excess cache write access.
  4. Monitor Actions logs for newly introduced cache warning annotations Look specifically for warnings raised by improper write actions on low-trust events.