mirror of
https://github.com/actions/cache.git
synced 2024-12-27 12:03:03 +07:00
Slight modification for test cases check
This commit is contained in:
parent
8a88690a20
commit
19446b165a
6
dist/restore/index.js
vendored
6
dist/restore/index.js
vendored
@ -49015,14 +49015,14 @@ function run() {
|
|||||||
});
|
});
|
||||||
const cacheKey = yield cache.restoreCache(cachePaths, primaryKey, restoreKeys);
|
const cacheKey = yield cache.restoreCache(cachePaths, primaryKey, restoreKeys);
|
||||||
//Check if user wants to save cache despite of failure in any previous job
|
//Check if user wants to save cache despite of failure in any previous job
|
||||||
const saveCache = core.getBooleanInput(constants_1.Inputs.SaveOnAnyFailure);
|
const saveCache = core.getInput(constants_1.Inputs.SaveOnAnyFailure).toLowerCase();
|
||||||
if (saveCache == true) {
|
if (saveCache == "true") {
|
||||||
core.debug(`Exporting environment variable ${constants_1.Variables.SaveCacheOnAnyFailure}`);
|
core.debug(`Exporting environment variable ${constants_1.Variables.SaveCacheOnAnyFailure}`);
|
||||||
core.exportVariable(constants_1.Variables.SaveCacheOnAnyFailure, saveCache);
|
core.exportVariable(constants_1.Variables.SaveCacheOnAnyFailure, saveCache);
|
||||||
core.info(`Input Variable ${constants_1.Variables.SaveCacheOnAnyFailure} is set to true, the cache will be saved despite of any failure in the build.`);
|
core.info(`Input Variable ${constants_1.Variables.SaveCacheOnAnyFailure} is set to true, the cache will be saved despite of any failure in the build.`);
|
||||||
}
|
}
|
||||||
if (!cacheKey) {
|
if (!cacheKey) {
|
||||||
if (core.getBooleanInput(constants_1.Inputs.FailOnCacheMiss) == true) {
|
if (core.getInput(constants_1.Inputs.FailOnCacheMiss).toLowerCase() == "true") {
|
||||||
throw new Error(`Cache with the given input key ${primaryKey} is not found, hence exiting the workflow as the fail-on-cache-miss requirement is not met.`);
|
throw new Error(`Cache with the given input key ${primaryKey} is not found, hence exiting the workflow as the fail-on-cache-miss requirement is not met.`);
|
||||||
}
|
}
|
||||||
core.info(`Cache not found for input keys: ${[
|
core.info(`Cache not found for input keys: ${[
|
||||||
|
@ -36,8 +36,8 @@ async function run(): Promise<void> {
|
|||||||
);
|
);
|
||||||
|
|
||||||
//Check if user wants to save cache despite of failure in any previous job
|
//Check if user wants to save cache despite of failure in any previous job
|
||||||
const saveCache = core.getBooleanInput(Inputs.SaveOnAnyFailure);
|
const saveCache = core.getInput(Inputs.SaveOnAnyFailure).toLowerCase();
|
||||||
if (saveCache == true) {
|
if (saveCache == "true") {
|
||||||
core.debug(
|
core.debug(
|
||||||
`Exporting environment variable ${Variables.SaveCacheOnAnyFailure}`
|
`Exporting environment variable ${Variables.SaveCacheOnAnyFailure}`
|
||||||
);
|
);
|
||||||
@ -48,7 +48,7 @@ async function run(): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!cacheKey) {
|
if (!cacheKey) {
|
||||||
if (core.getBooleanInput(Inputs.FailOnCacheMiss) == true) {
|
if (core.getInput(Inputs.FailOnCacheMiss).toLowerCase() == "true") {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Cache with the given input key ${primaryKey} is not found, hence exiting the workflow as the fail-on-cache-miss requirement is not met.`
|
`Cache with the given input key ${primaryKey} is not found, hence exiting the workflow as the fail-on-cache-miss requirement is not met.`
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user