mirror of
https://github.com/ryanccn/attic-action.git
synced 2025-03-13 09:36:11 +00:00
22 lines
495 B
TypeScript
22 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();
|
|
}
|