mirror of
https://code.forgejo.org/actions/cache.git
synced 2025-04-23 17:23:59 +08:00
Take input and update env var
This commit is contained in:
parent
133764e0c3
commit
a781be7251
5 changed files with 14 additions and 7 deletions
|
@ -3,7 +3,8 @@ export enum Inputs {
|
|||
Path = "path",
|
||||
RestoreKeys = "restore-keys",
|
||||
UploadChunkSize = "upload-chunk-size",
|
||||
StrictRestore = "strict-restore"
|
||||
StrictRestore = "strict-restore",
|
||||
SaveCacheOnAnyFailure = "save-cache-on-any-failure"
|
||||
}
|
||||
|
||||
export enum Outputs {
|
||||
|
|
|
@ -36,11 +36,11 @@ async function run(): Promise<void> {
|
|||
);
|
||||
|
||||
//Check if user wants to save cache despite of failure in any previous job
|
||||
const saveCache = process.env[Variables.SaveCacheOnAnyFailure];
|
||||
const saveCache = process.env[Inputs.SaveCacheOnAnyFailure];
|
||||
if (saveCache === "yes") {
|
||||
// core.exportVariable(Variables.SaveCacheOnAnyFailure, saveCache);
|
||||
core.exportVariable(Variables.SaveCacheOnAnyFailure, saveCache);
|
||||
core.info(
|
||||
`Environment Variable ${Variables.SaveCacheOnAnyFailure} is set to yes, the cache will be saved despite of any failure in the build.`
|
||||
`Input Variable ${Variables.SaveCacheOnAnyFailure} is set to yes, the cache will be saved despite of any failure in the build.`
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue