Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c4ee99a

Browse filesBrowse files
authored
Merge branch 'main' into todgru/v4-documentation-update
2 parents bf9a757 + 57b8e40 commit c4ee99a
Copy full SHA for c4ee99a

File tree

Expand file treeCollapse file tree

9 files changed

+10
-6
lines changed
Filter options
Expand file treeCollapse file tree

9 files changed

+10
-6
lines changed

‎README.md

Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ If you are using a `self-hosted` Windows runner, `GNU tar` and `zstd` are requir
5454

5555
* `key` - An explicit key for a cache entry. See [creating a cache key](#creating-a-cache-key).
5656
* `path` - A list of files, directories, and wildcard patterns to cache and restore. See [`@actions/glob`](https://github.com/actions/toolkit/tree/main/packages/glob) for supported patterns.
57-
* `restore-keys` - An ordered list of prefix-matched keys to use for restoring stale cache if no cache hit occurred for key.
57+
* `restore-keys` - An ordered multiline string listing the prefix-matched keys, that are used for restoring stale cache if no cache hit occurred for key.
5858
* `enableCrossOsArchive` - An optional boolean when enabled, allows Windows runners to save or restore caches that can be restored or saved respectively on other platforms. Default: `false`
5959
* `fail-on-cache-miss` - Fail the workflow if cache entry is not found. Default: `false`
6060
* `lookup-only` - If true, only checks if cache entry exists and skips download. Does not change save cache behavior. Default: `false`

‎__tests__/restore.test.ts

Copy file name to clipboardExpand all lines: __tests__/restore.test.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ test("Fail restore when fail on cache miss is enabled and primary + restore keys
260260
);
261261

262262
expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key);
263-
expect(setCacheHitOutputMock).toHaveBeenCalledTimes(0);
263+
expect(setCacheHitOutputMock).toHaveBeenCalledTimes(1);
264264

265265
expect(failedMock).toHaveBeenCalledWith(
266266
`Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: ${key}`

‎__tests__/restoreOnly.test.ts

Copy file name to clipboardExpand all lines: __tests__/restoreOnly.test.ts
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ test("restore with no cache found", async () => {
8686
);
8787

8888
expect(outputMock).toHaveBeenCalledWith("cache-primary-key", key);
89-
expect(outputMock).toHaveBeenCalledTimes(1);
89+
expect(outputMock).toHaveBeenCalledWith("cache-hit", "false");
90+
expect(outputMock).toHaveBeenCalledTimes(2);
9091
expect(failedMock).toHaveBeenCalledTimes(0);
9192

9293
expect(infoMock).toHaveBeenCalledWith(

‎action.yml

Copy file name to clipboardExpand all lines: action.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ inputs:
99
description: 'An explicit key for restoring and saving the cache'
1010
required: true
1111
restore-keys:
12-
description: 'An ordered list of keys to use for restoring stale cache if no cache hit occurred for key. Note `cache-hit` returns false in this case.'
12+
description: 'An ordered multiline string listing the prefix-matched keys, that are used for restoring stale cache if no cache hit occurred for key. Note `cache-hit` returns false in this case.'
1313
required: false
1414
upload-chunk-size:
1515
description: 'The chunk size used to split up large files during upload, in bytes'

‎dist/restore-only/index.js

Copy file name to clipboardExpand all lines: dist/restore-only/index.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59415,6 +59415,7 @@ function restoreImpl(stateProvider, earlyExit) {
5941559415
const lookupOnly = utils.getInputAsBool(constants_1.Inputs.LookupOnly);
5941659416
const cacheKey = yield cache.restoreCache(cachePaths, primaryKey, restoreKeys, { lookupOnly: lookupOnly }, enableCrossOsArchive);
5941759417
if (!cacheKey) {
59418+
core.setOutput(constants_1.Outputs.CacheHit, false.toString());
5941859419
if (failOnCacheMiss) {
5941959420
throw new Error(`Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: ${primaryKey}`);
5942059421
}

‎dist/restore/index.js

Copy file name to clipboardExpand all lines: dist/restore/index.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59415,6 +59415,7 @@ function restoreImpl(stateProvider, earlyExit) {
5941559415
const lookupOnly = utils.getInputAsBool(constants_1.Inputs.LookupOnly);
5941659416
const cacheKey = yield cache.restoreCache(cachePaths, primaryKey, restoreKeys, { lookupOnly: lookupOnly }, enableCrossOsArchive);
5941759417
if (!cacheKey) {
59418+
core.setOutput(constants_1.Outputs.CacheHit, false.toString());
5941859419
if (failOnCacheMiss) {
5941959420
throw new Error(`Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: ${primaryKey}`);
5942059421
}

‎examples.md

Copy file name to clipboardExpand all lines: examples.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ jobs:
513513
```yaml
514514
- name: Get pip cache dir
515515
id: pip-cache
516+
shell: bash
516517
run: |
517518
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
518519

‎restore/action.yml

Copy file name to clipboardExpand all lines: restore/action.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ inputs:
99
description: 'An explicit key for restoring the cache'
1010
required: true
1111
restore-keys:
12-
description: 'An ordered list of keys to use for restoring stale cache if no cache hit occurred for key. Note `cache-hit` returns false in this case.'
12+
description: 'An ordered multiline string listing the prefix-matched keys, that are used for restoring stale cache if no cache hit occurred for key. Note `cache-hit` returns false in this case.'
1313
required: false
1414
enableCrossOsArchive:
1515
description: 'An optional boolean when enabled, allows windows runners to restore caches that were saved on other platforms'

‎src/restoreImpl.ts

Copy file name to clipboardExpand all lines: src/restoreImpl.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export async function restoreImpl(
5151
);
5252

5353
if (!cacheKey) {
54+
core.setOutput(Outputs.CacheHit, false.toString());
5455
if (failOnCacheMiss) {
5556
throw new Error(
5657
`Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: ${primaryKey}`
@@ -62,7 +63,6 @@ export async function restoreImpl(
6263
...restoreKeys
6364
].join(", ")}`
6465
);
65-
6666
return;
6767
}
6868

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.