Skip to content

Commit e7d8f2e

Browse files
committed
Apply nice formatting for the issue body #349
Signed-off-by: tdruez <tdruez@nexb.com>
1 parent 1f3bd88 commit e7d8f2e

1 file changed

Lines changed: 18 additions & 9 deletions

File tree

workflow/integrations/github.py

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,24 @@ def make_issue_title(request):
5252

5353

5454
def make_issue_body(request):
55-
body = f"""
56-
- Request template: {request.request_template}
57-
- Product context: {request.product_context}
58-
- Applies to: {request.content_object}
59-
- Submitted by: {request.requester}
60-
- Assigned to: {request.assignee}
61-
- Priority: {request.priority}
62-
"""
63-
return body
55+
lines = [
56+
f"### 📝 Request Template\n{request.request_template}",
57+
f"### 📦 Product Context\n{request.product_context}",
58+
f"### 📌 Applies To\n{request.content_object}",
59+
f"### 🙋 Submitted By\n{request.requester}",
60+
f"### 👤 Assigned To\n{request.assignee}",
61+
f"### 🚨 Priority\n{request.priority}",
62+
f"### 🗒️ Notes\n{request.notes}",
63+
"----",
64+
]
65+
66+
for question in request.get_serialized_data_as_list():
67+
value = question.get("value")
68+
if question.get("input_type") == 'BooleanField':
69+
value = "Yes" if value in [1, '1'] else "No"
70+
lines.append(f"### {question.get('label')}\n{value}")
71+
72+
return "\n\n".join(lines)
6473

6574

6675
def extract_github_repo_path(url):

0 commit comments

Comments
 (0)