GuideInformationCybersecurityIT

Exclude credentials from GitHub Actions dependency caches accessible to pull requests

A dependency cache is a shared workflow optimization and needs a reviewed content boundary.

Integrated video surveillance and controlled entry at a modern commercial facility.
DSE visual intelligencePhysical securityGuide · 2 min read
Executive summary

What you need to know

A dependency cache is a shared workflow optimization and needs a reviewed content boundary.

Potentially affected

This concerns the Actions dependency-cache workflow and its access restrictions. Cache-key naming does not establish a secret-store access model or make sensitive cached files safe to disclose.

DSE recommendation

DSE recommends reviewing every cached path and its generated contents before enabling caching.

A dependency cache is a shared workflow optimization and needs a reviewed content boundary.

Source facts

GitHub warns against storing access tokens, login credentials or other sensitive information in cache paths. People with read access can create pull requests that access cache contents, and fork pull requests can access caches on the base branch. GitHub also states that existing cache contents cannot be changed in place; a new cache requires a new key.

Source: GitHub — Dependency caching reference.

Applicability

This concerns the Actions dependency-cache workflow and its access restrictions. Cache-key naming does not establish a secret-store access model or make sensitive cached files safe to disclose.

DSE recommendation

DSE recommends reviewing every cached path and its generated contents before enabling caching. Keep package downloads separate from credential configuration and build outputs that might contain secrets. Review broad restore-key fallbacks alongside the intended trust boundary. Assign an owner to invalidate or retire unsuitable caches when the build layout changes, and investigate any suspected credential inclusion through the incident process rather than merely choosing a new key. Ask a reviewer to inspect generated files under every cache path, including tool-specific configuration directories. Give cache retirement an explicit owner and treat a suspected exposed credential as a revocation decision, rather than considering a changed cache key sufficient incident containment.

Verification

Proposed verification: in an approved repository, inspect a cache built from harmless test data and confirm only intended dependency files are included. Exercise the supported pull-request access path using a safe sample. Verify credential files are excluded and inspect logs for accidental values before rolling the cache configuration into a privileged workflow.

Official reference

GitHub — Dependency caching reference. Reviewed October 20, 2026.

Primary reference

Review the official source

GitHub — Dependency caching reference · Verified October 20, 2026

Open official reference ↗
Plan the next step

Need help applying this guidance safely?

DSE can help confirm applicability, protect service continuity, and validate the result across physical security and IT systems.

Talk with DSE