Skip to main content

GHA Cache Auditor icon

GHA Cache Auditor

PyPI version Python versions CI License

GHA Cache Auditor statically checks GitHub Actions workflows for cache keys and restore prefixes that may reuse incompatible files. It does not run workflows, access GitHub, or modify your repository.

Install

Python 3.11 or newer is required.

uv tool install gha-cache-auditor

Or install it into the active Python environment:

python -m pip install gha-cache-auditor

Quick start

Run the auditor from the repository root:

gha-cache-audit .

For example, this cache key hashes the lockfile but does not distinguish Node.js versions in the matrix:

jobs:
  test:
    strategy:
      matrix:
        node: [22, 24]
    steps:
      - uses: actions/setup-node@v6
        with:
          node-version: ${{ matrix.node }}
      - uses: actions/cache@v4
        with:
          path: node_modules
          key: deps-${{ hashFiles('package-lock.json') }}

The auditor reports that matrix.node is missing from the cache identity. A safer key for this example is:

key: deps-${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('package-lock.json') }}

What it checks

  • GHA-CACHE-001: installed dependencies shared across runtimes or architectures.
  • GHA-CACHE-002: installed dependencies shared across operating systems or missing an explicitly configured artifact input.
  • GHA-CACHE-003: installed dependencies whose key does not hash the local lockfile or requirements file.
  • GHA-CACHE-004: build outputs whose key omits relevant source or configuration inputs.
  • GHA-CACHE-005: restore prefixes that omit runtime or platform dimensions used by the primary key.

The default minimum confidence is high. Use --min-confidence medium to include medium-confidence findings. Choose text, JSON, or SARIF output with --format text, --format json, or --format sarif.

GitHub Action

Use a release tag in your workflow:

steps:
  - uses: actions/checkout@v5
  - uses: 0then0/gha-cache-audit@vX.Y.Z
    with:
      format: sarif
      min-confidence: high

Replace vX.Y.Z with a published release tag. The Action returns a nonzero status when it finds an issue. Its report output points to the generated report file, which can be uploaded in a following step.

Documentation

Licensed under Apache-2.0; see the LICENSE.

Metadata

Release files for gha-cache-auditor 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gha-cache-auditor 0.1.6
File Size Uploaded Provenance Actions
gha_cache_auditor-0.1.6.tar.gz 35.5 kB With provenance Details for gha_cache_auditor-0.1.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gha-cache-auditor 0.1.6
File Interpreter ABI Platform Actions
gha_cache_auditor-0.1.6-py3-none-any.whl Python 3 none any Details for gha_cache_auditor-0.1.6-py3-none-any.whl

Total release size: 60.9 kB

Release files / gha_cache_auditor-0.1.6.tar.gz

Download URL gha_cache_auditor-0.1.6.tar.gz
Size 35.5 kB
Tags Source
SHA-256 checksum
How to use checksums
cc5508466dff269ef1f7f43c84d8c6d365a09cb714ecab41c35d3d157f059ecd
BLAKE2b-256 checksum
How to use checksums
8d3851b58e282959cee09615be8758f5b6d96e3798a9c46386ff511bd4ada44d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / gha_cache_auditor-0.1.6-py3-none-any.whl

Download URL gha_cache_auditor-0.1.6-py3-none-any.whl
Size 25.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
88c6572a942077e52b6327c73f5488de880b26726c30370597d9db3854a57c78
BLAKE2b-256 checksum
How to use checksums
19613047aeaca8a9f6997623c4bf8832d64207e8e0540b60b99c59d5a01fcd7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Security for gha-cache-auditor 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for gha_cache_auditor-0.1.6.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page