Skip to content

Commit b9bf592

Browse files
committed
Update documentation for v6 release
1 parent 80f7777 commit b9bf592

5 files changed

Lines changed: 83 additions & 72 deletions

File tree

‎README.md‎

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ See ["Caching dependencies to speed up workflows"](https://docs.github.com/en/ac
1818
### ⚠️ Important changes
1919

2020
> [!IMPORTANT]
21-
> `actions/cache@v5` runs on the Node.js 24 runtime and requires a minimum Actions Runner version of `2.327.1`.
21+
> `actions/cache@v6` runs on the Node.js 24 runtime and requires a minimum Actions Runner version of `2.327.1`.
2222
> If you are using self-hosted runners, ensure they are updated before upgrading.
2323
2424
The cache backend service has been rewritten from the ground up for improved performance and reliability. [actions/cache](https://github.com/actions/cache) now integrates with the new cache service (v2) APIs.
@@ -38,6 +38,11 @@ Upgrading to the recommended versions will not break your workflows.
3838
3939
Read more about the change & access the migration guide: [reference to the announcement](https://github.com/actions/cache/discussions/1510).
4040

41+
### v6
42+
43+
* Updated `@actions/cache`, `@actions/core`, `@actions/exec` to latest major versions
44+
* Migrated to ESM module system
45+
4146
### v5
4247

4348
* Updated to node 24
@@ -78,7 +83,7 @@ Create a workflow `.yml` file in your repository's `.github/workflows` directory
7883

7984
If you are using this inside a container, a POSIX-compliant `tar` needs to be included and accessible from the execution path.
8085

81-
Note: `actions/cache@v5` runs on Node.js 24 and requires a minimum Actions Runner version of `2.327.1`.
86+
Note: `actions/cache@v6` runs on Node.js 24 and requires a minimum Actions Runner version of `2.327.1`.
8287

8388
If you are using a `self-hosted` Windows runner, `GNU tar` and `zstd` are required for [Cross-OS caching](https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cross-os-cache) to work. They are also recommended to be installed in general so the performance is on par with `hosted` Windows runners.
8489

@@ -127,7 +132,7 @@ jobs:
127132

128133
- name: Cache Primes
129134
id: cache-primes
130-
uses: actions/cache@v5
135+
uses: actions/cache@v6
131136
with:
132137
path: prime-numbers
133138
key: ${{ runner.os }}-primes
@@ -158,7 +163,7 @@ jobs:
158163
159164
- name: Restore cached Primes
160165
id: cache-primes-restore
161-
uses: actions/cache/restore@v5
166+
uses: actions/cache/restore@v6
162167
with:
163168
path: |
164169
path/to/dependencies
@@ -169,7 +174,7 @@ jobs:
169174
.
170175
- name: Save Primes
171176
id: cache-primes-save
172-
uses: actions/cache/save@v5
177+
uses: actions/cache/save@v6
173178
with:
174179
path: |
175180
path/to/dependencies
@@ -224,7 +229,7 @@ A cache key can include any of the contexts, functions, literals, and operators
224229
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.
225230

226231
```yaml
227-
- uses: actions/cache@v5
232+
- uses: actions/cache@v6
228233
with:
229234
path: |
230235
path/to/dependencies
@@ -242,7 +247,7 @@ Additionally, you can use arbitrary command output in a cache key, such as a dat
242247
echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT
243248
shell: bash
244249
245-
- uses: actions/cache@v5
250+
- uses: actions/cache@v6
246251
with:
247252
path: path/to/dependencies
248253
key: ${{ runner.os }}-${{ steps.get-date.outputs.date }}-${{ hashFiles('**/lockfiles') }}
@@ -264,7 +269,7 @@ Example:
264269
steps:
265270
- uses: actions/checkout@v6
266271
267-
- uses: actions/cache@v5
272+
- uses: actions/cache@v6
268273
id: cache
269274
with:
270275
path: path/to/dependencies
@@ -296,7 +301,7 @@ jobs:
296301
297302
- name: Cache Primes
298303
id: cache-primes
299-
uses: actions/cache@v5
304+
uses: actions/cache@v6
300305
with:
301306
path: prime-numbers
302307
key: primes
@@ -307,7 +312,7 @@ jobs:
307312
308313
- name: Cache Numbers
309314
id: cache-numbers
310-
uses: actions/cache@v5
315+
uses: actions/cache@v6
311316
with:
312317
path: numbers
313318
key: primes
@@ -323,7 +328,7 @@ jobs:
323328
324329
- name: Cache Primes
325330
id: cache-primes
326-
uses: actions/cache@v5
331+
uses: actions/cache@v6
327332
with:
328333
path: prime-numbers
329334
key: primes

‎RELEASES.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525

2626
## Changelog
2727

28+
### 6.0.0
29+
30+
- Updated `@actions/cache` to ^6.0.1, `@actions/core` to ^3.0.1, `@actions/exec` to ^3.0.0, `@actions/io` to ^3.0.2
31+
- Migrated to ESM module system
32+
- Upgraded Jest to v30 and test infrastructure to be ESM compatible
33+
2834
### 5.0.4
2935

3036
- Bump `minimatch` to v3.1.5 (fixes ReDoS via globstar patterns)

‎caching-strategies.md‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This document lists some of the strategies (and example workflows if possible) w
1212
jobs:
1313
build:
1414
runs-on: ubuntu-latest
15-
- uses: actions/cache@v5
15+
- uses: actions/cache@v6
1616
with:
1717
key: ${{ some-metadata }}-cache
1818
```
@@ -24,7 +24,7 @@ In your workflows, you can use different strategies to name your key depending o
2424
One of the most common use case is to use hash for lockfile as key. This way, same cache will be restored for a lockfile until there's a change in dependencies listed in lockfile.
2525
2626
```yaml
27-
- uses: actions/cache@v5
27+
- uses: actions/cache@v6
2828
with:
2929
path: |
3030
path/to/dependencies
@@ -37,7 +37,7 @@ One of the most common use case is to use hash for lockfile as key. This way, sa
3737
If cache is not found matching the primary key, restore keys can be used to download the closest matching cache that was recently created. This ensures that the build/install step will need to additionally fetch just a handful of newer dependencies, and hence saving build time.
3838
3939
```yaml
40-
- uses: actions/cache@v5
40+
- uses: actions/cache@v6
4141
with:
4242
path: |
4343
path/to/dependencies
@@ -54,7 +54,7 @@ The restore keys can be provided as a complete name, or a prefix, read more [her
5454
In case of workflows with matrix running for multiple Operating Systems, the caches can be stored separately for each of them. This can be used in combination with hashfiles in case multiple caches are being generated per OS.
5555
5656
```yaml
57-
- uses: actions/cache@v5
57+
- uses: actions/cache@v6
5858
with:
5959
path: |
6060
path/to/dependencies
@@ -73,7 +73,7 @@ Caches scoped to the particular workflow run id or run attempt can be stored and
7373
On similar lines, commit sha can be used to create a very specialized and short lived cache.
7474
7575
```yaml
76-
- uses: actions/cache@v5
76+
- uses: actions/cache@v6
7777
with:
7878
path: |
7979
path/to/dependencies
@@ -86,7 +86,7 @@ On similar lines, commit sha can be used to create a very specialized and short
8686
Cache key can be formed by combination of more than one metadata, evaluated info.
8787
8888
```yaml
89-
- uses: actions/cache@v5
89+
- uses: actions/cache@v6
9090
with:
9191
path: |
9292
path/to/dependencies
@@ -148,7 +148,7 @@ In case you are using a centralized job to create and save your cache that can b
148148
steps:
149149
- uses: actions/checkout@v6
150150
151-
- uses: actions/cache/restore@v5
151+
- uses: actions/cache/restore@v6
152152
id: cache
153153
with:
154154
path: path/to/dependencies
@@ -173,7 +173,7 @@ You can use the output of this action to exit the workflow on cache miss. This w
173173
steps:
174174
- uses: actions/checkout@v6
175175
176-
- uses: actions/cache/restore@v5
176+
- uses: actions/cache/restore@v6
177177
id: cache
178178
with:
179179
path: path/to/dependencies
@@ -194,7 +194,7 @@ steps:
194194
If you want to avoid re-computing the cache key again in `save` action, the outputs from `restore` action can be used as input to the `save` action.
195195

196196
```yaml
197-
- uses: actions/cache/restore@v5
197+
- uses: actions/cache/restore@v6
198198
id: restore-cache
199199
with:
200200
path: |
@@ -204,7 +204,7 @@ If you want to avoid re-computing the cache key again in `save` action, the outp
204204
.
205205
.
206206
.
207-
- uses: actions/cache/save@v5
207+
- uses: actions/cache/save@v6
208208
with:
209209
path: |
210210
path/to/dependencies
@@ -219,7 +219,7 @@ On the other hand, the key can also be explicitly re-computed while executing th
219219
Let's say we have a restore step that computes key at runtime
220220

221221
```yaml
222-
uses: actions/cache/restore@v5
222+
uses: actions/cache/restore@v6
223223
id: restore-cache
224224
with:
225225
key: cache-${{ hashFiles('**/lockfiles') }}
@@ -228,15 +228,15 @@ with:
228228
Case 1: Where an user would want to reuse the key as it is
229229

230230
```yaml
231-
uses: actions/cache/save@v5
231+
uses: actions/cache/save@v6
232232
with:
233233
key: ${{ steps.restore-cache.outputs.cache-primary-key }}
234234
```
235235

236236
Case 2: Where the user would want to re-evaluate the key
237237

238238
```yaml
239-
uses: actions/cache/save@v5
239+
uses: actions/cache/save@v6
240240
with:
241241
key: npm-cache-${{hashfiles(package-lock.json)}}
242242
```
@@ -258,7 +258,7 @@ steps:
258258
- name: Build
259259
run: ./build-parent-module.sh
260260
261-
- uses: actions/cache/save@v5
261+
- uses: actions/cache/save@v6
262262
id: cache
263263
with:
264264
path: path/to/dependencies
@@ -271,7 +271,7 @@ steps:
271271
steps:
272272
- uses: actions/checkout@v6
273273
274-
- uses: actions/cache/restore@v5
274+
- uses: actions/cache/restore@v6
275275
id: cache
276276
with:
277277
path: path/to/dependencies

0 commit comments

Comments
 (0)