From 8b057be73f8f78426b154d7f3133941bd693e93e Mon Sep 17 00:00:00 2001 From: Robert Haschke Date: Sat, 22 Oct 2022 13:45:28 +0200 Subject: [PATCH] Update doc --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index abe42b0..3b2428c 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,8 @@ If you are using this inside a container, a POSIX-compliant `tar` needs to be in #### Environment Variables * `SEGMENT_DOWNLOAD_TIMEOUT_MINS` - Segment download timeout (in minutes, default `60`) to abort download of the segment if not completed in the defined number of minutes. [Read more](#cache-segment-restore-timeout) +* `GHA_CACHE_SAVE` - Controls when to save cache. By default, a new cache is created if the job completes successfully. If this variable is set to `always`, the cache is saved also on job failure. If set to `never`, the cache is never saved, i.e. realizing read-only cache. + ### Outputs * `cache-hit` - A boolean value to indicate an exact match was found for the key @@ -80,7 +82,8 @@ jobs: run: /primes.sh -d prime-numbers ``` -> Note: You must use the `cache` action in your workflow before you need to use the files that might be restored from the cache. If the provided `key` matches an existing cache, a new cache is not created and if the provided `key` doesn't match an existing cache, a new cache is automatically created provided the job completes successfully. +> Note: You must use the `cache` action in your workflow _before_ you need to use the files that might be restored from the cache. If the provided `key` matches an existing cache exactly, a new cache is not created. Include `${{github.run_id}}` as the last component of your `key` to save the cache in each workflow run. +If the provided `key` doesn't match an existing cache exactly, a new cache is automatically created provided the job completes successfully. This behavior can be changed with the environment variable `GHA_CACHE_SAVE` ([see above](#environment-variables)). ## Implementation Examples