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:
2026-06-10 07:09:11 +02:00
parent dc35579135
commit eb0437b0ed
7 changed files with 233 additions and 0 deletions

View File

@@ -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")),
}