Skip to content

Commit bf533bb

Browse files
committed
[IMP] F#T66913 skip changes outside of working folder
1 parent cc0fc06 commit bf533bb

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "trobz-agent"
3-
version = "1.0.1"
3+
version = "1.0.2"
44
description = "Run an AI agent"
55
authors = [{name = "Hai Lang", email = "[email protected]"}]
66
requires-python = ">=3.10"
@@ -27,7 +27,7 @@ dev = [
2727
]
2828

2929
[tool.pytest.ini_options]
30-
testpaths = ["tests"]
30+
# testpaths = ["tests"]
3131

3232

3333
[build-system]

trobz_agent/agent.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,20 @@ def commit_if_change(cwd, step):
7373
changes = run_read(cwd, "git", "status", "--short")
7474
if not changes.strip():
7575
return
76+
changed = False
77+
for line in changes.split("\n"):
78+
line = line[3:].strip()
79+
if not line or line.startswith(".."):
80+
continue
81+
changed = True
82+
break
83+
if not changed:
84+
return
7685
run(cwd, "git", "add", ".")
7786
message = step["commit_if_change"]
7887
if message == True: # noqa: E712
7988
message = step["name"]
80-
run(cwd, "git", "commit", "-m", message)
89+
run(cwd, "git", "commit", "--no-verify", "-m", message)
8190

8291

8392
def run_workflow(workflow_dir, workflow, backend, mode, model): # noqa: C901

0 commit comments

Comments
 (0)