From ecf2bfe0cf83dc036eb6a73a73dfa35793a83cce Mon Sep 17 00:00:00 2001 From: Lucas Costi Date: Fri, 8 Apr 2022 16:36:45 +1000 Subject: [PATCH] Clarify restore-keys description (#16922) Co-authored-by: Vanessa --- .../caching-dependencies-to-speed-up-workflows.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/content/actions/using-workflows/caching-dependencies-to-speed-up-workflows.md b/content/actions/using-workflows/caching-dependencies-to-speed-up-workflows.md index 294e42e58b..a1aab92d30 100644 --- a/content/actions/using-workflows/caching-dependencies-to-speed-up-workflows.md +++ b/content/actions/using-workflows/caching-dependencies-to-speed-up-workflows.md @@ -102,7 +102,16 @@ For more information, see [`actions/cache`](https://github.com/actions/cache). ~/.gradle/wrapper ``` - With `v1` of the `cache` action, only a single path is supported and it must be a directory. You cannot cache a single file. -- `restore-keys`: **Optional** An ordered list of alternative keys to use for finding the cache if no cache hit occurred for `key`. +- `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: + + {% raw %} + ```yaml + restore-keys: | + npm-foobar-${{ hashFiles('package-lock.json') }} + npm-foobar- + npm- + ``` + {% endraw %} ### Output parameters for the `cache` action