From a83ee02038ed864df79b98eaab2b2fff4d301179 Mon Sep 17 00:00:00 2001 From: bailey everts Date: Tue, 17 Sep 2024 17:34:53 -0600 Subject: [PATCH 1/2] feat: use blocks for issue-body --- approval.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/approval.go b/approval.go index e2bb13f..ff801c1 100644 --- a/approval.go +++ b/approval.go @@ -58,12 +58,14 @@ func (a *approvalEnvironment) createApprovalIssue(ctx context.Context) error { issueTitle = fmt.Sprintf("%s: %s", issueTitle, a.issueTitle) } - issueBody := fmt.Sprintf(`Workflow is pending manual review. -URL: %s + issueBody := fmt.Sprintf(`> Workflow is pending manual review. +> URL: %s -Required approvers: %s +> [!IMPORTANT] +> Required approvers: %s -Respond %s to continue workflow or %s to cancel.`, +> [!TIP] +> Respond %s to continue workflow or %s to cancel.`, a.runURL(), a.issueApprovers, formatAcceptedWords(approvedWords), @@ -71,8 +73,9 @@ Respond %s to continue workflow or %s to cancel.`, ) if a.issueBody != "" { - issueBody = fmt.Sprintf("%s\n\n%s", a.issueBody, issueBody) + issueBody = fmt.Sprintf(">%s\n>\n%s", a.issueBody, issueBody) } + issueBody = fmt.Sprintf(">[!NOTE]\n%s", issueBody) var err error fmt.Printf( From fb6c0e3b89a98e09a7f1976436f4a6f0609b5a0b Mon Sep 17 00:00:00 2001 From: bailey everts Date: Tue, 17 Sep 2024 19:36:05 -0600 Subject: [PATCH 2/2] feat: dispaly users as a list --- approval.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/approval.go b/approval.go index ff801c1..af03a4c 100644 --- a/approval.go +++ b/approval.go @@ -58,16 +58,22 @@ func (a *approvalEnvironment) createApprovalIssue(ctx context.Context) error { issueTitle = fmt.Sprintf("%s: %s", issueTitle, a.issueTitle) } + approversBody := "" + for _, approver := range a.issueApprovers { + approversBody = fmt.Sprintf("%s> * @%s\n", approversBody, approver) + } + issueBody := fmt.Sprintf(`> Workflow is pending manual review. > URL: %s > [!IMPORTANT] -> Required approvers: %s +> Required approvers: +%s > [!TIP] > Respond %s to continue workflow or %s to cancel.`, a.runURL(), - a.issueApprovers, + approversBody, formatAcceptedWords(approvedWords), formatAcceptedWords(deniedWords), )