gha-cache-proof checks and emulates GitHub Actions cache behavior with receipt-backed local evidence.
It is the cache boundary for offline CI work:
- use
gha-workflow-proofto find cache steps in workflow YAML; - use
gha-cache-proof check-workflowto prove cache keys, restore keys, path globs, cache versions, and store lookup behavior; - use
gha-cache-proof restore/saveinside local runners such asci-forgeto modelactions/cache,actions/cache/restore, andactions/cache/save.
cargo install gha-cache-proof --lockedSave a local cache entry:
gha-cache-proof save `
--store .ci-forge/cache `
--workspace . `
--reference refs/heads/main `
--key Linux-cargo-abc123 `
--path target `
--path ~/.cargo/registryRestore from the current branch, then default branch, using exact and prefix matches:
gha-cache-proof restore `
--store .ci-forge/cache `
--workspace . `
--reference refs/heads/feature `
--default-branch main `
--key Linux-cargo-new `
--restore-key Linux-cargo- `
--path target `
--format json `
--output target/cache-proof.jsonCheck workflow cache steps without mutating the workspace:
gha-cache-proof check-workflow `
--repo . `
--workspace . `
--store .ci-forge/cache `
--workflow .github/workflows/ci.yml `
--format markdownactions/cache,actions/cache/restore, andactions/cache/savestep shape.- Required
keyandpathinputs. - Multiline
restore-keys,pathlists, and glob path expansion. - Cache key length limit.
- Cache version hashing from path list, compression, and cross-OS archive setting.
- Search order: current ref exact/prefix key, current ref restore keys, then base/default branch scopes.
- Exact hit output as
cache-hit=true, partial restore ascache-hit=false, and miss as an empty string. lookup-onlyandfail-on-cache-miss.- Branch/ref cache isolation for current, base, and default refs.
- Local cache-store index under
index.jsonplus copied file snapshots underentries/<id>/files. - Template evaluation for workflow
key,restore-keys, andpathvalues throughgha-expression-proof.
gha-cache-proof is not GitHub's cache service and does not talk to GitHub APIs. It intentionally models the public behavior needed by local runners and compatibility tests:
- no network cache upload or download;
- no cache billing or quota enforcement beyond receipts;
- no tar/zstd archive bit-for-bit compatibility promise;
- no secret scanning of cache contents.
The receipt is the contract: it explains the key, version, accessible scopes, match kind, copied files, and checks.
The 1.0 behavior follows GitHub's public dependency caching reference and the official actions/cache README: