diff --git a/spcd/__init__.py b/spcd/__init__.py index 2064a3d..cf40de2 100644 --- a/spcd/__init__.py +++ b/spcd/__init__.py @@ -44,7 +44,7 @@ def clone_project_branch() -> None: ) -def install_actions(path: Path) -> None: +def install_actions() -> None: """Make actions usable in workflows. :param path: entry point file @@ -54,21 +54,34 @@ def install_actions(path: Path) -> None: name = "action.yaml" root = project.root / "act" vpy = Path(env.SPCD_PYTHON_VENV_BINARIES) / "python" - action = "synchronize" - log.info(action) - directory = root / action - fs.make_directory(directory) - fs.write(directory / name, f"""\ + for action in ["action", "synchronize"]: + log.info(action) + directory = root / action + fs.make_directory(directory) + match action: + case "action": + yaml = """\ +inputs: + arg-1: + required: true + arg_2: + required: true +""" + case "synchronize": + yaml = """\ inputs: source: default: out required: false +""" + yaml = f"""{yaml}\ runs: using: composite steps: - - run: {vpy} -m spcd synchronize -""") - cat(directory / name) + - run: {vpy} -m spcd {action} +""" + fs.write(directory / name, yaml) + cat(directory / name) def install_commands(path: Path) -> None: