cache: move gha cache save to post state

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2024-03-15 09:17:15 +01:00
parent cbcf885731
commit 9b446bf084
3 changed files with 83 additions and 5 deletions

View File

@@ -16,6 +16,8 @@
import * as core from '@actions/core';
import {Cache} from './cache';
const isPost = !!process.env['STATE_isPost'];
if (!isPost) {
core.saveState('isPost', 'true');
@@ -36,7 +38,10 @@ export async function run(main: () => Promise<void>, post?: () => Promise<void>)
} catch (e) {
core.setFailed(e.message);
}
} else if (post) {
await post();
} else {
if (post) {
await post();
}
await Cache.post();
}
}