From 8dd60badf6a5d2f2da63c39aa4227adda57e81d8 Mon Sep 17 00:00:00 2001 From: "Ivan Zosimov (Akvelon INC)" Date: Mon, 21 Feb 2022 18:26:18 +0300 Subject: [PATCH] Change behavior of the post-job If caching is not enabled by action.yml input, save of the cache won't occur in the post-job. --- dist/cache-save/index.js | 3 +++ src/cache-save.ts | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/dist/cache-save/index.js b/dist/cache-save/index.js index 3177996..9632fa5 100644 --- a/dist/cache-save/index.js +++ b/dist/cache-save/index.js @@ -46368,6 +46368,9 @@ function run() { } exports.run = run; const cachePackages = () => __awaiter(void 0, void 0, void 0, function* () { + const cachingFlag = core.getInput('cache'); + if (!cachingFlag) + return; const state = core.getState(constants_1.State.CacheMatchedKey); const primaryKey = core.getState(constants_1.State.CachePrimaryKey); const packageManagerInfo = yield cache_utils_1.getPackageManagerInfo(); diff --git a/src/cache-save.ts b/src/cache-save.ts index 03a6e7a..a1a80c6 100644 --- a/src/cache-save.ts +++ b/src/cache-save.ts @@ -21,6 +21,10 @@ export async function run() { } const cachePackages = async () => { + + const cachingFlag = core.getInput('cache'); + if (!cachingFlag) return; + const state = core.getState(State.CacheMatchedKey); const primaryKey = core.getState(State.CachePrimaryKey);