allow saving cache to be optional (#131)

This commit is contained in:
Titus Fortner 2026-01-11 10:30:32 -06:00 committed by GitHub
parent 00e306f4a9
commit be4ac32ff6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 35 additions and 0 deletions

View file

@ -83,6 +83,30 @@ Default `""`.
```
</details>
### `cache-save`
Whether to save caches at the end of the workflow.
Set to `false` for pull requests to allow cache restoration without saving,
which prevents PRs from polluting the cache while still benefiting from it.
Default `true`.
<details>
<summary>Examples</summary>
#### Disable cache saving on pull requests
```yaml
- uses: bazel-contrib/setup-bazel@0.16.0
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true
cache-save: ${{ github.event_name != 'pull_request' }}
```
</details>
### `disk-cache`
Enable [`disk_cache`][2] and store it on GitHub based on contents of `BUILD` files.