This commit is contained in:
14
main.py
14
main.py
@@ -120,6 +120,7 @@ def build_message(event_object, action_str, type_str):
|
|||||||
|
|
||||||
def sendToAgent(event_object):
|
def sendToAgent(event_object):
|
||||||
headers = {"x-openclaw-token": OPENCLAW_TOKEN, "Content-Type": "application/json"}
|
headers = {"x-openclaw-token": OPENCLAW_TOKEN, "Content-Type": "application/json"}
|
||||||
|
print(f"Preparing to send notification to Agent for {json.dumps(event_object)}")
|
||||||
|
|
||||||
if event_object.get("type") == "issue_comment":
|
if event_object.get("type") == "issue_comment":
|
||||||
action_str = "created"
|
action_str = "created"
|
||||||
@@ -338,13 +339,7 @@ def main(args):
|
|||||||
set_stored_assignees(
|
set_stored_assignees(
|
||||||
db, event_type, repo_id, event_object["number"], assignees_list
|
db, event_type, repo_id, event_object["number"], assignees_list
|
||||||
)
|
)
|
||||||
|
|
||||||
print(f"--- {event_object['type'].upper()} {action.capitalize()} ---")
|
|
||||||
print(f"Title: {event_object['title']}")
|
|
||||||
print(f"Assignees: {', '.join(event_object['assignees'])}")
|
|
||||||
print(f"Repo: {event_object['repository']}")
|
|
||||||
print(f"By: {event_object['sender']}")
|
|
||||||
|
|
||||||
# Send to OpenClaw
|
# Send to OpenClaw
|
||||||
if action == "assigned":
|
if action == "assigned":
|
||||||
sendToAgent(event_object)
|
sendToAgent(event_object)
|
||||||
@@ -373,11 +368,6 @@ def main(args):
|
|||||||
"url": comment_data.get("html_url"),
|
"url": comment_data.get("html_url"),
|
||||||
}
|
}
|
||||||
|
|
||||||
print(f"--- {event_object['type'].upper()} {action.capitalize()} ---")
|
|
||||||
print(f"Title: {event_object['title']}")
|
|
||||||
print(f"Repo: {event_object['repository']}")
|
|
||||||
print(f"By: {event_object['sender']}")
|
|
||||||
|
|
||||||
sendToAgent(event_object)
|
sendToAgent(event_object)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user