mirror of
https://github.com/codeflash-ai/codeflash.git
synced 2026-05-04 18:25:17 +00:00
check for already installation of GHA
This commit is contained in:
parent
f370439c1d
commit
522ea97b5d
1 changed files with 13 additions and 0 deletions
|
|
@ -372,6 +372,19 @@ def install_github_actions() -> None:
|
|||
workflows_path = git_root / ".github" / "workflows"
|
||||
optimize_yaml_path = workflows_path / "codeflash.yaml"
|
||||
|
||||
# Check if the workflow file already exists
|
||||
if optimize_yaml_path.exists():
|
||||
confirm_overwrite = inquirer_wrapper(
|
||||
inquirer.confirm,
|
||||
message=f"⚡️ GitHub Actions workflow already exists at {optimize_yaml_path}. Overwrite?",
|
||||
default=False, # Don't overwrite by default
|
||||
)
|
||||
ph("cli-github-optimization-confirm-workflow-overwrite", {"confirm_overwrite": confirm_overwrite})
|
||||
if not confirm_overwrite:
|
||||
click.echo("⏩️ Skipping workflow creation.")
|
||||
ph("cli-github-workflow-skipped")
|
||||
return
|
||||
|
||||
confirm_creation_yes = inquirer_wrapper(
|
||||
inquirer.confirm,
|
||||
message="⚡️Shall I set up a GitHub action that will continuously optimize all new code in GitHub PRs"
|
||||
|
|
|
|||
Loading…
Reference in a new issue