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
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,6 +45,8 @@ The action has a built-in functionality for caching and restoring dependencies.
45
45
46
46
The action defaults to search for the dependency file (`package-lock.json` or `yarn.lock`) in the repository root, and uses its hash as a part of the cache key. Use `cache-dependency-path` for cases when multiple dependency files are used, or they are located in different subdirectories.
47
47
48
+
Use `cache-invalidate-after-days` to change the default fallback cache invalidation of every 120 days. Set to 0 to deactivate.
49
+
48
50
See the examples of using cache for `yarn` / `pnpm` and `cache-dependency-path` input in the [Advanced usage](docs/advanced-usage.md#caching-packages-dependencies) guide.
`Cache restored from key: ${platform}-setup-node-${packageManager}-${fileHash}`
138
+
`Cache restored from key: ${platform}-0-setup-node-${packageManager}-${fileHash}`
139
139
);
140
140
expect(infoSpy).not.toHaveBeenCalledWith(
141
-
`Cache not found for input keys: ${platform}-setup-node-${packageManager}-${fileHash}, ${platform}-setup-node-${packageManager}-, ${platform}-setup-node-`
141
+
`Cache not found for input keys: ${platform}-0-setup-node-${packageManager}-${fileHash}, ${platform}-0-setup-node-${packageManager}-`
`Cache not found for input keys: ${platform}-setup-node-${packageManager}-${fileHash}, ${platform}-setup-node-${packageManager}-, ${platform}-setup-node-`
168
+
`Cache not found for input keys: ${platform}-0-setup-node-${packageManager}-${fileHash}, ${platform}-0-setup-node-${packageManager}-`
Copy file name to clipboardExpand all lines: action.yml
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,8 @@ inputs:
23
23
description: 'Used to specify a package manager for caching in the default directory. Supported values: npm, yarn, pnpm'
24
24
cache-dependency-path:
25
25
description: 'Used to specify the path to a dependency file: package-lock.json, yarn.lock, etc. Supports wildcards or a list of file names for caching multiple dependencies.'
26
+
cache-invalidate-after-days:
27
+
description: 'Used to control how often the fallback cache is invalidated automatically.'
26
28
# TODO: add input to control forcing to pull from cloud or dist.
27
29
# escape valve for someone having issues or needing the absolute latest which isn't cached yet
28
30
# Deprecated option, do not use. Will not be supported after October 1, 2019
? Math.floor(Date.now()/(1000*60*60*24*numericCacheInvalidateAfterDays))%10// % 10 to get a rolling prefix between 0 and 9 rather than a possibly infinitely large
0 commit comments