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
Copy file name to clipboardExpand all lines: README.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -145,6 +145,12 @@ The plugin includes wrappers to provide both examples and backwards-compatibilit
145
145
146
146
Force saving the cache even if it exists. Default: `false`.
147
147
148
+
### `soft-fail` (boolean)
149
+
150
+
When enabled, any operational failures during cache restore or save operations will emit a warning and continue without failing the build. This includes missing cache paths, network errors, permission issues, and other runtime errors. Configuration errors (missing required options, invalid cache levels, etc.) will still fail immediately.
151
+
152
+
This is useful when caching is an optimization and should not block the build pipeline. Default: `false`.
153
+
148
154
### `keep-compressed-artifacts` (boolean)
149
155
150
156
Remove compression artifacts after they are used. Default: `false`.
@@ -268,6 +274,28 @@ steps:
268
274
269
275
```
270
276
277
+
### Using soft-fail for non-critical caching
278
+
279
+
When caching is purely an optimization and should never block your build, use the `soft-fail` option. This is particularly useful for:
280
+
281
+
- Mission critical builds where caching is a "nice to have" but not essential
282
+
- Optional build caches (ccache, sccache)
283
+
- Dependency caches where network issues shouldn't fail builds
284
+
- Situations where the cached path may not always exist
285
+
286
+
```yaml
287
+
steps:
288
+
- label: ':nodejs: Install dependencies'
289
+
command: npm ci
290
+
plugins:
291
+
- cache#v1.7.0:
292
+
path: node_modules
293
+
manifest: package-lock.json
294
+
restore: file
295
+
save: file
296
+
soft-fail: true # Network issues or missing paths won't fail the build
0 commit comments