wony617
commited on
Commit
Β·
36e29b8
1
Parent(s):
7968496
Add pr success log
Browse files- agent/workflow.py +10 -0
- pr_success.log +2 -0
agent/workflow.py
CHANGED
@@ -215,6 +215,16 @@ def generate_github_pr(
|
|
215 |
toctree_status = f"\nπ **Toctree Update Failed:** β {toctree_result['message']}"
|
216 |
|
217 |
if result["status"] == "success":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
218 |
return f"""β
**GitHub PR Creation Successful!**
|
219 |
|
220 |
π **PR URL:** {result["pr_url"]}
|
|
|
215 |
toctree_status = f"\nπ **Toctree Update Failed:** β {toctree_result['message']}"
|
216 |
|
217 |
if result["status"] == "success":
|
218 |
+
# Log successful PR to file
|
219 |
+
import datetime
|
220 |
+
log_entry = f"[{datetime.datetime.now().isoformat()}] {result['file_path']} -> {result['pr_url']}\n"
|
221 |
+
try:
|
222 |
+
with open("pr_success.log", "a", encoding="utf-8") as f:
|
223 |
+
f.write(log_entry)
|
224 |
+
print(f"β
Logged successful PR: {log_entry.strip()}")
|
225 |
+
except Exception as e:
|
226 |
+
print(f"β Failed to log PR success: {e}")
|
227 |
+
|
228 |
return f"""β
**GitHub PR Creation Successful!**
|
229 |
|
230 |
π **PR URL:** {result["pr_url"]}
|
pr_success.log
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
# PR Success Log
|
2 |
+
# Format: [timestamp] file_path -> pr_url
|