feat: test-generation + issue/PR summary via slash commands (/gen-tests, /summarize)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -41,3 +41,30 @@ def pull_request():
|
||||
"base_ref": (pr.get("base") or {}).get("ref", ""),
|
||||
"head_sha": (pr.get("head") or {}).get("sha", ""),
|
||||
}
|
||||
|
||||
|
||||
def event_name():
|
||||
"""Name des auslösenden Events (push, pull_request, issue_comment, …)."""
|
||||
return os.environ.get("GITHUB_EVENT_NAME", "")
|
||||
|
||||
|
||||
def comment_body():
|
||||
"""Body des auslösenden Kommentars (issue_comment-Event) oder ''."""
|
||||
return (event().get("comment") or {}).get("body") or ""
|
||||
|
||||
|
||||
def issue():
|
||||
"""Issue/PR-Infos aus einem issue_comment-Event oder None.
|
||||
|
||||
Liefert dict: index, title, body, author, is_pr.
|
||||
"""
|
||||
iss = event().get("issue")
|
||||
if not iss:
|
||||
return None
|
||||
return {
|
||||
"index": iss.get("number"),
|
||||
"title": iss.get("title", ""),
|
||||
"body": iss.get("body", "") or "",
|
||||
"author": (iss.get("user") or {}).get("login", ""),
|
||||
"is_pr": bool(iss.get("pull_request")),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user