You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b9bf592
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+16-11Lines changed: 16 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ See ["Caching dependencies to speed up workflows"](https://docs.github.com/en/ac
18
18
### ⚠️ Important changes
19
19
20
20
> [!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`.
22
22
> If you are using self-hosted runners, ensure they are updated before upgrading.
23
23
24
24
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.
38
38
39
39
Read more about the change & access the migration guide: [reference to the announcement](https://github.com/actions/cache/discussions/1510).
40
40
41
+
### v6
42
+
43
+
* Updated `@actions/cache`, `@actions/core`, `@actions/exec` to latest major versions
44
+
* Migrated to ESM module system
45
+
41
46
### v5
42
47
43
48
* Updated to node 24
@@ -78,7 +83,7 @@ Create a workflow `.yml` file in your repository's `.github/workflows` directory
78
83
79
84
If you are using this inside a container, a POSIX-compliant `tar` needs to be included and accessible from the execution path.
80
85
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`.
82
87
83
88
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.
84
89
@@ -127,7 +132,7 @@ jobs:
127
132
128
133
- name: Cache Primes
129
134
id: cache-primes
130
-
uses: actions/cache@v5
135
+
uses: actions/cache@v6
131
136
with:
132
137
path: prime-numbers
133
138
key: ${{ runner.os }}-primes
@@ -158,7 +163,7 @@ jobs:
158
163
159
164
- name: Restore cached Primes
160
165
id: cache-primes-restore
161
-
uses: actions/cache/restore@v5
166
+
uses: actions/cache/restore@v6
162
167
with:
163
168
path: |
164
169
path/to/dependencies
@@ -169,7 +174,7 @@ jobs:
169
174
.
170
175
- name: Save Primes
171
176
id: cache-primes-save
172
-
uses: actions/cache/save@v5
177
+
uses: actions/cache/save@v6
173
178
with:
174
179
path: |
175
180
path/to/dependencies
@@ -224,7 +229,7 @@ A cache key can include any of the contexts, functions, literals, and operators
224
229
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.
225
230
226
231
```yaml
227
-
- uses: actions/cache@v5
232
+
- uses: actions/cache@v6
228
233
with:
229
234
path: |
230
235
path/to/dependencies
@@ -242,7 +247,7 @@ Additionally, you can use arbitrary command output in a cache key, such as a dat
Copy file name to clipboardExpand all lines: caching-strategies.md
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ This document lists some of the strategies (and example workflows if possible) w
12
12
jobs:
13
13
build:
14
14
runs-on: ubuntu-latest
15
-
- uses: actions/cache@v5
15
+
- uses: actions/cache@v6
16
16
with:
17
17
key: ${{ some-metadata }}-cache
18
18
```
@@ -24,7 +24,7 @@ In your workflows, you can use different strategies to name your key depending o
24
24
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.
25
25
26
26
```yaml
27
-
- uses: actions/cache@v5
27
+
- uses: actions/cache@v6
28
28
with:
29
29
path: |
30
30
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
37
37
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.
38
38
39
39
```yaml
40
-
- uses: actions/cache@v5
40
+
- uses: actions/cache@v6
41
41
with:
42
42
path: |
43
43
path/to/dependencies
@@ -54,7 +54,7 @@ The restore keys can be provided as a complete name, or a prefix, read more [her
54
54
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.
55
55
56
56
```yaml
57
-
- uses: actions/cache@v5
57
+
- uses: actions/cache@v6
58
58
with:
59
59
path: |
60
60
path/to/dependencies
@@ -73,7 +73,7 @@ Caches scoped to the particular workflow run id or run attempt can be stored and
73
73
On similar lines, commit sha can be used to create a very specialized and short lived cache.
74
74
75
75
```yaml
76
-
- uses: actions/cache@v5
76
+
- uses: actions/cache@v6
77
77
with:
78
78
path: |
79
79
path/to/dependencies
@@ -86,7 +86,7 @@ On similar lines, commit sha can be used to create a very specialized and short
86
86
Cache key can be formed by combination of more than one metadata, evaluated info.
87
87
88
88
```yaml
89
-
- uses: actions/cache@v5
89
+
- uses: actions/cache@v6
90
90
with:
91
91
path: |
92
92
path/to/dependencies
@@ -148,7 +148,7 @@ In case you are using a centralized job to create and save your cache that can b
148
148
steps:
149
149
- uses: actions/checkout@v6
150
150
151
-
- uses: actions/cache/restore@v5
151
+
- uses: actions/cache/restore@v6
152
152
id: cache
153
153
with:
154
154
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
173
173
steps:
174
174
- uses: actions/checkout@v6
175
175
176
-
- uses: actions/cache/restore@v5
176
+
- uses: actions/cache/restore@v6
177
177
id: cache
178
178
with:
179
179
path: path/to/dependencies
@@ -194,7 +194,7 @@ steps:
194
194
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.
195
195
196
196
```yaml
197
-
- uses: actions/cache/restore@v5
197
+
- uses: actions/cache/restore@v6
198
198
id: restore-cache
199
199
with:
200
200
path: |
@@ -204,7 +204,7 @@ If you want to avoid re-computing the cache key again in `save` action, the outp
204
204
.
205
205
.
206
206
.
207
-
- uses: actions/cache/save@v5
207
+
- uses: actions/cache/save@v6
208
208
with:
209
209
path: |
210
210
path/to/dependencies
@@ -219,7 +219,7 @@ On the other hand, the key can also be explicitly re-computed while executing th
219
219
Let's say we have a restore step that computes key at runtime
220
220
221
221
```yaml
222
-
uses: actions/cache/restore@v5
222
+
uses: actions/cache/restore@v6
223
223
id: restore-cache
224
224
with:
225
225
key: cache-${{ hashFiles('**/lockfiles') }}
@@ -228,15 +228,15 @@ with:
228
228
Case 1: Where an user would want to reuse the key as it is
0 commit comments