attic-action/index.ts
2024-06-16 21:20:37 -06:00

23 lines
495 B
TypeScript

import { install, isInstalled } from "./stages/install";
import { configure } from "./stages/configure";
import { push } from "./stages/push";
import { getState, saveState, info } from "@actions/core";
const isPost = !!getState("isPost");
const main = async () => {
if (await isInstalled()) {
info("Skipping attic installation because it is already installed");
} else {
await install();
}
await configure();
};
if (!isPost) {
saveState("isPost", true);
main();
} else {
push();
}