@ -14,6 +14,11 @@ See ["Caching dependencies to speed up workflows"](https://docs.github.com/en/ac
## What's New
## What's New
### v4
* Updated to node 20
* Added a `save-always` flag to save the cache even if a prior step fails
### v3
### v3
* Added support for caching in GHES 3.5+.
* Added support for caching in GHES 3.5+.
@ -90,7 +95,7 @@ jobs:
- name: Cache Primes
- name: Cache Primes
id: cache-primes
id: cache-primes
uses: actions/cache@v3
uses: actions/cache@v4
with:
with:
path: prime-numbers
path: prime-numbers
key: ${{ runner.os }}-primes
key: ${{ runner.os }}-primes
@ -121,7 +126,7 @@ jobs:
- name: Restore cached Primes
- name: Restore cached Primes
id: cache-primes-restore
id: cache-primes-restore
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
with:
path: |
path: |
path/to/dependencies
path/to/dependencies
@ -132,7 +137,7 @@ jobs:
.
.
- name: Save Primes
- name: Save Primes
id: cache-primes-save
id: cache-primes-save
uses: actions/cache/save@v3
uses: actions/cache/save@v4
with:
with:
path: |
path: |
path/to/dependencies
path/to/dependencies
@ -186,7 +191,7 @@ A cache key can include any of the contexts, functions, literals, and operators
For example, using the [`hashFiles`](https://docs.github.com/en/actions/learn-github-actions/expressions#hashfiles) function allows you to create a new cache when dependencies change.
For example, using the [`hashFiles`](https://docs.github.com/en/actions/learn-github-actions/expressions#hashfiles) function allows you to create a new cache when dependencies change.
```yaml
```yaml
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
with:
path: |
path: |
path/to/dependencies
path/to/dependencies
@ -204,7 +209,7 @@ Additionally, you can use arbitrary command output in a cache key, such as a dat
- Updates @actions/cache to v3.2.3 to fix accidental mutated path arguments to `getCacheVersion` [actions/toolkit#1378](https://github.com/actions/toolkit/pull/1378)
- Updates @actions/cache to v3.2.3 to fix accidental mutated path arguments to `getCacheVersion` [actions/toolkit#1378](https://github.com/actions/toolkit/pull/1378)
- Additional audit fixes of npm package(s)
- Additional audit fixes of npm package(s)
### 4.0.0
- Updated minimum runner version support from node 12 -> node 20
description:'Key of the cache that was restored, it could either be the primary key on cache-hit or a partial/complete match of one of the restore keys'
description:'Key of the cache that was restored, it could either be the primary key on cache-hit or a partial/complete match of one of the restore keys'