block/Gradle Cache
Save and restore Gradle build caches using bundle-cache. Restores a cache bundle before the build and automatically saves it afterward. Uses the GitHub Actions cache by default — no S3 setup required.
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Stale
- License
- None
Inputs
| name | description | required | default |
|---|---|---|---|
| cache-key | Cache key identifying the bundle (e.g. "assembleDebug"). Defaults to the job name so each job gets its own cache automatically. | no | ${{ github.job }} |
| bucket | S3 bucket name. When set, uses S3 instead of the GitHub Actions cache. | no | — |
| region | AWS region for the S3 bucket. | no | us-west-2 |
| key-prefix | Optional path prefix prepended to all S3 object keys. Useful for namespacing objects within a shared bucket. | no | — |
| ref | Git ref used to search for a base bundle. On pull_request restores, the tool walks history from the merge-base of this ref and HEAD. Defaults to the repository's default branch. | no | — |
| branch | Branch name for delta cache support. On pull_request events this is auto-detected from GITHUB_HEAD_REF, so you typically don't need to set it. When active, restore applies a branch delta concurrently with the base bundle, and save-delta runs in the post step instead of a full save. On pushes to the default branch, a full bundle is saved automatically. | no | — |
| project-dir | Path to the Gradle project root. Used for the git history walk and as the working directory for save/restore. Defaults to the repository root. | no | . |
| gradle-user-home | Path to GRADLE_USER_HOME. | no | ~/.gradle |
| included-build | Comma-separated list of included build paths to archive (e.g. "buildSrc,build-logic"). Defaults to buildSrc. | no | — |
| save | Whether to save the cache after the build. Set to "false" to skip. | no | true |
| version | Version of gradle-cache to install (e.g. "v0.3.0"). Defaults to latest. | no | — |
| log-level | Log level: debug, info, warn, or error. | no | info |
| github-token | GitHub token used for cache management (e.g. deleting stale delta entries). Defaults to the automatic GITHUB_TOKEN. | no | ${{ github.token }} |
Outputs
no outputs