1
0
Fork 0
mirror of https://code.forgejo.org/actions/setup-python synced 2025-06-10 05:12:19 +02:00

Add cache-save: false option

This commit is contained in:
Aarni Koskela 2023-11-10 10:24:46 +02:00
parent 7e8faf07b9
commit 8f0a0b0eda
5 changed files with 85 additions and 9 deletions

View file

@ -80475,9 +80475,23 @@ function run(earlyExit) {
try {
const cache = core.getInput('cache');
if (cache) {
yield saveCache(cache);
if (earlyExit) {
process.exit(0);
let shouldSave = true;
try {
shouldSave = core.getBooleanInput('cache-save', { required: false });
}
catch (e) {
// If we fail to parse the input, assume it's
// > "Input does not meet YAML 1.2 "core schema" specification."
// and assume it's the `true` default.
}
if (shouldSave) {
yield saveCache(cache);
if (earlyExit) {
process.exit(0);
}
}
else {
core.info('Not saving cache since `cache-save` is false');
}
}
}