File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -372,6 +372,19 @@ def install_github_actions() -> None:
372372 workflows_path = git_root / ".github" / "workflows"
373373 optimize_yaml_path = workflows_path / "codeflash.yaml"
374374
375+ # Check if the workflow file already exists
376+ if optimize_yaml_path .exists ():
377+ confirm_overwrite = inquirer_wrapper (
378+ inquirer .confirm ,
379+ message = f"⚡️ GitHub Actions workflow already exists at { optimize_yaml_path } . Overwrite?" ,
380+ default = False , # Don't overwrite by default
381+ )
382+ ph ("cli-github-optimization-confirm-workflow-overwrite" , {"confirm_overwrite" : confirm_overwrite })
383+ if not confirm_overwrite :
384+ click .echo ("⏩️ Skipping workflow creation." )
385+ ph ("cli-github-workflow-skipped" )
386+ return
387+
375388 confirm_creation_yes = inquirer_wrapper (
376389 inquirer .confirm ,
377390 message = "⚡️Shall I set up a GitHub action that will continuously optimize all new code in GitHub PRs"
You can’t perform that action at this time.
0 commit comments