diff --git a/__tests__/actionUtils.test.ts b/__tests__/actionUtils.test.ts index 66eba7e..f98a76e 100644 --- a/__tests__/actionUtils.test.ts +++ b/__tests__/actionUtils.test.ts @@ -174,6 +174,26 @@ test("getInputAsInt throws if required and value missing", () => { ).toThrowError(); }); +test("getInputAsBool returns false if input not set", () => { + expect(actionUtils.getInputAsBool("undefined")).toBe(false); +}); + +test("getInputAsBool returns value if input is valid", () => { + testUtils.setInput("foo", "true"); + expect(actionUtils.getInputAsBool("foo")).toBe(true); +}); + +test("getInputAsBool returns false if input is invalid or NaN", () => { + testUtils.setInput("foo", "bar"); + expect(actionUtils.getInputAsBool("foo")).toBe(false); +}); + +test("getInputAsBool throws if required and value missing", () => { + expect(() => + actionUtils.getInputAsBool("undefined2", { required: true }) + ).toThrowError(); +}); + test("isCacheFeatureAvailable for ac enabled", () => { jest.spyOn(cache, "isFeatureAvailable").mockImplementation(() => true); diff --git a/__tests__/restore.test.ts b/__tests__/restore.test.ts index 84c8762..ab768ba 100644 --- a/__tests__/restore.test.ts +++ b/__tests__/restore.test.ts @@ -27,9 +27,17 @@ beforeAll(() => { return actualUtils.getInputAsArray(name, options); } ); + + jest.spyOn(actionUtils, "getInputAsBool").mockImplementation( + (name, options) => { + const actualUtils = jest.requireActual("../src/utils/actionUtils"); + return actualUtils.getInputAsBool(name, options); + } + ); }); beforeEach(() => { + jest.restoreAllMocks(); process.env[Events.Key] = Events.Push; process.env[RefKey] = "refs/heads/feature-branch"; @@ -50,7 +58,8 @@ test("restore with no cache found", async () => { const key = "node-test"; testUtils.setInputs({ path: path, - key + key, + enableCrossOsArchive: false }); const infoMock = jest.spyOn(core, "info"); @@ -65,7 +74,7 @@ test("restore with no cache found", async () => { await run(); expect(restoreCacheMock).toHaveBeenCalledTimes(1); - expect(restoreCacheMock).toHaveBeenCalledWith([path], key, []); + expect(restoreCacheMock).toHaveBeenCalledWith([path], key, [], {}, false); expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key); expect(stateMock).toHaveBeenCalledTimes(1); @@ -84,7 +93,8 @@ test("restore with restore keys and no cache found", async () => { testUtils.setInputs({ path: path, key, - restoreKeys: [restoreKey] + restoreKeys: [restoreKey], + enableCrossOsArchive: false }); const infoMock = jest.spyOn(core, "info"); @@ -99,7 +109,13 @@ test("restore with restore keys and no cache found", async () => { await run(); expect(restoreCacheMock).toHaveBeenCalledTimes(1); - expect(restoreCacheMock).toHaveBeenCalledWith([path], key, [restoreKey]); + expect(restoreCacheMock).toHaveBeenCalledWith( + [path], + key, + [restoreKey], + {}, + false + ); expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key); expect(stateMock).toHaveBeenCalledTimes(1); @@ -116,7 +132,8 @@ test("restore with cache found for key", async () => { const key = "node-test"; testUtils.setInputs({ path: path, - key + key, + enableCrossOsArchive: false }); const infoMock = jest.spyOn(core, "info"); @@ -132,7 +149,7 @@ test("restore with cache found for key", async () => { await run(); expect(restoreCacheMock).toHaveBeenCalledTimes(1); - expect(restoreCacheMock).toHaveBeenCalledWith([path], key, []); + expect(restoreCacheMock).toHaveBeenCalledWith([path], key, [], {}, false); expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key); expect(stateMock).toHaveBeenCalledWith("CACHE_RESULT", key); @@ -152,7 +169,8 @@ test("restore with cache found for restore key", async () => { testUtils.setInputs({ path: path, key, - restoreKeys: [restoreKey] + restoreKeys: [restoreKey], + enableCrossOsArchive: false }); const infoMock = jest.spyOn(core, "info"); @@ -168,7 +186,13 @@ test("restore with cache found for restore key", async () => { await run(); expect(restoreCacheMock).toHaveBeenCalledTimes(1); - expect(restoreCacheMock).toHaveBeenCalledWith([path], key, [restoreKey]); + expect(restoreCacheMock).toHaveBeenCalledWith( + [path], + key, + [restoreKey], + {}, + false + ); expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key); expect(stateMock).toHaveBeenCalledWith("CACHE_RESULT", restoreKey); diff --git a/__tests__/restoreImpl.test.ts b/__tests__/restoreImpl.test.ts index 47a9e52..9bc4fc3 100644 --- a/__tests__/restoreImpl.test.ts +++ b/__tests__/restoreImpl.test.ts @@ -28,9 +28,17 @@ beforeAll(() => { return actualUtils.getInputAsArray(name, options); } ); + + jest.spyOn(actionUtils, "getInputAsBool").mockImplementation( + (name, options) => { + const actualUtils = jest.requireActual("../src/utils/actionUtils"); + return actualUtils.getInputAsBool(name, options); + } + ); }); beforeEach(() => { + jest.restoreAllMocks(); process.env[Events.Key] = Events.Push; process.env[RefKey] = "refs/heads/feature-branch"; @@ -97,7 +105,8 @@ test("restore on GHES with AC available ", async () => { const key = "node-test"; testUtils.setInputs({ path: path, - key + key, + enableCrossOsArchive: false }); const infoMock = jest.spyOn(core, "info"); @@ -113,7 +122,7 @@ test("restore on GHES with AC available ", async () => { await run(new StateProvider()); expect(restoreCacheMock).toHaveBeenCalledTimes(1); - expect(restoreCacheMock).toHaveBeenCalledWith([path], key, []); + expect(restoreCacheMock).toHaveBeenCalledWith([path], key, [], {}, false); expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key); expect(setCacheHitOutputMock).toHaveBeenCalledTimes(1); @@ -152,13 +161,20 @@ test("restore with too many keys should fail", async () => { testUtils.setInputs({ path: path, key, - restoreKeys + restoreKeys, + enableCrossOsArchive: false }); const failedMock = jest.spyOn(core, "setFailed"); const restoreCacheMock = jest.spyOn(cache, "restoreCache"); await run(new StateProvider()); expect(restoreCacheMock).toHaveBeenCalledTimes(1); - expect(restoreCacheMock).toHaveBeenCalledWith([path], key, restoreKeys); + expect(restoreCacheMock).toHaveBeenCalledWith( + [path], + key, + restoreKeys, + {}, + false + ); expect(failedMock).toHaveBeenCalledWith( `Key Validation Error: Keys are limited to a maximum of 10.` ); @@ -169,13 +185,14 @@ test("restore with large key should fail", async () => { const key = "foo".repeat(512); // Over the 512 character limit testUtils.setInputs({ path: path, - key + key, + enableCrossOsArchive: false }); const failedMock = jest.spyOn(core, "setFailed"); const restoreCacheMock = jest.spyOn(cache, "restoreCache"); await run(new StateProvider()); expect(restoreCacheMock).toHaveBeenCalledTimes(1); - expect(restoreCacheMock).toHaveBeenCalledWith([path], key, []); + expect(restoreCacheMock).toHaveBeenCalledWith([path], key, [], {}, false); expect(failedMock).toHaveBeenCalledWith( `Key Validation Error: ${key} cannot be larger than 512 characters.` ); @@ -186,13 +203,14 @@ test("restore with invalid key should fail", async () => { const key = "comma,comma"; testUtils.setInputs({ path: path, - key + key, + enableCrossOsArchive: false }); const failedMock = jest.spyOn(core, "setFailed"); const restoreCacheMock = jest.spyOn(cache, "restoreCache"); await run(new StateProvider()); expect(restoreCacheMock).toHaveBeenCalledTimes(1); - expect(restoreCacheMock).toHaveBeenCalledWith([path], key, []); + expect(restoreCacheMock).toHaveBeenCalledWith([path], key, [], {}, false); expect(failedMock).toHaveBeenCalledWith( `Key Validation Error: ${key} cannot contain commas.` ); @@ -203,7 +221,8 @@ test("restore with no cache found", async () => { const key = "node-test"; testUtils.setInputs({ path: path, - key + key, + enableCrossOsArchive: false }); const infoMock = jest.spyOn(core, "info"); @@ -218,7 +237,7 @@ test("restore with no cache found", async () => { await run(new StateProvider()); expect(restoreCacheMock).toHaveBeenCalledTimes(1); - expect(restoreCacheMock).toHaveBeenCalledWith([path], key, []); + expect(restoreCacheMock).toHaveBeenCalledWith([path], key, [], {}, false); expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key); expect(failedMock).toHaveBeenCalledTimes(0); @@ -235,7 +254,8 @@ test("restore with restore keys and no cache found", async () => { testUtils.setInputs({ path: path, key, - restoreKeys: [restoreKey] + restoreKeys: [restoreKey], + enableCrossOsArchive: false }); const infoMock = jest.spyOn(core, "info"); @@ -250,7 +270,13 @@ test("restore with restore keys and no cache found", async () => { await run(new StateProvider()); expect(restoreCacheMock).toHaveBeenCalledTimes(1); - expect(restoreCacheMock).toHaveBeenCalledWith([path], key, [restoreKey]); + expect(restoreCacheMock).toHaveBeenCalledWith( + [path], + key, + [restoreKey], + {}, + false + ); expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key); expect(failedMock).toHaveBeenCalledTimes(0); @@ -265,7 +291,8 @@ test("restore with cache found for key", async () => { const key = "node-test"; testUtils.setInputs({ path: path, - key + key, + enableCrossOsArchive: false }); const infoMock = jest.spyOn(core, "info"); @@ -281,7 +308,7 @@ test("restore with cache found for key", async () => { await run(new StateProvider()); expect(restoreCacheMock).toHaveBeenCalledTimes(1); - expect(restoreCacheMock).toHaveBeenCalledWith([path], key, []); + expect(restoreCacheMock).toHaveBeenCalledWith([path], key, [], {}, false); expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key); expect(setCacheHitOutputMock).toHaveBeenCalledTimes(1); @@ -298,7 +325,8 @@ test("restore with cache found for restore key", async () => { testUtils.setInputs({ path: path, key, - restoreKeys: [restoreKey] + restoreKeys: [restoreKey], + enableCrossOsArchive: false }); const infoMock = jest.spyOn(core, "info"); @@ -314,7 +342,13 @@ test("restore with cache found for restore key", async () => { await run(new StateProvider()); expect(restoreCacheMock).toHaveBeenCalledTimes(1); - expect(restoreCacheMock).toHaveBeenCalledWith([path], key, [restoreKey]); + expect(restoreCacheMock).toHaveBeenCalledWith( + [path], + key, + [restoreKey], + {}, + false + ); expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key); expect(setCacheHitOutputMock).toHaveBeenCalledTimes(1); diff --git a/__tests__/restoreOnly.test.ts b/__tests__/restoreOnly.test.ts index 386ae38..ab69914 100644 --- a/__tests__/restoreOnly.test.ts +++ b/__tests__/restoreOnly.test.ts @@ -27,9 +27,18 @@ beforeAll(() => { return actualUtils.getInputAsArray(name, options); } ); + + jest.spyOn(actionUtils, "getInputAsBool").mockImplementation( + (name, options) => { + return jest + .requireActual("../src/utils/actionUtils") + .getInputAsBool(name, options); + } + ); }); beforeEach(() => { + jest.restoreAllMocks(); process.env[Events.Key] = Events.Push; process.env[RefKey] = "refs/heads/feature-branch"; @@ -50,7 +59,8 @@ test("restore with no cache found", async () => { const key = "node-test"; testUtils.setInputs({ path: path, - key + key, + enableCrossOsArchive: false }); const infoMock = jest.spyOn(core, "info"); @@ -65,7 +75,7 @@ test("restore with no cache found", async () => { await run(); expect(restoreCacheMock).toHaveBeenCalledTimes(1); - expect(restoreCacheMock).toHaveBeenCalledWith([path], key, []); + expect(restoreCacheMock).toHaveBeenCalledWith([path], key, [], {}, false); expect(outputMock).toHaveBeenCalledWith("cache-primary-key", key); expect(outputMock).toHaveBeenCalledTimes(1); @@ -83,7 +93,8 @@ test("restore with restore keys and no cache found", async () => { testUtils.setInputs({ path: path, key, - restoreKeys: [restoreKey] + restoreKeys: [restoreKey], + enableCrossOsArchive: false }); const infoMock = jest.spyOn(core, "info"); @@ -98,7 +109,13 @@ test("restore with restore keys and no cache found", async () => { await run(); expect(restoreCacheMock).toHaveBeenCalledTimes(1); - expect(restoreCacheMock).toHaveBeenCalledWith([path], key, [restoreKey]); + expect(restoreCacheMock).toHaveBeenCalledWith( + [path], + key, + [restoreKey], + {}, + false + ); expect(outputMock).toHaveBeenCalledWith("cache-primary-key", key); expect(failedMock).toHaveBeenCalledTimes(0); @@ -113,7 +130,8 @@ test("restore with cache found for key", async () => { const key = "node-test"; testUtils.setInputs({ path: path, - key + key, + enableCrossOsArchive: false }); const infoMock = jest.spyOn(core, "info"); @@ -128,7 +146,7 @@ test("restore with cache found for key", async () => { await run(); expect(restoreCacheMock).toHaveBeenCalledTimes(1); - expect(restoreCacheMock).toHaveBeenCalledWith([path], key, []); + expect(restoreCacheMock).toHaveBeenCalledWith([path], key, [], {}, false); expect(outputMock).toHaveBeenCalledWith("cache-primary-key", key); expect(outputMock).toHaveBeenCalledWith("cache-hit", "true"); @@ -147,7 +165,8 @@ test("restore with cache found for restore key", async () => { testUtils.setInputs({ path: path, key, - restoreKeys: [restoreKey] + restoreKeys: [restoreKey], + enableCrossOsArchive: false }); const infoMock = jest.spyOn(core, "info"); @@ -162,7 +181,13 @@ test("restore with cache found for restore key", async () => { await run(); expect(restoreCacheMock).toHaveBeenCalledTimes(1); - expect(restoreCacheMock).toHaveBeenCalledWith([path], key, [restoreKey]); + expect(restoreCacheMock).toHaveBeenCalledWith( + [path], + key, + [restoreKey], + {}, + false + ); expect(outputMock).toHaveBeenCalledWith("cache-primary-key", key); expect(outputMock).toHaveBeenCalledWith("cache-hit", "false"); diff --git a/__tests__/save.test.ts b/__tests__/save.test.ts index 63b3aa5..1eb9c7b 100644 --- a/__tests__/save.test.ts +++ b/__tests__/save.test.ts @@ -35,6 +35,14 @@ beforeAll(() => { } ); + jest.spyOn(actionUtils, "getInputAsBool").mockImplementation( + (name, options) => { + return jest + .requireActual("../src/utils/actionUtils") + .getInputAsBool(name, options); + } + ); + jest.spyOn(actionUtils, "isExactKeyMatch").mockImplementation( (key, cacheResult) => { return jest @@ -95,9 +103,14 @@ test("save with valid inputs uploads a cache", async () => { await run(); expect(saveCacheMock).toHaveBeenCalledTimes(1); - expect(saveCacheMock).toHaveBeenCalledWith([inputPath], primaryKey, { - uploadChunkSize: 4000000 - }); + expect(saveCacheMock).toHaveBeenCalledWith( + [inputPath], + primaryKey, + { + uploadChunkSize: 4000000 + }, + false + ); expect(failedMock).toHaveBeenCalledTimes(0); }); diff --git a/__tests__/saveImpl.test.ts b/__tests__/saveImpl.test.ts index ab43047..198c25b 100644 --- a/__tests__/saveImpl.test.ts +++ b/__tests__/saveImpl.test.ts @@ -32,6 +32,14 @@ beforeAll(() => { } ); + jest.spyOn(actionUtils, "getInputAsBool").mockImplementation( + (name, options) => { + return jest + .requireActual("../src/utils/actionUtils") + .getInputAsBool(name, options); + } + ); + jest.spyOn(actionUtils, "isExactKeyMatch").mockImplementation( (key, cacheResult) => { return jest @@ -47,6 +55,7 @@ beforeAll(() => { }); beforeEach(() => { + jest.restoreAllMocks(); process.env[Events.Key] = Events.Push; process.env[RefKey] = "refs/heads/feature-branch"; @@ -157,7 +166,7 @@ test("save on GHES with AC available", async () => { expect(saveCacheMock).toHaveBeenCalledTimes(1); expect(saveCacheMock).toHaveBeenCalledWith([inputPath], primaryKey, { uploadChunkSize: 4000000 - }); + }, false); expect(failedMock).toHaveBeenCalledTimes(0); }); @@ -251,7 +260,8 @@ test("save with large cache outputs warning", async () => { expect(saveCacheMock).toHaveBeenCalledWith( [inputPath], primaryKey, - expect.anything() + expect.anything(), + false ); expect(logWarningMock).toHaveBeenCalledTimes(1); @@ -297,7 +307,8 @@ test("save with reserve cache failure outputs warning", async () => { expect(saveCacheMock).toHaveBeenCalledWith( [inputPath], primaryKey, - expect.anything() + expect.anything(), + false ); expect(logWarningMock).toHaveBeenCalledWith( @@ -339,7 +350,8 @@ test("save with server error outputs warning", async () => { expect(saveCacheMock).toHaveBeenCalledWith( [inputPath], primaryKey, - expect.anything() + expect.anything(), + false ); expect(logWarningMock).toHaveBeenCalledTimes(1); @@ -378,9 +390,14 @@ test("save with valid inputs uploads a cache", async () => { await run(new StateProvider()); expect(saveCacheMock).toHaveBeenCalledTimes(1); - expect(saveCacheMock).toHaveBeenCalledWith([inputPath], primaryKey, { - uploadChunkSize: 4000000 - }); + expect(saveCacheMock).toHaveBeenCalledWith( + [inputPath], + primaryKey, + { + uploadChunkSize: 4000000 + }, + false + ); expect(failedMock).toHaveBeenCalledTimes(0); }); diff --git a/__tests__/saveOnly.test.ts b/__tests__/saveOnly.test.ts index 44bd732..5a7f8b0 100644 --- a/__tests__/saveOnly.test.ts +++ b/__tests__/saveOnly.test.ts @@ -35,6 +35,14 @@ beforeAll(() => { } ); + jest.spyOn(actionUtils, "getInputAsBool").mockImplementation( + (name, options) => { + return jest + .requireActual("../src/utils/actionUtils") + .getInputAsBool(name, options); + } + ); + jest.spyOn(actionUtils, "isExactKeyMatch").mockImplementation( (key, cacheResult) => { return jest @@ -85,9 +93,14 @@ test("save with valid inputs uploads a cache", async () => { await run(); expect(saveCacheMock).toHaveBeenCalledTimes(1); - expect(saveCacheMock).toHaveBeenCalledWith([inputPath], primaryKey, { - uploadChunkSize: 4000000 - }); + expect(saveCacheMock).toHaveBeenCalledWith( + [inputPath], + primaryKey, + { + uploadChunkSize: 4000000 + }, + false + ); expect(failedMock).toHaveBeenCalledTimes(0); }); @@ -112,9 +125,14 @@ test("save failing logs the warning message", async () => { await run(); expect(saveCacheMock).toHaveBeenCalledTimes(1); - expect(saveCacheMock).toHaveBeenCalledWith([inputPath], primaryKey, { - uploadChunkSize: 4000000 - }); + expect(saveCacheMock).toHaveBeenCalledWith( + [inputPath], + primaryKey, + { + uploadChunkSize: 4000000 + }, + false + ); expect(warningMock).toHaveBeenCalledTimes(1); expect(warningMock).toHaveBeenCalledWith("Cache save failed."); diff --git a/action.yml b/action.yml index 4e10aa0..6ae97e8 100644 --- a/action.yml +++ b/action.yml @@ -15,7 +15,7 @@ inputs: description: 'The chunk size used to split up large files during upload, in bytes' required: false enableCrossOsArchive: - description: 'An optional boolean enabled to save and restore cache on windows which could be restored and saved on any platform' + description: 'An optional boolean when enabled, allows windows runners to save/restore caches that can be restored/saved respectively on other platforms' default: 'false' required: false outputs: diff --git a/dist/restore-only/index.js b/dist/restore-only/index.js index b48bfff..f676abb 100644 --- a/dist/restore-only/index.js +++ b/dist/restore-only/index.js @@ -10118,7 +10118,8 @@ function getInputAsInt(name, options) { } exports.getInputAsInt = getInputAsInt; function getInputAsBool(name, options) { - return core.getBooleanInput(name, options); + const result = core.getInput(name, options); + return result.toLowerCase() === "true"; } exports.getInputAsBool = getInputAsBool; function isCacheFeatureAvailable() { diff --git a/dist/restore/index.js b/dist/restore/index.js index e7c1ae1..6415478 100644 --- a/dist/restore/index.js +++ b/dist/restore/index.js @@ -38646,7 +38646,8 @@ function getInputAsInt(name, options) { } exports.getInputAsInt = getInputAsInt; function getInputAsBool(name, options) { - return core.getBooleanInput(name, options); + const result = core.getInput(name, options); + return result.toLowerCase() === "true"; } exports.getInputAsBool = getInputAsBool; function isCacheFeatureAvailable() { diff --git a/dist/save-only/index.js b/dist/save-only/index.js index a7c83c8..0d3295c 100644 --- a/dist/save-only/index.js +++ b/dist/save-only/index.js @@ -38697,7 +38697,8 @@ function getInputAsInt(name, options) { } exports.getInputAsInt = getInputAsInt; function getInputAsBool(name, options) { - return core.getBooleanInput(name, options); + const result = core.getInput(name, options); + return result.toLowerCase() === "true"; } exports.getInputAsBool = getInputAsBool; function isCacheFeatureAvailable() { diff --git a/dist/save/index.js b/dist/save/index.js index c6c36c6..1b0a733 100644 --- a/dist/save/index.js +++ b/dist/save/index.js @@ -38641,7 +38641,8 @@ function getInputAsInt(name, options) { } exports.getInputAsInt = getInputAsInt; function getInputAsBool(name, options) { - return core.getBooleanInput(name, options); + const result = core.getInput(name, options); + return result.toLowerCase() === "true"; } exports.getInputAsBool = getInputAsBool; function isCacheFeatureAvailable() { diff --git a/restore/action.yml b/restore/action.yml index c84cc66..fff04eb 100644 --- a/restore/action.yml +++ b/restore/action.yml @@ -12,7 +12,7 @@ inputs: 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.' required: false enableCrossOsArchive: - description: 'An optional boolean enabled to restore cache on windows which could be saved on any platform' + description: 'An optional boolean to enable restoring a cache on Windows which was created on another platform' default: 'false' required: false outputs: diff --git a/save/action.yml b/save/action.yml index 7ce3b57..51ab8f1 100644 --- a/save/action.yml +++ b/save/action.yml @@ -12,7 +12,7 @@ inputs: description: 'The chunk size used to split up large files during upload, in bytes' required: false enableCrossOsArchive: - description: 'An optional boolean enabled to save cache on windows which could be restored on any platform' + description: 'An optional boolean to enable saving a cache on Windows which may be restored later on another platform' default: 'false' required: false runs: diff --git a/src/utils/actionUtils.ts b/src/utils/actionUtils.ts index 73317cf..dc18fa4 100644 --- a/src/utils/actionUtils.ts +++ b/src/utils/actionUtils.ts @@ -56,7 +56,8 @@ export function getInputAsBool( name: string, options?: core.InputOptions ): boolean { - return core.getBooleanInput(name, options); + const result = core.getInput(name, options); + return result.toLowerCase() === "true"; } export function isCacheFeatureAvailable(): boolean { diff --git a/src/utils/testUtils.ts b/src/utils/testUtils.ts index 9e2134f..c0a3f43 100644 --- a/src/utils/testUtils.ts +++ b/src/utils/testUtils.ts @@ -13,6 +13,7 @@ interface CacheInput { path: string; key: string; restoreKeys?: string[]; + enableCrossOsArchive?: boolean; } export function setInputs(input: CacheInput): void { @@ -20,6 +21,11 @@ export function setInputs(input: CacheInput): void { setInput(Inputs.Key, input.key); input.restoreKeys && setInput(Inputs.RestoreKeys, input.restoreKeys.join("\n")); + input.enableCrossOsArchive !== undefined && + setInput( + Inputs.EnableCrossOsArchive, + input.enableCrossOsArchive.toString() + ); } export function clearInputs(): void { @@ -27,4 +33,5 @@ export function clearInputs(): void { delete process.env[getInputName(Inputs.Key)]; delete process.env[getInputName(Inputs.RestoreKeys)]; delete process.env[getInputName(Inputs.UploadChunkSize)]; + delete process.env[getInputName(Inputs.EnableCrossOsArchive)]; }