Debug-action-cache
To debug action cache hits/misses, you typically use the following flags in your command line:
gh api \ -H "Accept: application/vnd.github+json" \ /repos/:owner/:repo/actions/caches
An action cache maps a unique (or action digest) to a specific set of output artifacts. The system computes this key by hashing: The exact command-line string The contents of all input files System environment variables and compiler flags debug-action-cache
The Debug Action Cache offers several benefits, including:
The advantages of using debug-action-cache are numerous: To debug action cache hits/misses, you typically use
Now the cache action prints:
Set ACTIONS_STEP_DEBUG=true . Run the workflow. You might find that previous jobs did not
You might find that previous jobs did not clean up, and the restore step is simply finding a local folder, bypassing the remote cache entirely.
If you suspect the cache is the problem, the first step is to force a "cache miss" to see if a clean slate fixes the build. Key Rotation:
name: Cache Debug
The most effective way to see exactly why a cache is failing (e.g., version mismatches or path errors) is to enable diagnostic logging. This will show detailed logs of the download and upload process for your cached files. Step Debugging : Go to your repository Secrets and variables and add a new secret or variable named ACTIONS_STEP_DEBUG with the value Runner Diagnostic Logging ACTIONS_RUNNER_DEBUG