mirror of
https://code.forgejo.org/actions/cache.git
synced 2025-04-21 00:03:58 +08:00
refactor into a generic outputter
This commit is contained in:
parent
706c369cf1
commit
d95c048983
4 changed files with 36 additions and 30 deletions
|
@ -1,17 +1,8 @@
|
|||
import * as core from "@actions/core";
|
||||
|
||||
import { Outputs } from "./constants";
|
||||
import { NonStateOuputSetter } from "./outputSetter";
|
||||
import run from "./restoreImpl";
|
||||
import * as utils from "./utils/actionUtils";
|
||||
|
||||
async function restoreOnly(): Promise<void> {
|
||||
const cacheKey = await run();
|
||||
if (cacheKey) {
|
||||
// Store the matched cache key in output
|
||||
core.setOutput(Outputs.Key, utils.getCacheState());
|
||||
|
||||
core.info(`Cache restored from key: ${cacheKey}`);
|
||||
}
|
||||
await run(new NonStateOuputSetter());
|
||||
}
|
||||
|
||||
export default restoreOnly;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue