sonarsource/S3 Cache action

Cache files on S3 with branch-specific paths for granular permissions

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Stale
License
None
namedescriptionrequireddefault
pathA list of files, directories, and wildcard patterns to cache and restoreyes
keyAn explicit key for restoring and saving the cacheyes
restore-keysAn ordered list of prefix-matched keys to use for restoring stale cache if no cache hit occurred for key
upload-chunk-sizeThe chunk size used to split up large files during upload, in bytes
enableCrossOsArchiveWhen enabled, allows to save or restore caches that can be restored or saved respectively on other platformsfalse
fail-on-cache-missFail the workflow if cache entry is not foundfalse
lookup-onlyCheck if a cache entry exists for the given input(s) (key, restore-keys) without downloading the cachefalse
environmentEnvironment to use ('dev' or 'prod', 's3' backend only).prod
fallback-branchExplicit fallback branch for restore keys (pattern 'branch-*', 's3' backend only). Always honoured when set, regardless of 'fallback-to-default-branch'. If not set, the repository default branch is used when 'fallback-to-default-branch' is true.
fallback-to-default-branchWhen enabled, automatically adds a fallback restore key pointing to the default branch cache. Only applies to the S3 backend. true
backendForce cache backend ('github' or 's3'). If not set, falls back to the CACHE_BACKEND environment variable if defined, then automatically determined based on repository visibility.
import-github-cacheImport GitHub cache to S3 when no S3 cache exists (migration mode). Enabled by default when using S3 backend. Set to 'false' to disable, or control via the CACHE_IMPORT_GITHUB environment variable. ""
namedescription
cache-hitA boolean value to indicate an exact match was found for the primary key
cache-matched-keyThe cache key for which a match was found. Equals the primary key on an exact hit, one of the user-provided restore keys on a partial hit, or empty when no match was found.
restore-key-hitThe restore key that was prefix-matched. Populated only when `cache-hit` is `false` AND a restore key matched (partial hit). Empty on exact hits and on full misses — i.e. set if this was a partial restore.
backendThe cache backend that was actually used for this invocation (`github` or `s3`).
cache-size-bytesTotal size in bytes of the cached path(s) at restore-time. Requires GNU du (Linux); empty on other platforms. The action also writes a per-invocation JSON record to /tmp/ci-metrics/cache-${step}.json for the pipeline-runtime-metrics job-completed hook to ingest. The JSON record is written on all platforms; only the size fields are null on non-Linux.