diff --git a/__tests__/restoreOnly.test.ts b/__tests__/restoreOnly.test.ts index 81e5bca..840307d 100644 --- a/__tests__/restoreOnly.test.ts +++ b/__tests__/restoreOnly.test.ts @@ -86,7 +86,8 @@ test("restore with no cache found", async () => { ); expect(outputMock).toHaveBeenCalledWith("cache-primary-key", key); - expect(outputMock).toHaveBeenCalledTimes(1); + expect(outputMock).toHaveBeenCalledWith("cache-hit", "false"); + expect(outputMock).toHaveBeenCalledTimes(2); expect(failedMock).toHaveBeenCalledTimes(0); expect(infoMock).toHaveBeenCalledWith( diff --git a/dist/restore-only/index.js b/dist/restore-only/index.js index 9a59ac0..320cbe6 100644 --- a/dist/restore-only/index.js +++ b/dist/restore-only/index.js @@ -59422,6 +59422,7 @@ function restoreImpl(stateProvider, earlyExit) { primaryKey, ...restoreKeys ].join(", ")}`); + core.setOutput(constants_1.Outputs.CacheHit, false.toString()); return; } // Store the matched cache key in states diff --git a/dist/restore/index.js b/dist/restore/index.js index 03a12b5..a7b6af4 100644 --- a/dist/restore/index.js +++ b/dist/restore/index.js @@ -59422,6 +59422,7 @@ function restoreImpl(stateProvider, earlyExit) { primaryKey, ...restoreKeys ].join(", ")}`); + core.setOutput(constants_1.Outputs.CacheHit, false.toString()); return; } // Store the matched cache key in states diff --git a/src/restoreImpl.ts b/src/restoreImpl.ts index 74a366d..b71abd1 100644 --- a/src/restoreImpl.ts +++ b/src/restoreImpl.ts @@ -62,7 +62,7 @@ export async function restoreImpl( ...restoreKeys ].join(", ")}` ); - + core.setOutput(Outputs.CacheHit, false.toString()); return; }