Skip to content

Clarify that ACTIONS_CACHE_MODE is not set for run steps - #46906

Open
owtaylor wants to merge 1 commit into
github:mainfrom
owtaylor:clarify-actions-cache-mode-availability
Open

owtaylor wants to merge 1 commit into
github:mainfrom
owtaylor:clarify-actions-cache-mode-availability

Conversation

@owtaylor

Copy link
Copy Markdown

Why:

Closes: N/A

The "Controlling cache access with cache-mode" section says "The runner exposes the effective mode in the ACTIONS_CACHE_MODE environment variable". It's natural to read that as meaning every step can see the variable. But a shell script in a run step sees nothing, even when the job setup log shows Cache mode: read. That makes it look like the feature is broken or not rolled out yet.

In actions/runner, only NodeScriptActionHandler and ContainerActionHandler set ACTIONS_CACHE_MODE in the step environment. JobExtension just logs the mode. The handler for run steps never sets it.

What's being changed (if available, include any code snippets, screenshots, or gifs):

Adds a short note to content/actions/reference/workflows-and-actions/dependency-caching.md, right after the paragraph about ACTIONS_CACHE_MODE:

Note

ACTIONS_CACHE_MODE is only set in the environment of JavaScript and Docker container actions. It is not available to run steps, including run steps in composite actions.

Check off the following:

  • A subject matter expert (SME) has reviewed the technical accuracy of the content in this PR. In most cases, the author can be the SME. Open source contributions may require an SME review from GitHub staff.
  • The changes in this PR meet the docs fundamentals that are required for all content.
  • All CI checks are passing and the changes look good in the review environment.

🤖 Generated with Claude Code

The runner only exports ACTIONS_CACHE_MODE from NodeScriptActionHandler
and ContainerActionHandler, so shell scripts in run steps can't read the
effective cache mode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings November 10, 2026 18:45
@github-actions github-actions Bot added the triage Do not begin working on this issue until triaged by the team label Nov 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

How to review these changes 👓

Thank you for your contribution. To review these changes, choose one of the following options:

A Hubber will need to deploy your changes internally to review.

Table of review links

Note: Please update the URL for your staging server or codespace.

The table shows the files in the content directory that were changed in this pull request. This helps you review your changes on a staging server. Changes to the data directory are not included in this table.

Source Review Production What Changed
actions/reference/workflows-and-actions/dependency-caching.md fpt
ghec
ghes@ 3.22 3.21 3.20 3.19
fpt
ghec
ghes@ 3.22 3.21 3.20 3.19

Key: fpt: Free, Pro, Team; ghec: GitHub Enterprise Cloud; ghes: GitHub Enterprise Server

🤖 This comment is automatically generated.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

SME confirmation is needed because the note describes runner behavior absent from this checkout and spanning supported product versions, specifically the JavaScript/container versus run-step distinction.

No open issues 🎉

What changed in this PR

Clarifies the scope of the ACTIONS_CACHE_MODE environment variable in the dependency caching reference, explaining that it is unavailable to shell-based run steps.

Changes:

  • Notes that the variable is set only for JavaScript and Docker container actions.
  • Clarifies that run steps, including those in composite actions, cannot access it.
File Description
content/​actions/​reference/​workflows-and-actions/​dependency-caching.md Documents that ACTIONS_CACHE_MODE is available only to JavaScript and Docker container actions, not to run steps.

Review effort: Lite

owtaylor added a commit to rhel-lightspeed/linux-mcp-server that referenced this pull request Nov 10, 2026
The check in 'make requirements-lock' always failed in CI. The runner
only sets ACTIONS_CACHE_MODE for JavaScript and container actions, not
for run: steps, so the Makefile saw it as unset even with workflow-level
cache-mode: read.

The cache-mode: read setting in update-python-requirements.yml is
unchanged and still limits the job's cache token.

Docs clarification proposed upstream: github/docs#46906

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>

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

triage Do not begin working on this issue until triaged by the team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants