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.
This commit is contained in:
Ivan Zosimov (Akvelon INC) 2022-02-21 18:26:18 +03:00
parent 766a3397b4
commit 8dd60badf6
2 changed files with 7 additions and 0 deletions

View file

@ -46368,6 +46368,9 @@ function run() {
} }
exports.run = run; exports.run = run;
const cachePackages = () => __awaiter(void 0, void 0, void 0, function* () { 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 state = core.getState(constants_1.State.CacheMatchedKey);
const primaryKey = core.getState(constants_1.State.CachePrimaryKey); const primaryKey = core.getState(constants_1.State.CachePrimaryKey);
const packageManagerInfo = yield cache_utils_1.getPackageManagerInfo(); const packageManagerInfo = yield cache_utils_1.getPackageManagerInfo();

View file

@ -21,6 +21,10 @@ export async function run() {
} }
const cachePackages = async () => { const cachePackages = async () => {
const cachingFlag = core.getInput('cache');
if (!cachingFlag) return;
const state = core.getState(State.CacheMatchedKey); const state = core.getState(State.CacheMatchedKey);
const primaryKey = core.getState(State.CachePrimaryKey); const primaryKey = core.getState(State.CachePrimaryKey);