Skip to content

Commit 947ab07

Browse files
committed
don't let the AI replicate
1 parent ea16342 commit 947ab07

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

codeflash/cli_cmds/cli.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ def process_and_validate_cmd_args(args: Namespace) -> Namespace:
109109
if not Path(test_path).is_file():
110110
exit_with_message(f"Replay test file {test_path} does not exist", error_on_exit=True)
111111
args.replay_test = [Path(replay_test).resolve() for replay_test in args.replay_test]
112+
if env_utils.is_ci():
113+
args.no_pr = True
112114

113115
return args
114116

codeflash/code_utils/env_utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ def get_cached_gh_event_data() -> dict[str, Any] | None:
112112
return json.load(f) # type: ignore # noqa
113113

114114

115+
@lru_cache(maxsize=1)
116+
def is_ci() -> bool:
117+
"""Check if running in a CI environment."""
118+
return bool(os.environ.get("CI") or os.environ.get("GITHUB_ACTIONS"))
119+
120+
115121
@lru_cache(maxsize=1)
116122
def is_LSP_enabled() -> bool:
117123
return console.quiet

0 commit comments

Comments
 (0)