| key | An explicit key for restoring and saving the cache | yes | — |
| path | A list of files, directories, and wildcard patterns to cache and restore | yes | — |
| restore-keys | An ordered list of keys to use for restoring stale cache if no cache hit occurred for key. Note `cache-hit` returns false in this case. | no | — |
| fail-on-cache-miss | Fail the workflow if cache entry is not found | no | false |
| lookup-only | Check if a cache entry exists for the given input(s) without downloading the cache | no | false |
| save-always | Run the post step to save the cache even if another step before fails | no | false |
| storage-provider | Storage backend: local, s3, gcs | no | local |
| cache-path | Base path for local cache storage. Default: $XDG_CACHE_HOME/gha-opencache or $HOME/.cache/gha-opencache (Linux), ~/Library/Caches/gha-opencache (macOS), %LOCALAPPDATA%\gha-opencache (Windows). Override with OPENCACHE_PATH env var. | no | — |
| s3-bucket | S3 bucket name (required for s3 provider) | no | — |
| s3-region | S3 region | no | us-east-1 |
| s3-endpoint | Custom S3 endpoint (for MinIO, R2, DigitalOcean Spaces, etc.) | no | — |
| s3-prefix | Key prefix within bucket | no | gha-cache/ |
| s3-force-path-style | Use path-style URLs (required for MinIO) | no | false |
| gcs-bucket | GCS bucket name (required for gcs provider) | no | — |
| gcs-project | GCP project ID (optional, uses default from credentials) | no | — |
| gcs-prefix | Key prefix within bucket | no | gha-cache/ |
| gcs-key-file | Path to service account key JSON file | no | — |
| compression | Compression algorithm: auto, zstd, gzip, or none | no | auto |
| compression-level | Compression level (1-19 for zstd, 1-9 for gzip). Uses optimal defaults if not specified. | no | — |
| ttl-days | Days until cache entries expire (0 = no expiration) | no | 7 |
| max-cache-size-gb | Maximum cache size in GB per repository (0 = unlimited). Uses LRU eviction when exceeded. | no | 10 |