Skip to content

Commit ecf2bfe

Browse files
lucascostivgrl
andauthored
Clarify restore-keys description (github#16922)
Co-authored-by: Vanessa <[email protected]>
1 parent c5b8ab4 commit ecf2bfe

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

content/actions/using-workflows/caching-dependencies-to-speed-up-workflows.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,16 @@ For more information, see [`actions/cache`](https://github.com/actions/cache).
102102
~/.gradle/wrapper
103103
```
104104
- With `v1` of the `cache` action, only a single path is supported and it must be a directory. You cannot cache a single file.
105-
- `restore-keys`: **Optional** An ordered list of alternative keys to use for finding the cache if no cache hit occurred for `key`.
105+
- `restore-keys`: **Optional** A string containing alternative restore keys, with each restore key placed on a new line. If no cache hit occurred for `key`, these restore keys are used sequentially in the order provided to find and restore a cache. For example:
106+
107+
{% raw %}
108+
```yaml
109+
restore-keys: |
110+
npm-foobar-${{ hashFiles('package-lock.json') }}
111+
npm-foobar-
112+
npm-
113+
```
114+
{% endraw %}
106115

107116
### Output parameters for the `cache` action
108117

0 commit comments

Comments
 (0)