feat: initial
This commit is contained in:
commit
b04a255b4c
17 changed files with 6509 additions and 0 deletions
23
src/index.js
Normal file
23
src/index.js
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import * as core from "@actions/core";
|
||||
import { checkPrerequisites } from "./utils";
|
||||
import { restore } from "./restore";
|
||||
import { save } from "./save";
|
||||
|
||||
const run = async () => {
|
||||
const isPost = core.getState("isPost") === "true";
|
||||
|
||||
try {
|
||||
await checkPrerequisites();
|
||||
|
||||
if (!isPost) {
|
||||
core.saveState("isPost", "true");
|
||||
await restore();
|
||||
} else {
|
||||
await save();
|
||||
}
|
||||
} catch (error) {
|
||||
core.setFailed(`Unexpected error: ${error.message}`);
|
||||
}
|
||||
};
|
||||
|
||||
run();
|
||||
Loading…
Add table
Add a link
Reference in a new issue